Skip to content

Commit 63ac38c

Browse files
committed
feat: Move admin page to settings
1 parent 37ef6f6 commit 63ac38c

2 files changed

Lines changed: 28 additions & 15 deletions

File tree

admin/src/index.js

Lines changed: 26 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { prefixPluginTranslations } from '@strapi/helper-plugin';
22
import pluginPkg from '../../package.json';
33
import pluginId from './helpers/pluginId';
4-
import pluginIcon from './components/PluginIcon';
54
import pluginPermissions from './permissions';
5+
// import pluginIcon from './components/PluginIcon';
66
// import getTrad from './helpers/getTrad';
77

88
const pluginDescription = pluginPkg.strapi.description || pluginPkg.description;
@@ -18,22 +18,33 @@ export default {
1818
name,
1919
});
2020

21-
app.addMenuLink({
22-
to: `/plugins/${pluginId}`,
23-
icon: pluginIcon,
24-
intlLabel: {
25-
id: `${pluginId}.plugin.name`,
26-
defaultMessage: 'Config Sync',
21+
app.createSettingSection(
22+
{
23+
id: pluginId,
24+
intlLabel: {
25+
id: `${pluginId}.plugin.name`,
26+
defaultMessage: 'Config Sync',
27+
},
2728
},
28-
Component: async () => {
29-
const component = await import(
30-
/* webpackChunkName: "config-sync-settings-page" */ './containers/App'
31-
);
29+
[
30+
{
31+
intlLabel: {
32+
id: `${pluginId}.Settings.Tool.Title`,
33+
defaultMessage: 'Tools',
34+
},
35+
id: 'config-sync-page',
36+
to: `/settings/${pluginId}`,
37+
Component: async () => {
38+
const component = await import(
39+
/* webpackChunkName: "config-sync-settings-page" */ './containers/App'
40+
);
3241

33-
return component;
34-
},
35-
permissions: pluginPermissions['menu-link'],
36-
});
42+
return component;
43+
},
44+
permissions: pluginPermissions['settings'],
45+
},
46+
],
47+
);
3748
},
3849
bootstrap(app) {},
3950
async registerTrads({ locales }) {

admin/src/translations/en.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,7 @@
1010
"Header.Title": "Config Sync",
1111
"Header.Description": "Manage your database config across environments.",
1212

13+
"Settings.Tool.Title": "Tool",
14+
1315
"plugin.name": "Config Sync"
1416
}

0 commit comments

Comments
 (0)