@strapi/admin 4.5.0-alpha.0 → 4.5.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/admin/src/StrapiApp.js +4 -12
- package/admin/src/components/Providers/index.js +14 -10
- package/admin/src/content-manager/components/CollectionTypeFormWrapper/index.js +24 -0
- package/admin/src/content-manager/components/DynamicTable/TableRows/index.js +20 -15
- package/admin/src/content-manager/components/DynamicZone/components/Component/index.js +19 -9
- package/admin/src/content-manager/components/EditViewDataManagerProvider/index.js +50 -3
- package/admin/src/content-manager/components/EditViewDataManagerProvider/reducer.js +50 -9
- package/admin/src/content-manager/components/FieldTypeIcon/index.js +31 -1
- package/admin/src/content-manager/components/Inputs/index.js +36 -14
- package/admin/src/content-manager/components/NonRepeatableComponent/index.js +2 -0
- package/admin/src/content-manager/components/RelationInput/RelationInput.js +95 -32
- package/admin/src/content-manager/components/RelationInput/components/RelationItem.js +2 -2
- package/admin/src/content-manager/components/RelationInput/constants.js +1 -1
- package/admin/src/content-manager/components/RelationInputDataManager/RelationInputDataManager.js +33 -22
- package/admin/src/content-manager/components/RelationInputDataManager/utils/index.js +1 -0
- package/admin/src/content-manager/components/RelationInputDataManager/utils/normalizeRelations.js +10 -3
- package/admin/src/content-manager/components/RelationInputDataManager/utils/normalizeSearchResults.js +12 -0
- package/admin/src/content-manager/components/RelationInputDataManager/utils/select.js +34 -11
- package/admin/src/content-manager/components/RepeatableComponent/DraggedItem/index.js +5 -0
- package/admin/src/content-manager/components/SingleTypeFormWrapper/index.js +23 -0
- package/admin/src/content-manager/hooks/useRelation/useRelation.js +17 -9
- package/admin/src/content-manager/pages/EditSettingsView/components/FormModal.js +7 -2
- package/admin/src/content-manager/pages/EditSettingsView/index.js +2 -1
- package/admin/src/content-manager/pages/EditView/Header/index.js +118 -50
- package/admin/src/content-manager/pages/EditView/Header/utils/select.js +4 -0
- package/admin/src/content-manager/pages/EditView/index.js +102 -93
- package/admin/src/content-manager/pages/ListView/index.js +24 -15
- package/admin/src/content-manager/pages/ListView/utils/buildQueryString.js +14 -2
- package/admin/src/contexts/ApiTokenPermissions/index.js +24 -0
- package/admin/src/core/apis/CustomFields.js +80 -0
- package/admin/src/core/apis/index.js +1 -0
- package/admin/src/hooks/index.js +1 -0
- package/admin/src/hooks/useRegenerate/index.js +34 -0
- package/admin/src/pages/HomePage/SocialLinks.js +1 -1
- package/admin/src/pages/SettingsPage/pages/ApiTokens/EditView/components/ActionBoundRoutes/index.js +56 -0
- package/admin/src/pages/SettingsPage/pages/ApiTokens/EditView/components/BoundRoute/getMethodColor.js +41 -0
- package/admin/src/pages/SettingsPage/pages/ApiTokens/EditView/components/BoundRoute/index.js +72 -0
- package/admin/src/pages/SettingsPage/pages/ApiTokens/EditView/components/CollapsableContentType/CheckBoxWrapper.js +30 -0
- package/admin/src/pages/SettingsPage/pages/ApiTokens/EditView/components/CollapsableContentType/index.js +150 -0
- package/admin/src/pages/SettingsPage/pages/ApiTokens/EditView/components/ContenTypesSection/index.js +37 -0
- package/admin/src/pages/SettingsPage/pages/ApiTokens/EditView/components/FormApiTokenContainer/index.js +254 -0
- package/admin/src/pages/SettingsPage/pages/ApiTokens/EditView/components/FormBody/index.js +77 -0
- package/admin/src/pages/SettingsPage/pages/ApiTokens/EditView/components/FormHead/index.js +85 -0
- package/admin/src/pages/SettingsPage/pages/ApiTokens/EditView/components/Permissions/index.js +40 -0
- package/admin/src/pages/SettingsPage/pages/ApiTokens/EditView/components/Regenerate/index.js +68 -0
- package/admin/src/pages/SettingsPage/pages/ApiTokens/EditView/index.js +215 -197
- package/admin/src/pages/SettingsPage/pages/ApiTokens/EditView/init.js +13 -0
- package/admin/src/pages/SettingsPage/pages/ApiTokens/EditView/reducer.js +72 -0
- package/admin/src/pages/SettingsPage/pages/ApiTokens/EditView/utils/getDateOfExpiration.js +16 -0
- package/admin/src/pages/SettingsPage/pages/ApiTokens/EditView/utils/index.js +5 -0
- package/admin/src/pages/SettingsPage/pages/ApiTokens/EditView/utils/schema.js +2 -1
- package/admin/src/pages/SettingsPage/pages/ApiTokens/EditView/utils/transformPermissionsData.js +36 -0
- package/admin/src/pages/SettingsPage/pages/ApiTokens/ListView/DynamicTable/DefaultButton/index.js +63 -0
- package/admin/src/pages/SettingsPage/pages/ApiTokens/ListView/DynamicTable/DeleteButton/index.js +1 -0
- package/admin/src/pages/SettingsPage/pages/ApiTokens/ListView/DynamicTable/ReadButton/index.js +19 -0
- package/admin/src/pages/SettingsPage/pages/ApiTokens/ListView/DynamicTable/UpdateButton/index.js +3 -36
- package/admin/src/pages/SettingsPage/pages/ApiTokens/ListView/DynamicTable/index.js +13 -11
- package/admin/src/pages/SettingsPage/pages/ApiTokens/ListView/index.js +3 -2
- package/admin/src/pages/SettingsPage/pages/ApiTokens/ListView/utils/tableHeaders.js +8 -8
- package/admin/src/pages/SettingsPage/pages/ApiTokens/ProtectedEditView/index.js +1 -1
- package/admin/src/pages/SettingsPage/pages/Users/ListPage/ModalForm/index.js +2 -2
- package/admin/src/permissions/defaultPermissions.js +2 -6
- package/admin/src/translations/ca.json +3 -1
- package/admin/src/translations/de.json +4 -1
- package/admin/src/translations/dk.json +3 -0
- package/admin/src/translations/en.json +22 -1
- package/admin/src/translations/es.json +156 -157
- package/admin/src/translations/fr.json +3 -0
- package/admin/src/translations/gu.json +608 -606
- package/admin/src/translations/hi.json +689 -687
- package/admin/src/translations/hu.json +2 -0
- package/admin/src/translations/id.json +2 -0
- package/admin/src/translations/it.json +2 -0
- package/admin/src/translations/ja.json +2 -0
- package/admin/src/translations/ko.json +2 -0
- package/admin/src/translations/ml.json +689 -687
- package/admin/src/translations/nl.json +3 -0
- package/admin/src/translations/pl.json +2 -0
- package/admin/src/translations/pt-BR.json +3 -0
- package/admin/src/translations/ru.json +489 -491
- package/admin/src/translations/sa.json +85 -82
- package/admin/src/translations/sk.json +3 -0
- package/admin/src/translations/sv.json +3 -0
- package/admin/src/translations/zh-Hans.json +4 -1
- package/admin/src/translations/zh.json +3 -0
- package/build/1856.d8f13391.chunk.js +173 -0
- package/build/{9311.7cc03f29.chunk.js → 1939.e3c87653.chunk.js} +108 -291
- package/build/{2077.c935ee42.chunk.js → 2077.31a2d91e.chunk.js} +4 -4
- package/build/{2912.a015078a.chunk.js → 2912.ab68a736.chunk.js} +8 -8
- package/build/4318.7d167b58.chunk.js +30 -0
- package/build/4715.44b1ef9b.chunk.js +386 -0
- package/build/{4982.05eda880.chunk.js → 4982.c2a311b7.chunk.js} +9 -9
- package/build/7379.d246dd38.chunk.js +1 -0
- package/build/{7841.91f793dc.chunk.js → 7841.4b67af3f.chunk.js} +8 -8
- package/build/{7866.1201afbd.chunk.js → 7866.5fbeb7e5.chunk.js} +10 -10
- package/build/{8380.8789ff76.chunk.js → 8380.9b53a31d.chunk.js} +7 -7
- package/build/{8549.133c4473.chunk.js → 8549.cf10b5d1.chunk.js} +4 -4
- package/build/8738.a30a2160.chunk.js +461 -0
- package/build/{9066.08049eb1.chunk.js → 9066.26faf397.chunk.js} +4 -4
- package/build/{9166.037339e0.chunk.js → 9166.8fcb3019.chunk.js} +5 -5
- package/build/{9420.43a86e7c.chunk.js → 9420.0fe11290.chunk.js} +6 -6
- package/build/962.8651ba3f.chunk.js +184 -0
- package/build/Admin-authenticatedApp.883449a5.chunk.js +80 -0
- package/build/{Admin_homePage.118926e0.chunk.js → Admin_homePage.4b2be829.chunk.js} +2 -2
- package/build/{Admin_profilePage.9d50ac44.chunk.js → Admin_profilePage.da32abbc.chunk.js} +1 -1
- package/build/{Admin_settingsPage.98a711e5.chunk.js → Admin_settingsPage.98e2a62b.chunk.js} +16 -16
- package/build/admin-app.a61d5c2e.chunk.js +112 -0
- package/build/admin-edit-roles-page.4dd6bcb9.chunk.js +1 -0
- package/build/{admin-users.97a08630.chunk.js → admin-users.d71f198a.chunk.js} +3 -3
- package/build/api-tokens-create-page.93dd0689.chunk.js +1 -0
- package/build/api-tokens-edit-page.b0adac81.chunk.js +1 -0
- package/build/api-tokens-list-page.bb36535f.chunk.js +16 -0
- package/build/{ca-json.a16899ae.chunk.js → ca-json.82df6eab.chunk.js} +1 -1
- package/build/content-manager.933dc286.chunk.js +1201 -0
- package/build/content-type-builder-list-view.5b3cd768.chunk.js +194 -0
- package/build/content-type-builder-translation-en-json.f985c9c4.chunk.js +1 -0
- package/build/content-type-builder.a6e29716.chunk.js +145 -0
- package/build/{de-json.aa6026b3.chunk.js → de-json.0ad554eb.chunk.js} +1 -1
- package/build/{dk-json.fac2bcfb.chunk.js → dk-json.e195ea1a.chunk.js} +1 -1
- package/build/{email-settings-page.64037147.chunk.js → email-settings-page.bfe6227f.chunk.js} +4 -4
- package/build/en-json.1889403c.chunk.js +1 -0
- package/build/{es-json.d672e181.chunk.js → es-json.09f80f6e.chunk.js} +1 -1
- package/build/{fr-json.71a16175.chunk.js → fr-json.606d056b.chunk.js} +1 -1
- package/build/{gu-json.ca345cd1.chunk.js → gu-json.9881264f.chunk.js} +1 -1
- package/build/{hi-json.50c7e6d4.chunk.js → hi-json.83dcf48f.chunk.js} +1 -1
- package/build/{hu-json.e0521dcc.chunk.js → hu-json.6f328bce.chunk.js} +1 -1
- package/build/{i18n-settings-page.0b73785d.chunk.js → i18n-settings-page.18166125.chunk.js} +4 -4
- package/build/{id-json.4b1ff8d6.chunk.js → id-json.1f3c4303.chunk.js} +1 -1
- package/build/index.html +1 -1
- package/build/{it-json.86bac220.chunk.js → it-json.494ac432.chunk.js} +1 -1
- package/build/{ja-json.4e44e36b.chunk.js → ja-json.6f262117.chunk.js} +1 -1
- package/build/{ko-json.1003756e.chunk.js → ko-json.36dc3b9a.chunk.js} +1 -1
- package/build/main.63e7ea0a.js +9338 -0
- package/build/{ml-json.c7774425.chunk.js → ml-json.9566bf9a.chunk.js} +1 -1
- package/build/{nl-json.f58ea235.chunk.js → nl-json.94c3a289.chunk.js} +1 -1
- package/build/{pl-json.fed96aba.chunk.js → pl-json.ccc6ef23.chunk.js} +1 -1
- package/build/{pt-BR-json.073799ab.chunk.js → pt-BR-json.744f024d.chunk.js} +1 -1
- package/build/{ru-json.7ad2cbbf.chunk.js → ru-json.d22ea13c.chunk.js} +1 -1
- package/build/{runtime~main.feeac6d3.js → runtime~main.3a5e1b07.js} +1 -1
- package/build/{sa-json.f0f704f0.chunk.js → sa-json.8fb1c04d.chunk.js} +1 -1
- package/build/{sk-json.a848961b.chunk.js → sk-json.6c7335d4.chunk.js} +1 -1
- package/build/sso-settings-page.9ceb0140.chunk.js +1 -0
- package/build/{sv-json.b038acbe.chunk.js → sv-json.2e589a7d.chunk.js} +1 -1
- package/build/{upload-settings.80ff0974.chunk.js → upload-settings.3d613216.chunk.js} +4 -4
- package/build/{upload-translation-en-json.004a86c1.chunk.js → upload-translation-en-json.86da7b0a.chunk.js} +1 -1
- package/build/{users-advanced-settings-page.a02f4806.chunk.js → users-advanced-settings-page.f4051d92.chunk.js} +4 -4
- package/build/{webhook-edit-page.d2ea3351.chunk.js → webhook-edit-page.9e46fc3f.chunk.js} +1 -1
- package/build/{webhook-list-page.2775a683.chunk.js → webhook-list-page.a712ae40.chunk.js} +4 -4
- package/build/{zh-Hans-json.03d2bda1.chunk.js → zh-Hans-json.a4d7dc69.chunk.js} +1 -1
- package/build/{zh-json.3d0cc664.chunk.js → zh-json.66aa2ae1.chunk.js} +1 -1
- package/ee/server/controllers/user.js +5 -3
- package/package.json +9 -8
- package/server/bootstrap.js +19 -1
- package/server/config/admin-actions.js +20 -0
- package/server/content-types/api-token-permission.js +36 -0
- package/server/content-types/api-token.js +25 -1
- package/server/content-types/index.js +1 -0
- package/server/controllers/admin.js +3 -0
- package/server/controllers/api-token.js +24 -1
- package/server/controllers/content-api.js +15 -0
- package/server/controllers/index.js +1 -0
- package/server/controllers/user.js +3 -2
- package/server/routes/api-tokens.js +11 -0
- package/server/routes/content-api.js +20 -0
- package/server/routes/index.js +2 -0
- package/server/services/api-token.js +309 -29
- package/server/services/constants.js +10 -0
- package/server/services/permission/engine.js +36 -226
- package/server/services/permission.js +4 -1
- package/server/strategies/admin.js +7 -1
- package/server/strategies/api-token.js +72 -11
- package/server/validation/api-tokens.js +12 -2
- package/utils/get-custom-app-config-file.js +5 -0
- package/build/1856.47226450.chunk.js +0 -173
- package/build/4715.58cd558f.chunk.js +0 -387
- package/build/7098.40dcd7bf.chunk.js +0 -1
- package/build/8851.e4ac62f2.chunk.js +0 -158
- package/build/Admin-authenticatedApp.e39f36c9.chunk.js +0 -80
- package/build/admin-app.4f7618a9.chunk.js +0 -112
- package/build/admin-edit-roles-page.554ba3fa.chunk.js +0 -1
- package/build/api-tokens-create-page.4c262d6e.chunk.js +0 -1
- package/build/api-tokens-edit-page.10a9d368.chunk.js +0 -1
- package/build/api-tokens-list-page.442c9f3c.chunk.js +0 -15
- package/build/content-manager.7d57c9d1.chunk.js +0 -1200
- package/build/content-type-builder-list-view.8cc534e0.chunk.js +0 -194
- package/build/content-type-builder-translation-en-json.201bfb78.chunk.js +0 -1
- package/build/content-type-builder.684df7a4.chunk.js +0 -142
- package/build/en-json.0c69c7d7.chunk.js +0 -1
- package/build/main.b47db1a3.js +0 -9337
- package/build/sso-settings-page.445184e0.chunk.js +0 -1
- package/server/services/permission/engine-hooks.js +0 -82
package/admin/src/pages/SettingsPage/pages/ApiTokens/ListView/DynamicTable/DefaultButton/index.js
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useIntl } from 'react-intl';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
import { Link } from '@strapi/helper-plugin';
|
|
5
|
+
import { useHistory } from 'react-router-dom';
|
|
6
|
+
import styled from 'styled-components';
|
|
7
|
+
|
|
8
|
+
const MESSAGES_MAP = {
|
|
9
|
+
edit: {
|
|
10
|
+
id: 'app.component.table.edit',
|
|
11
|
+
defaultMessage: 'Edit {target}',
|
|
12
|
+
},
|
|
13
|
+
read: {
|
|
14
|
+
id: 'app.component.table.read',
|
|
15
|
+
defaultMessage: 'Read {target}',
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const LinkStyled = styled(Link)`
|
|
20
|
+
svg {
|
|
21
|
+
path {
|
|
22
|
+
fill: ${({ theme }) => theme.colors.neutral500};
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&:hover,
|
|
27
|
+
&:focus {
|
|
28
|
+
svg {
|
|
29
|
+
path {
|
|
30
|
+
fill: ${({ theme }) => theme.colors.neutral800};
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
`;
|
|
35
|
+
|
|
36
|
+
const DefaultButton = ({ tokenName, tokenId, buttonType, children }) => {
|
|
37
|
+
const { formatMessage } = useIntl();
|
|
38
|
+
const {
|
|
39
|
+
location: { pathname },
|
|
40
|
+
} = useHistory();
|
|
41
|
+
|
|
42
|
+
return (
|
|
43
|
+
<LinkStyled
|
|
44
|
+
to={`${pathname}/${tokenId}`}
|
|
45
|
+
title={formatMessage(MESSAGES_MAP[buttonType], { target: tokenName })}
|
|
46
|
+
>
|
|
47
|
+
{children}
|
|
48
|
+
</LinkStyled>
|
|
49
|
+
);
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
DefaultButton.propTypes = {
|
|
53
|
+
tokenName: PropTypes.string.isRequired,
|
|
54
|
+
tokenId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
|
|
55
|
+
buttonType: PropTypes.string,
|
|
56
|
+
children: PropTypes.node.isRequired,
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
DefaultButton.defaultProps = {
|
|
60
|
+
buttonType: 'edit',
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
export default DefaultButton;
|
package/admin/src/pages/SettingsPage/pages/ApiTokens/ListView/DynamicTable/ReadButton/index.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Eye from '@strapi/icons/Eye';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
import DefaultButton from '../DefaultButton';
|
|
5
|
+
|
|
6
|
+
const ReadButton = ({ tokenName, tokenId }) => {
|
|
7
|
+
return (
|
|
8
|
+
<DefaultButton tokenName={tokenName} tokenId={tokenId} buttonType="read">
|
|
9
|
+
<Eye />
|
|
10
|
+
</DefaultButton>
|
|
11
|
+
);
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
ReadButton.propTypes = {
|
|
15
|
+
tokenName: PropTypes.string.isRequired,
|
|
16
|
+
tokenId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export default ReadButton;
|
package/admin/src/pages/SettingsPage/pages/ApiTokens/ListView/DynamicTable/UpdateButton/index.js
CHANGED
|
@@ -1,46 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import Pencil from '@strapi/icons/Pencil';
|
|
3
|
-
import { useIntl } from 'react-intl';
|
|
4
3
|
import PropTypes from 'prop-types';
|
|
5
|
-
import
|
|
6
|
-
import { useHistory } from 'react-router-dom';
|
|
7
|
-
import styled from 'styled-components';
|
|
8
|
-
|
|
9
|
-
const LinkUpdate = styled(Link)`
|
|
10
|
-
svg {
|
|
11
|
-
path {
|
|
12
|
-
fill: ${({ theme }) => theme.colors.neutral500};
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
&:hover {
|
|
17
|
-
svg {
|
|
18
|
-
path {
|
|
19
|
-
fill: ${({ theme }) => theme.colors.neutral800};
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
`;
|
|
4
|
+
import DefaultButton from '../DefaultButton';
|
|
24
5
|
|
|
25
6
|
const UpdateButton = ({ tokenName, tokenId }) => {
|
|
26
|
-
const { formatMessage } = useIntl();
|
|
27
|
-
const {
|
|
28
|
-
location: { pathname },
|
|
29
|
-
} = useHistory();
|
|
30
|
-
|
|
31
7
|
return (
|
|
32
|
-
<
|
|
33
|
-
to={`${pathname}/${tokenId}`}
|
|
34
|
-
title={formatMessage(
|
|
35
|
-
{
|
|
36
|
-
id: 'app.component.table.edit',
|
|
37
|
-
defaultMessage: 'Edit {target}',
|
|
38
|
-
},
|
|
39
|
-
{ target: `${tokenName}` }
|
|
40
|
-
)}
|
|
41
|
-
>
|
|
8
|
+
<DefaultButton tokenName={tokenName} tokenId={tokenId}>
|
|
42
9
|
<Pencil />
|
|
43
|
-
</
|
|
10
|
+
</DefaultButton>
|
|
44
11
|
);
|
|
45
12
|
};
|
|
46
13
|
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { useIntl } from 'react-intl';
|
|
3
2
|
import PropTypes from 'prop-types';
|
|
4
3
|
import { useHistory } from 'react-router-dom';
|
|
5
4
|
|
|
@@ -13,12 +12,11 @@ import {
|
|
|
13
12
|
pxToRem,
|
|
14
13
|
useTracking,
|
|
15
14
|
} from '@strapi/helper-plugin';
|
|
16
|
-
|
|
17
15
|
import DeleteButton from './DeleteButton';
|
|
18
16
|
import UpdateButton from './UpdateButton';
|
|
17
|
+
import ReadButton from './ReadButton';
|
|
19
18
|
|
|
20
|
-
const TableRows = ({ canDelete, canUpdate, onClickDelete, withBulkActions, rows }) => {
|
|
21
|
-
const { formatMessage } = useIntl();
|
|
19
|
+
const TableRows = ({ canDelete, canUpdate, canRead, onClickDelete, withBulkActions, rows }) => {
|
|
22
20
|
const [{ query }] = useQueryParams();
|
|
23
21
|
const [, sortOrder] = query.sort.split(':');
|
|
24
22
|
const {
|
|
@@ -59,22 +57,24 @@ const TableRows = ({ canDelete, canUpdate, onClickDelete, withBulkActions, rows
|
|
|
59
57
|
</Td>
|
|
60
58
|
<Td>
|
|
61
59
|
<Typography textColor="neutral800">
|
|
62
|
-
{
|
|
63
|
-
id: `Settings.apiTokens.types.${apiToken.type}`,
|
|
64
|
-
defaultMessage: 'Type unknown',
|
|
65
|
-
})}
|
|
60
|
+
<RelativeTime timestamp={new Date(apiToken.createdAt)} />
|
|
66
61
|
</Typography>
|
|
67
62
|
</Td>
|
|
68
63
|
<Td>
|
|
69
|
-
|
|
70
|
-
<
|
|
71
|
-
|
|
64
|
+
{apiToken.lastUsedAt && (
|
|
65
|
+
<Typography textColor="neutral800">
|
|
66
|
+
<RelativeTime timestamp={new Date(apiToken.lastUsedAt)} />
|
|
67
|
+
</Typography>
|
|
68
|
+
)}
|
|
72
69
|
</Td>
|
|
73
70
|
|
|
74
71
|
{withBulkActions && (
|
|
75
72
|
<Td>
|
|
76
73
|
<Flex justifyContent="end">
|
|
77
74
|
{canUpdate && <UpdateButton tokenName={apiToken.name} tokenId={apiToken.id} />}
|
|
75
|
+
{!canUpdate && canRead && (
|
|
76
|
+
<ReadButton tokenName={apiToken.name} tokenId={apiToken.id} />
|
|
77
|
+
)}
|
|
78
78
|
{canDelete && (
|
|
79
79
|
<DeleteButton
|
|
80
80
|
tokenName={apiToken.name}
|
|
@@ -94,6 +94,7 @@ const TableRows = ({ canDelete, canUpdate, onClickDelete, withBulkActions, rows
|
|
|
94
94
|
TableRows.defaultProps = {
|
|
95
95
|
canDelete: false,
|
|
96
96
|
canUpdate: false,
|
|
97
|
+
canRead: false,
|
|
97
98
|
onClickDelete() {},
|
|
98
99
|
rows: [],
|
|
99
100
|
withBulkActions: false,
|
|
@@ -102,6 +103,7 @@ TableRows.defaultProps = {
|
|
|
102
103
|
TableRows.propTypes = {
|
|
103
104
|
canDelete: PropTypes.bool,
|
|
104
105
|
canUpdate: PropTypes.bool,
|
|
106
|
+
canRead: PropTypes.bool,
|
|
105
107
|
onClickDelete: PropTypes.func,
|
|
106
108
|
rows: PropTypes.array,
|
|
107
109
|
withBulkActions: PropTypes.bool,
|
|
@@ -147,15 +147,16 @@ const ApiTokenListView = () => {
|
|
|
147
147
|
headers={headers}
|
|
148
148
|
contentType="api-tokens"
|
|
149
149
|
rows={apiTokens}
|
|
150
|
-
withBulkActions={canDelete || canUpdate}
|
|
150
|
+
withBulkActions={canDelete || canUpdate || canRead}
|
|
151
151
|
isLoading={isLoading}
|
|
152
152
|
onConfirmDelete={(id) => deleteMutation.mutateAsync(id)}
|
|
153
153
|
>
|
|
154
154
|
<TableRows
|
|
155
|
+
canRead={canRead}
|
|
155
156
|
canDelete={canDelete}
|
|
156
157
|
canUpdate={canUpdate}
|
|
157
158
|
rows={apiTokens}
|
|
158
|
-
withBulkActions={canDelete || canUpdate}
|
|
159
|
+
withBulkActions={canDelete || canUpdate || canRead}
|
|
159
160
|
/>
|
|
160
161
|
</DynamicTable>
|
|
161
162
|
)}
|
|
@@ -22,23 +22,23 @@ const tableHeaders = [
|
|
|
22
22
|
},
|
|
23
23
|
},
|
|
24
24
|
{
|
|
25
|
-
name: '
|
|
26
|
-
key: '
|
|
25
|
+
name: 'createdAt',
|
|
26
|
+
key: 'createdAt',
|
|
27
27
|
metadatas: {
|
|
28
28
|
label: {
|
|
29
|
-
id: 'Settings.apiTokens.ListView.headers.
|
|
30
|
-
defaultMessage: '
|
|
29
|
+
id: 'Settings.apiTokens.ListView.headers.createdAt',
|
|
30
|
+
defaultMessage: 'Created at',
|
|
31
31
|
},
|
|
32
32
|
sortable: false,
|
|
33
33
|
},
|
|
34
34
|
},
|
|
35
35
|
{
|
|
36
|
-
name: '
|
|
37
|
-
key: '
|
|
36
|
+
name: 'lastUsedAt',
|
|
37
|
+
key: 'lastUsedAt',
|
|
38
38
|
metadatas: {
|
|
39
39
|
label: {
|
|
40
|
-
id: 'Settings.apiTokens.ListView.headers.
|
|
41
|
-
defaultMessage: '
|
|
40
|
+
id: 'Settings.apiTokens.ListView.headers.lastUsedAt',
|
|
41
|
+
defaultMessage: 'Last used',
|
|
42
42
|
},
|
|
43
43
|
sortable: false,
|
|
44
44
|
},
|
|
@@ -5,7 +5,7 @@ import EditView from '../EditView';
|
|
|
5
5
|
|
|
6
6
|
const ProtectedApiTokenCreateView = () => {
|
|
7
7
|
return (
|
|
8
|
-
<CheckPagePermissions permissions={adminPermissions.settings['api-tokens'].
|
|
8
|
+
<CheckPagePermissions permissions={adminPermissions.settings['api-tokens'].read}>
|
|
9
9
|
<EditView />
|
|
10
10
|
</CheckPagePermissions>
|
|
11
11
|
);
|
|
@@ -69,8 +69,8 @@ const ModalForm = ({ queryName, onToggle }) => {
|
|
|
69
69
|
} catch (err) {
|
|
70
70
|
unlockApp();
|
|
71
71
|
|
|
72
|
-
if (err?.response?.data.message === 'Email already taken') {
|
|
73
|
-
setErrors({ email: err.response.data.message });
|
|
72
|
+
if (err?.response?.data?.error.message === 'Email already taken') {
|
|
73
|
+
setErrors({ email: err.response.data.error.message });
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
76
|
};
|
|
@@ -76,16 +76,12 @@ const permissions = {
|
|
|
76
76
|
update: [{ action: 'admin::webhooks.update', subject: null }],
|
|
77
77
|
},
|
|
78
78
|
'api-tokens': {
|
|
79
|
-
main: [
|
|
80
|
-
{ action: 'admin::api-tokens.create', subject: null },
|
|
81
|
-
{ action: 'admin::api-tokens.read', subject: null },
|
|
82
|
-
{ action: 'admin::api-tokens.update', subject: null },
|
|
83
|
-
{ action: 'admin::api-tokens.delete', subject: null },
|
|
84
|
-
],
|
|
79
|
+
main: [{ action: 'admin::api-tokens.access', subject: null }],
|
|
85
80
|
create: [{ action: 'admin::api-tokens.create', subject: null }],
|
|
86
81
|
delete: [{ action: 'admin::api-tokens.delete', subject: null }],
|
|
87
82
|
read: [{ action: 'admin::api-tokens.read', subject: null }],
|
|
88
83
|
update: [{ action: 'admin::api-tokens.update', subject: null }],
|
|
84
|
+
regenerate: [{ action: 'admin::api-tokens.regenerate', subject: null }],
|
|
89
85
|
},
|
|
90
86
|
},
|
|
91
87
|
};
|
|
@@ -633,6 +633,8 @@
|
|
|
633
633
|
"content-manager.plugin.description.short": "Veure, editar i eliminar informació de la base de dades de manera ràpida.",
|
|
634
634
|
"content-manager.popUpWarning.bodyMessage.contentType.delete": "Esteu segur de voler eliminar aquest registre?",
|
|
635
635
|
"content-manager.popUpWarning.bodyMessage.contentType.delete.all": "Esteu segur de voler eliminar aquests registres?",
|
|
636
|
+
"content-manager.popUpWarning.warning.publish-question": "Encara vols publicar-ho?",
|
|
637
|
+
"content-manager.popUpwarning.warning.has-draft-relations.button-confirm": "Sí, publicar",
|
|
636
638
|
"content-manager.popover.display-relations.label": "Mostrar relacions",
|
|
637
639
|
"content-manager.success.record.delete": "Eliminat",
|
|
638
640
|
"content-manager.success.record.publish": "Publicat",
|
|
@@ -687,4 +689,4 @@
|
|
|
687
689
|
"request.error.model.unknown": "Aquest model no existeix",
|
|
688
690
|
"skipToContent": "Saltar al contingut",
|
|
689
691
|
"submit": "Enviar"
|
|
690
|
-
}
|
|
692
|
+
}
|
|
@@ -127,7 +127,7 @@
|
|
|
127
127
|
"Settings.profile.form.section.experience.clear.select": "Ausgewählte Sprache der Oberfläche zurücksetzen",
|
|
128
128
|
"Settings.profile.form.section.experience.here": "hier",
|
|
129
129
|
"Settings.profile.form.section.experience.interfaceLanguage": "Sprache der Oberfläche",
|
|
130
|
-
"Settings.profile.form.section.experience.interfaceLanguage.hint": "Dies wird die Oberfläche für dich in der ausgewählten Sprache darstellen.",
|
|
130
|
+
"Settings.profile.form.section.experience.interfaceLanguage.hint": "Dies wird die Oberfläche für dich in der ausgewählten Sprache darstellen.",
|
|
131
131
|
"Settings.profile.form.section.experience.interfaceLanguageHelp": "Diese Einstellungen werden nur für dich angewandt. Mehr Informationen dazu {here}.",
|
|
132
132
|
"Settings.profile.form.section.experience.mode.label": "Modus der Oberfläche",
|
|
133
133
|
"Settings.profile.form.section.experience.mode.hint": "Zeigt die Oberfläche im gewählten Modus.",
|
|
@@ -631,6 +631,9 @@
|
|
|
631
631
|
"content-manager.success.record.save": "Gespeichert",
|
|
632
632
|
"content-manager.success.record.unpublish": "Veröffentlichung zurückgenommen",
|
|
633
633
|
"content-manager.utils.data-loaded": "{number, plural, =1 {Der Eintrag wurde} other {Die Einträge wurden}} erfolgreich geladen",
|
|
634
|
+
"content-manager.popUpWarning.warning.publish-question": "Wollst du diesen Eintrag trotzdem veröffentlichen?",
|
|
635
|
+
"content-manager.popUpwarning.warning.has-draft-relations.button-confirm": "Ja, veröffentlichen",
|
|
636
|
+
"content-manager.popUpwarning.warning.has-draft-relations.message": "<b>{count, plural, =0 { von deinen Inhalts-Beziehungen sind} one { von deinen Inhalts-Beziehungen ist} other { von deinen Inhalts-Beziehungen sind}}</b> noch nicht veröffentlicht.<br></br>Das kann zu kaputten Links und Fehlern in deinem Projekt führen.",
|
|
634
637
|
"form.button.done": "Fertig",
|
|
635
638
|
"global.actions": "Aktionen",
|
|
636
639
|
"global.back": "Zurück",
|
|
@@ -577,6 +577,9 @@
|
|
|
577
577
|
"content-manager.success.record.save": "Gemt",
|
|
578
578
|
"content-manager.success.record.unpublish": "Offentliggørelse fjernet",
|
|
579
579
|
"content-manager.utils.data-loaded": "The {number, plural, =1 {element er} other {elementer er}} blevet hentet succesfuldt",
|
|
580
|
+
"content-manager.popUpWarning.warning.publish-question": "Vil du stadig offentliggøre det?",
|
|
581
|
+
"content-manager.popUpwarning.warning.has-draft-relations.button-confirm": "Ja, offentliggør",
|
|
582
|
+
"content-manager.popUpwarning.warning.has-draft-relations.message": "<b>{count, plural, =0 { af dine indholdsrelationer er} one { af dine indholdsrelationer er} other { af dine indholdsrelationer er}}</b> endnu ikke offentliggjort.<br></br>Det kan muligvis føre til links der ikke virker, samt andre fejl i dit projekt.",
|
|
580
583
|
"form.button.done": "Færdig",
|
|
581
584
|
"global.prompt.unsaved": "Er du sikker på at du vil forlade denne side? Alle dine ændringer vil gå tabt",
|
|
582
585
|
"notification.contentType.relations.conflict": "Der er en eller flere konflikter med indholdstypens relationer",
|
|
@@ -91,10 +91,24 @@
|
|
|
91
91
|
"Settings.apiTokens.ListView.headers.description": "Description",
|
|
92
92
|
"Settings.apiTokens.ListView.headers.type": "Token type",
|
|
93
93
|
"Settings.apiTokens.ListView.headers.createdAt": "Created at",
|
|
94
|
+
"Settings.apiTokens.ListView.headers.lastUsedAt": "Last used",
|
|
94
95
|
"Settings.apiTokens.notification.copied": "Token copied to clipboard.",
|
|
95
96
|
"Settings.apiTokens.title": "API Tokens",
|
|
96
97
|
"Settings.apiTokens.types.full-access": "Full access",
|
|
97
98
|
"Settings.apiTokens.types.read-only": "Read-only",
|
|
99
|
+
"Settings.apiTokens.duration.7-days": "7 days",
|
|
100
|
+
"Settings.apiTokens.duration.30-days": "30 days",
|
|
101
|
+
"Settings.apiTokens.duration.90-days": "90 days",
|
|
102
|
+
"Settings.apiTokens.duration.unlimited": "Unlimited",
|
|
103
|
+
"Settings.apiTokens.form.duration":"Token duration",
|
|
104
|
+
"Settings.apiTokens.form.type":"Token type",
|
|
105
|
+
"Settings.apiTokens.duration.expiration-date":"Expiration date",
|
|
106
|
+
"Settings.apiTokens.createPage.permissions.title":"Permissions",
|
|
107
|
+
"Settings.apiTokens.createPage.permissions.description":"Only actions bound by a route are listed below.",
|
|
108
|
+
"Settings.apiTokens.RegenerateDialog.title": "Regenerate token",
|
|
109
|
+
"Settings.apiTokens.popUpWarning.message": "Are you sure you want to regenerate this token?",
|
|
110
|
+
"Settings.apiTokens.Button.cancel": "Cancel",
|
|
111
|
+
"Settings.apiTokens.Button.regenerate": "Regenerate",
|
|
98
112
|
"Settings.application.description": "Administration panel’s global information",
|
|
99
113
|
"Settings.application.edition-title": "current plan",
|
|
100
114
|
"Settings.application.get-help": "Get help",
|
|
@@ -408,7 +422,7 @@
|
|
|
408
422
|
"app.containers.Users.EditPage.roles-bloc-title": "Attributed roles",
|
|
409
423
|
"app.containers.Users.ModalForm.footer.button-success": "Invite user",
|
|
410
424
|
"app.links.configure-view": "Configure the view",
|
|
411
|
-
"app.page.not.found": "Oops! We can't seem to find the page you're
|
|
425
|
+
"app.page.not.found": "Oops! We can't seem to find the page you're looking for...",
|
|
412
426
|
"app.static.links.cheatsheet": "CheatSheet",
|
|
413
427
|
"app.utils.SelectOption.defaultMessage": " ",
|
|
414
428
|
"app.utils.add-filter": "Add filter",
|
|
@@ -685,6 +699,10 @@
|
|
|
685
699
|
"content-manager.success.record.unpublish": "Unpublished",
|
|
686
700
|
"content-manager.utils.data-loaded": "The {number, plural, =1 {entry has} other {entries have}} successfully been loaded",
|
|
687
701
|
"content-manager.apiError.This attribute must be unique": "{field} must be unique",
|
|
702
|
+
"content-manager.popUpWarning.warning.has-draft-relations.title": "Confirmation",
|
|
703
|
+
"content-manager.popUpWarning.warning.publish-question": "Do you still want to publish?",
|
|
704
|
+
"content-manager.popUpwarning.warning.has-draft-relations.button-confirm": "Yes, publish",
|
|
705
|
+
"content-manager.popUpwarning.warning.has-draft-relations.message": "<b>{count, plural, one { relation is } other { relations are } }</b> not published yet and might lead to unexpected behavior.",
|
|
688
706
|
"form.button.continue": "Continue",
|
|
689
707
|
"form.button.done": "Done",
|
|
690
708
|
"global.search": "Search",
|
|
@@ -747,6 +765,9 @@
|
|
|
747
765
|
"notification.success.delete": "The item has been deleted",
|
|
748
766
|
"notification.success.saved": "Saved",
|
|
749
767
|
"notification.success.title": "Success:",
|
|
768
|
+
"notification.success.tokencreated": "API Token successfully created",
|
|
769
|
+
"notification.success.tokenedited": "API Token successfully edited",
|
|
770
|
+
"notification.error.tokennamenotunique": "Name already assigned to another token",
|
|
750
771
|
"notification.version.update.message": "A new version of Strapi is available!",
|
|
751
772
|
"notification.warning.title": "Warning:",
|
|
752
773
|
"notification.warning.404": "404 - Not found",
|