Skip to content

Commit 980593d

Browse files
authored
Merge pull request #126 from pluginpal/feature/migrate-v5
feat: initial v5 migration
2 parents f8631f9 + 9c72975 commit 980593d

File tree

43 files changed

+8626
-580
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+8626
-580
lines changed

.eslintrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,13 @@
2626
"strapi": true
2727
},
2828
"rules": {
29+
"import/no-unresolved": [2, {
30+
"ignore": [
31+
"@strapi/strapi/admin",
32+
"@strapi/admin/strapi-admin"
33+
]
34+
}],
35+
2936
"template-curly-spacing" : "off",
3037

3138
"indent" : "off",

.github/workflows/tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88
branches:
99
- master
1010
- develop
11+
- beta
1112

1213
jobs:
1314
lint:

admin/src/components/ActionButtons/index.js renamed to admin/src/components/ActionButtons/index.jsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,16 @@ import { useDispatch, useSelector } from 'react-redux';
44
import { isEmpty } from 'lodash';
55
import { Button } from '@strapi/design-system';
66
import { Map } from 'immutable';
7-
import { useNotification } from '@strapi/helper-plugin';
7+
import { getFetchClient, useNotification } from '@strapi/strapi/admin';
88
import { useIntl } from 'react-intl';
99

1010
import ConfirmModal from '../ConfirmModal';
1111
import { exportAllConfig, importAllConfig } from '../../state/actions/Config';
1212

1313
const ActionButtons = () => {
14+
const { post, get } = getFetchClient();
1415
const dispatch = useDispatch();
15-
const toggleNotification = useNotification();
16+
const { toggleNotification } = useNotification();
1617
const [modalIsOpen, setModalIsOpen] = useState(false);
1718
const [actionType, setActionType] = useState('');
1819
const partialDiff = useSelector((state) => state.getIn(['config', 'partialDiff'], Map({}))).toJS();
@@ -43,7 +44,7 @@ const ActionButtons = () => {
4344
isOpen={modalIsOpen}
4445
onClose={closeModal}
4546
type={actionType}
46-
onSubmit={(force) => actionType === 'import' ? dispatch(importAllConfig(partialDiff, force, toggleNotification)) : dispatch(exportAllConfig(partialDiff, toggleNotification))}
47+
onSubmit={(force) => actionType === 'import' ? dispatch(importAllConfig(partialDiff, force, toggleNotification, formatMessage, post, get)) : dispatch(exportAllConfig(partialDiff, toggleNotification, formatMessage, post, get))}
4748
/>
4849
</ActionButtonsStyling>
4950
);

admin/src/components/FirstExport/index.js renamed to admin/src/components/FirstExport/index.jsx

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
import React, { useState } from 'react';
22
import { useIntl } from 'react-intl';
33
import { useDispatch } from 'react-redux';
4-
import { NoContent, useNotification } from '@strapi/helper-plugin';
5-
import { Button } from '@strapi/design-system';
4+
import { getFetchClient, useNotification } from '@strapi/strapi/admin';
5+
import { Button, EmptyStateLayout } from '@strapi/design-system';
6+
import { EmptyDocuments } from '@strapi/icons';
67

78
import { exportAllConfig } from '../../state/actions/Config';
89
import ConfirmModal from '../ConfirmModal';
910

1011
const FirstExport = () => {
11-
const toggleNotification = useNotification();
12+
const { post, get } = getFetchClient();
13+
const { toggleNotification } = useNotification();
1214
const dispatch = useDispatch();
1315
const [modalIsOpen, setModalIsOpen] = useState(false);
1416
const { formatMessage } = useIntl();
@@ -19,15 +21,12 @@ const FirstExport = () => {
1921
isOpen={modalIsOpen}
2022
onClose={() => setModalIsOpen(false)}
2123
type="export"
22-
onSubmit={() => dispatch(exportAllConfig([], toggleNotification))}
24+
onSubmit={() => dispatch(exportAllConfig([], toggleNotification, formatMessage, post, get))}
2325
/>
24-
<NoContent
25-
content={{
26-
id: 'emptyState',
27-
defaultMessage:
28-
formatMessage({ id: 'config-sync.FirstExport.Message' }),
29-
}}
26+
<EmptyStateLayout
27+
content={formatMessage({ id: 'config-sync.FirstExport.Message' })}
3028
action={<Button onClick={() => setModalIsOpen(true)}>{formatMessage({ id: 'config-sync.FirstExport.Button' })}</Button>}
29+
icon={<EmptyDocuments width={160} />}
3130
/>
3231
</div>
3332
);
File renamed without changes.

admin/src/components/NoChanges/index.js

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)