diff --git a/services/web/frontend/extracted-translations.json b/services/web/frontend/extracted-translations.json index 5e7b089d5b..215529a616 100644 --- a/services/web/frontend/extracted-translations.json +++ b/services/web/frontend/extracted-translations.json @@ -354,15 +354,21 @@ "hide_document_preamble": "", "hide_outline": "", "history": "", + "history_add_label": "", + "history_adding_label": "", "history_are_you_sure_delete_label": "", + "history_compare_with_this_version": "", "history_delete_label": "", "history_deleting_label": "", + "history_download_this_version": "", "history_entry_origin_dropbox": "", "history_entry_origin_git": "", "history_entry_origin_github": "", "history_entry_origin_upload": "", "history_label_created_by": "", "history_label_project_current_state": "", + "history_label_this_version": "", + "history_new_label_name": "", "history_view_a11y_description": "", "history_view_all": "", "history_view_labels": "", @@ -512,6 +518,7 @@ "menu": "", "month": "", "more": "", + "more_actions": "", "n_items": "", "n_items_plural": "", "n_more_updates_above": "", diff --git a/services/web/frontend/js/features/history/components/change-list/add-label-modal.tsx b/services/web/frontend/js/features/history/components/change-list/add-label-modal.tsx new file mode 100644 index 0000000000..95a148ae2a --- /dev/null +++ b/services/web/frontend/js/features/history/components/change-list/add-label-modal.tsx @@ -0,0 +1,108 @@ +import { useTranslation } from 'react-i18next' +import { useState } from 'react' +import { Modal, FormGroup, FormControl } from 'react-bootstrap' +import ModalError from './modal-error' +import AccessibleModal from '../../../../shared/components/accessible-modal' +import useAsync from '../../../../shared/hooks/use-async' +import useAbortController from '../../../../shared/hooks/use-abort-controller' +import useAddOrRemoveLabels from '../../hooks/use-add-or-remove-labels' +import { useHistoryContext } from '../../context/history-context' +import { addLabel } from '../../services/api' +import { Label } from '../../services/types/label' + +type AddLabelModalProps = { + show: boolean + setShow: React.Dispatch> + version: number +} + +function AddLabelModal({ show, setShow, version }: AddLabelModalProps) { + const { t } = useTranslation() + const [comment, setComment] = useState('') + const { + isLoading, + isSuccess, + isError, + error, + data: label, + reset, + runAsync, + } = useAsync