Skip to content

Commit 8cca773

Browse files
authored
Merge pull request #138 from pluginpal/beta
Beta
2 parents e445967 + 0a23932 commit 8cca773

43 files changed

Lines changed: 9193 additions & 1255 deletions

File tree

Some content is hidden

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

.eslintrc

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

3139
"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
);
Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,8 @@ import ReactDiffViewer, { DiffMethod } from 'react-diff-viewer-continued';
33
import { useIntl } from 'react-intl';
44

55
import {
6-
ModalLayout,
7-
ModalBody,
8-
ModalHeader,
6+
Modal,
97
Grid,
10-
GridItem,
118
Typography,
129
} from '@strapi/design-system';
1310

@@ -16,32 +13,32 @@ const ConfigDiff = ({ isOpen, onClose, oldValue, newValue, configName }) => {
1613
if (!isOpen) return null;
1714

1815
return (
19-
<ModalLayout
16+
<Modal.Root
2017
onClose={onClose}
2118
labelledBy="title"
2219
>
23-
<ModalHeader>
20+
<Modal.Header>
2421
<Typography variant="omega" fontWeight="bold" textColor="neutral800">
2522
{formatMessage({ id: 'config-sync.ConfigDiff.Title' })} {configName}
2623
</Typography>
27-
</ModalHeader>
28-
<ModalBody>
29-
<Grid paddingBottom={4} style={{ textAlign: 'center' }}>
30-
<GridItem col={6}>
24+
</Modal.Header>
25+
<Modal.Body>
26+
<Grid.Root paddingBottom={4} style={{ textAlign: 'center' }}>
27+
<Grid.Item col={6}>
3128
<Typography variant="delta">{formatMessage({ id: 'config-sync.ConfigDiff.SyncDirectory' })}</Typography>
32-
</GridItem>
33-
<GridItem col={6}>
29+
</Grid.Item>
30+
<Grid.Item col={6}>
3431
<Typography variant="delta">{formatMessage({ id: 'config-sync.ConfigDiff.Database' })}</Typography>
35-
</GridItem>
36-
</Grid>
32+
</Grid.Item>
33+
</Grid.Root>
3734
<ReactDiffViewer
3835
oldValue={JSON.stringify(oldValue, null, 2)}
3936
newValue={JSON.stringify(newValue, null, 2)}
4037
splitView
4138
compareMethod={DiffMethod.WORDS}
4239
/>
43-
</ModalBody>
44-
</ModalLayout>
40+
</Modal.Body>
41+
</Modal.Root>
4542
);
4643
};
4744

admin/src/components/ConfigList/ConfigListRow/index.js renamed to admin/src/components/ConfigList/ConfigListRow/index.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import { Tr, Td, BaseCheckbox } from '@strapi/design-system';
2+
import { Tr, Td, Checkbox } from '@strapi/design-system';
33

