Skip to content

Commit 448fcad

Browse files
rpenidokdmccormick
andauthored
feat: add deprecation warning to create legacy library form [FC-0123] (#2963)
-------- Co-authored-by: Kyle McCormick <[email protected]>
1 parent b7955ce commit 448fcad

2 files changed

Lines changed: 32 additions & 1 deletion

File tree

src/library-authoring/create-legacy-library/CreateLegacyLibrary.tsx

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,16 @@ import { StudioFooterSlot } from '@edx/frontend-component-footer';
22
import { getConfig } from '@edx/frontend-platform';
33
import { useIntl } from '@edx/frontend-platform/i18n';
44
import {
5+
Alert,
56
Container,
67
Form,
78
Button,
89
StatefulButton,
910
ActionRow,
1011
} from '@openedx/paragon';
12+
import { Warning } from '@openedx/paragon/icons';
1113
import { Formik } from 'formik';
12-
import { useNavigate } from 'react-router-dom';
14+
import { useNavigate, Link } from 'react-router-dom';
1315
import * as Yup from 'yup';
1416
import classNames from 'classnames';
1517

@@ -100,6 +102,20 @@ export const CreateLegacyLibrary = ({
100102
title={intl.formatMessage(legacyMessages.createLibrary)}
101103
/>
102104
)}
105+
<Alert variant="warning" icon={Warning}>
106+
<Alert.Heading>{intl.formatMessage(legacyMessages.warningTitle)}</Alert.Heading>
107+
{intl.formatMessage(legacyMessages.warningBody, {
108+
libraryLink: (
109+
<Alert.Link
110+
as={Link}
111+
// @ts-ignore
112+
to="/libraries"
113+
>
114+
{intl.formatMessage(legacyMessages.warningLibraryFeature)}
115+
</Alert.Link>
116+
),
117+
})}
118+
</Alert>
103119
<Formik
104120
initialValues={{
105121
displayName: '',

src/library-authoring/create-legacy-library/messages.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,21 @@ const messages = defineMessages({
1111
defaultMessage: 'Legacy library name',
1212
description: 'Label for the title field when creating a legacy library.',
1313
},
14+
warningTitle: {
15+
id: 'course-authoring.library-authoring.create-legacy-library.warning.title',
16+
defaultMessage: 'You are creating content in a deprecated format',
17+
description: 'Warning to discourage users from creating a new Legacy Library',
18+
},
19+
warningBody: {
20+
id: 'course-authoring.library-authoring.create-legacy-library.warning.body',
21+
defaultMessage: 'Legacy libraries will be unsupported in Willow. Any content you create in a legacy library will soon need to be migrated. Consider using the {libraryLink} instead.',
22+
description: 'Warning to discourage users from creating a new Legacy Library',
23+
},
24+
warningLibraryFeature: {
25+
id: 'course-authoring.library-authoring.create-legacy-library.warning.library-feature',
26+
defaultMessage: 'Library feature',
27+
description: 'Link to the Libraries feature page',
28+
},
1429
createLibraryButton: {
1530
id: 'course-authoring.library-authoring.create-legacy-library.form.create-library.button',
1631
defaultMessage: 'Create legacy library',

0 commit comments

Comments
 (0)