|
@@ -17,6 +17,8 @@ import { useProjectListContext } from '../../context/project-list-context'
|
|
|
import { getUserFacingMessage } from '../../../../infrastructure/fetch-json'
|
|
import { getUserFacingMessage } from '../../../../infrastructure/fetch-json'
|
|
|
import { debugConsole } from '@/utils/debugging'
|
|
import { debugConsole } from '@/utils/debugging'
|
|
|
import { isMobileDevice } from '../../../../infrastructure/event-tracking'
|
|
import { isMobileDevice } from '../../../../infrastructure/event-tracking'
|
|
|
|
|
+import Notification from '@/shared/components/notification'
|
|
|
|
|
+import getMeta from '@/utils/meta'
|
|
|
|
|
|
|
|
type RenameProjectModalProps = {
|
|
type RenameProjectModalProps = {
|
|
|
handleCloseModal: () => void
|
|
handleCloseModal: () => void
|
|
@@ -33,6 +35,10 @@ function RenameProjectModal({
|
|
|
const [newProjectName, setNewProjectName] = useState(project.name)
|
|
const [newProjectName, setNewProjectName] = useState(project.name)
|
|
|
const { error, isError, isLoading, runAsync } = useAsync()
|
|
const { error, isError, isLoading, runAsync } = useAsync()
|
|
|
const { updateProjectViewData } = useProjectListContext()
|
|
const { updateProjectViewData } = useProjectListContext()
|
|
|
|
|
+ const newNotificationStyle = getMeta(
|
|
|
|
|
+ 'ol-newNotificationStyle',
|
|
|
|
|
+ false
|
|
|
|
|
+ ) as boolean
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
|
if (showModal) {
|
|
if (showModal) {
|
|
@@ -94,6 +100,19 @@ function RenameProjectModal({
|
|
|
<Modal.Title>{t('rename_project')}</Modal.Title>
|
|
<Modal.Title>{t('rename_project')}</Modal.Title>
|
|
|
</Modal.Header>
|
|
</Modal.Header>
|
|
|
<Modal.Body>
|
|
<Modal.Body>
|
|
|
|
|
+ {isError &&
|
|
|
|
|
+ (newNotificationStyle ? (
|
|
|
|
|
+ <div className="notification-list">
|
|
|
|
|
+ <Notification
|
|
|
|
|
+ type="error"
|
|
|
|
|
+ content={getUserFacingMessage(error) as string}
|
|
|
|
|
+ />
|
|
|
|
|
+ </div>
|
|
|
|
|
+ ) : (
|
|
|
|
|
+ <Alert bsStyle="danger" className="text-center" aria-live="polite">
|
|
|
|
|
+ {getUserFacingMessage(error)}
|
|
|
|
|
+ </Alert>
|
|
|
|
|
+ ))}
|
|
|
<form id="rename-project-form" onSubmit={handleSubmit}>
|
|
<form id="rename-project-form" onSubmit={handleSubmit}>
|
|
|
<FormGroup>
|
|
<FormGroup>
|
|
|
<ControlLabel htmlFor="rename-project-form-name">
|
|
<ControlLabel htmlFor="rename-project-form-name">
|
|
@@ -112,11 +131,6 @@ function RenameProjectModal({
|
|
|
</form>
|
|
</form>
|
|
|
</Modal.Body>
|
|
</Modal.Body>
|
|
|
<Modal.Footer>
|
|
<Modal.Footer>
|
|
|
- {isError && (
|
|
|
|
|
- <Alert bsStyle="danger" className="text-center" aria-live="polite">
|
|
|
|
|
- {getUserFacingMessage(error)}
|
|
|
|
|
- </Alert>
|
|
|
|
|
- )}
|
|
|
|
|
<Button
|
|
<Button
|
|
|
bsStyle={null}
|
|
bsStyle={null}
|
|
|
className="btn-secondary"
|
|
className="btn-secondary"
|