44
const CustomRow = ({ row, checked, updateValue }) => {
55
const { configName, configType, state, onClick } = row;
@@ -42,7 +42,7 @@ const CustomRow = ({ row, checked, updateValue }) => {
4242
style={{ cursor: 'pointer' }}
4343
>
4444
<Td>
45-
<BaseCheckbox
45+
<Checkbox
4646
aria-label={`Select ${configName}`}
4747
value={checked}
4848
onValueChange={updateValue}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
Tr,
1111
Th,
1212
Typography,
13-
BaseCheckbox,
13+
Checkbox,
1414
Loader,
1515
} from '@strapi/design-system';
1616

@@ -128,7 +128,7 @@ const ConfigList = ({ diff, isLoading }) => {
128128
<Thead>
129129
<Tr>
130130
<Th>
131-
<BaseCheckbox
131+
<Checkbox
132132
aria-label={formatMessage({ id: 'config-sync.ConfigList.SelectAll' })}
133133
indeterminate={isIndeterminate}
134134
onValueChange={(value) => setCheckedItems(checkedItems.map(() => value))}

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

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,14 @@ import { useSelector } from 'react-redux';
44

55
import {
66
Dialog,
7-
DialogBody,
8-
DialogFooter,
97
Flex,
108
Typography,
11-
Stack,
129
Button,
1310
Checkbox,
1411
Divider,
1512
Box,
1613
} from '@strapi/design-system';
17-
import { ExclamationMarkCircle } from '@strapi/icons';
14+
import { WarningCircle } from '@strapi/icons';
1815

1916
const ConfirmModal = ({ isOpen, onClose, onSubmit, type }) => {
2017
const soft = useSelector((state) => state.getIn(['config', 'appEnv', 'config', 'soft'], false));
@@ -24,21 +21,21 @@ const ConfirmModal = ({ isOpen, onClose, onSubmit, type }) => {
2421
if (!isOpen) return null;
2522

2623
return (
27-
<Dialog
24+
<Dialog.Root
2825
onClose={onClose}
2926
title={formatMessage({ id: "config-sync.popUpWarning.Confirmation" })}
3027
isOpen={isOpen}
3128
>
32-
<DialogBody icon={<ExclamationMarkCircle />}>
33-
<Stack size={2}>
29+
<Dialog.Body icon={<WarningCircle />}>
30+
<Flex size={2}>
3431
<Flex justifyContent="center">
3532
<Typography variant="omega" id="confirm-description" style={{ textAlign: 'center' }}>
3633
{formatMessage({ id: `config-sync.popUpWarning.warning.${type}_1` })}<br />
3734
{formatMessage({ id: `config-sync.popUpWarning.warning.${type}_2` })}
3835
</Typography>
3936
</Flex>
40-
</Stack>
41-
</DialogBody>
37+
</Flex>
38+
</Dialog.Body>
4239
{(soft && type === 'import') && (
4340
<React.Fragment>
4441
<Divider />
@@ -54,7 +51,7 @@ const ConfirmModal = ({ isOpen, onClose, onSubmit, type }) => {
5451
</Box>
5552
</React.Fragment>
5653
)}
57-
<DialogFooter
54+
<Dialog.Footer
5855
startAction={(
5956
<Button
6057
onClick={() => {
@@ -76,7 +73,7 @@ const ConfirmModal = ({ isOpen, onClose, onSubmit, type }) => {
7673
{formatMessage({ id: `config-sync.popUpWarning.button.${type}` })}
7774
</Button>
7875
)} />
79-
</Dialog>
76+
</Dialog.Root>
8077
);
8178
};
8279

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
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/symbols';
7+
68

79
import { exportAllConfig } from '../../state/actions/Config';
810
import ConfirmModal from '../ConfirmModal';
911

1012
const FirstExport = () => {
11-
const toggleNotification = useNotification();
13+
const { post, get } = getFetchClient();
14+
const { toggleNotification } = useNotification();
1215
const dispatch = useDispatch();
1316
const [modalIsOpen, setModalIsOpen] = useState(false);
1417
const { formatMessage } = useIntl();
@@ -19,15 +22,12 @@ const FirstExport = () => {
1922
isOpen={modalIsOpen}
2023
onClose={() => setModalIsOpen(false)}
2124
type="export"
22-
onSubmit={() => dispatch(exportAllConfig([], toggleNotification))}
25+
onSubmit={() => dispatch(exportAllConfig([], toggleNotification, formatMessage, post, get))}
2326
/>
24-
<NoContent
25-
content={{
26-
id: 'emptyState',
27-
defaultMessage:
28-
formatMessage({ id: 'config-sync.FirstExport.Message' }),
29-
}}
27+
<EmptyStateLayout
28+
content={formatMessage({ id: 'config-sync.FirstExport.Message' })}
3029
action={<Button onClick={() => setModalIsOpen(true)}>{formatMessage({ id: 'config-sync.FirstExport.Button' })}</Button>}
30+
icon={<EmptyDocuments width={160} />}
3131
/>
3232
</div>
3333
);
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@
77
import React, { memo } from 'react';
88
import { useIntl } from 'react-intl';
99

10-
import { HeaderLayout, Box } from '@strapi/design-system';
10+
import { Layouts } from '@strapi/admin/strapi-admin';
11+
import { Box } from '@strapi/design-system';
1112

1213
const HeaderComponent = () => {
1314
const { formatMessage } = useIntl();
1415

1516
return (
1617
<Box background="neutral100">
17-
<HeaderLayout
18+
<Layouts.Header
1819
title={formatMessage({ id: 'config-sync.Header.Title' })}
1920
subtitle={formatMessage({ id: 'config-sync.Header.Description' })}
2021
as="h2"

admin/src/components/NoChanges/index.js

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

0 commit comments

Comments
 (0)