Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ui): schedule feature update #1510

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions ui/web-v2/src/assets/svg/project.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions ui/web-v2/src/assets/svg/revert.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
66 changes: 66 additions & 0 deletions ui/web-v2/src/components/CancelScheduleDialog/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
import { AppDispatch } from '../../store';
import { Dialog } from '@headlessui/react';
import { FC } from 'react';
import { useIntl } from 'react-intl';
import { shallowEqual, useDispatch, useSelector } from 'react-redux';

Check failure on line 5 in ui/web-v2/src/components/CancelScheduleDialog/index.tsx

View workflow job for this annotation

GitHub Actions / build

'shallowEqual' is defined but never used

Check failure on line 5 in ui/web-v2/src/components/CancelScheduleDialog/index.tsx

View workflow job for this annotation

GitHub Actions / build

'useSelector' is defined but never used

import { messages } from '../../lang/messages';
import { Modal } from '../Modal';
import RevertSvg from '../../assets/svg/revert.svg';
import { updateFeature } from '../../modules/features';

Check failure on line 10 in ui/web-v2/src/components/CancelScheduleDialog/index.tsx

View workflow job for this annotation

GitHub Actions / build

'updateFeature' is defined but never used

interface CancelScheduleDialogProps {
open: boolean;
onClose: () => void;
}

export const CancelScheduleDialog: FC<CancelScheduleDialogProps> = ({
open,
onClose
}) => {
const dispatch = useDispatch<AppDispatch>();

Check failure on line 21 in ui/web-v2/src/components/CancelScheduleDialog/index.tsx

View workflow job for this annotation

GitHub Actions / build

'dispatch' is assigned a value but never used
const { formatMessage: f } = useIntl();

const handleCancel = () => {
// dispatch(updateFeature({ id: 1, status: 'scheduled' }));
onClose();
};
return (
<Modal open={open} onClose={onClose}>
<Dialog.Title
as="h3"
className="text-lg font-medium leading-6 text-gray-900"
>
Revert Updates
</Dialog.Title>
<div className="py-6 flex justify-center">
<RevertSvg />
</div>
<div className="mt-2 text-center px-5">
<p className="text-sm text-gray-500">
The scheduled changes for <strong>01/31/2025 at 09:30</strong> are
going to be reverted permanently. Are you sure you want to proceed?
</p>
</div>
<div className="pt-10">
<div className="flex justify-end">
<button
type="button"
className="btn-cancel mr-3"
disabled={false}
onClick={onClose}
>
{f(messages.button.cancel)}
</button>
<button
type="button"
className="btn bg-[#EB1726]"
onClick={handleCancel}
>
Revert
</button>
</div>
</div>
</Modal>
);
};
Loading
Loading