{"_id":"@cslegany/custom-dashboard-strapi5","_rev":"1-b21816049a3b232ca5eead650d744a67","name":"@cslegany/custom-dashboard-strapi5","dist-tags":{"latest":"0.5.1"},"versions":{"0.5.0":{"name":"@cslegany/custom-dashboard-strapi5","version":"0.5.0","keywords":["Custom Dashboard","Strapi 5"],"author":{"url":"https://synerinsoft.com/","name":"cslegany","email":"cslegany@synerinsoft.com"},"license":"MIT","_id":"@cslegany/custom-dashboard-strapi5@0.5.0","maintainers":[{"name":"cslegany","email":"cslegany@synerinsoft.com"}],"dist":{"shasum":"c91acee55aed72f63d32c1539074ec8951d088b7","tarball":"https://registry.npmjs.org/@cslegany/custom-dashboard-strapi5/-/custom-dashboard-strapi5-0.5.0.tgz","fileCount":16,"integrity":"sha512-BRDQYBrr13xLBigReixUx7xWFoq9Cyy370q08mMgEwAb1dH7jBOgsb74zLE7GOvMeXfxt5LkEEuyycRbc8WSjw==","signatures":[{"sig":"MEUCIQCh/xOpyywouG6phlinnmpBh8/gOrRi7kU1dmSa0JwlMwIgUmRRczpPdT8dA0NrIK5KCNpYV8HcBGScpIWgEmI4CC8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":420290},"type":"commonjs","strapi":{"kind":"plugin","name":"custom-dashboard","description":"A fully customizable Dashboard to replace the default one.","displayName":"Custom Dashboard"},"exports":{"./package.json":"./package.json","./strapi-admin":{"types":"./dist/admin/src/index.d.ts","import":"./dist/admin/index.mjs","source":"./admin/src/index.ts","default":"./dist/admin/index.js","require":"./dist/admin/index.js"},"./strapi-server":{"types":"./dist/server/src/index.d.ts","import":"./dist/server/index.mjs","source":"./server/src/index.ts","default":"./dist/server/index.js","require":"./dist/server/index.js"}},"gitHead":"b5731f2f3a873972530ffeee09604f93d9e1a939","scripts":{"build":"strapi-plugin build","watch":"strapi-plugin watch","verify":"strapi-plugin verify","watch:link":"strapi-plugin watch:link","test:ts:back":"run -T tsc -p server/tsconfig.json","test:ts:front":"run -T tsc -p admin/tsconfig.json"},"_npmUser":{"name":"cslegany","email":"cslegany@synerinsoft.com"},"_npmVersion":"10.2.4","description":"A fully customizable Dashboard to replace the default one.","directories":{},"_nodeVersion":"20.11.0","dependencies":{"lodash":"^4.17.21","array-move":"^4.0.0","react-intl":"^6.8.0","react-iframe":"^1.8.5","@dnd-kit/core":"^6.1.0","@strapi/icons":"^2.0.0-rc.11","@dnd-kit/sortable":"^8.0.0","@dnd-kit/utilities":"^3.2.2","@strapi/design-system":"^2.0.0-rc.11"},"_hasShrinkwrap":false,"devDependencies":{"react":"^18.3.1","prettier":"^3.3.3","react-dom":"^18.3.1","typescript":"^5.6.3","@types/react":"^18.3.11","@strapi/strapi":"^5.0.0","@types/react-dom":"^18.3.1","react-router-dom":"^6.27.0","styled-components":"^6.1.13","@strapi/sdk-plugin":"^5.2.7","@strapi/typescript-utils":"^5.0.0"},"peerDependencies":{"react":"^18.3.1","react-dom":"^18.3.1","@strapi/strapi":"^5.0.0","react-router-dom":"^6.27.0","styled-components":"^6.1.13","@strapi/sdk-plugin":"^5.2.7"},"_npmOperationalInternal":{"tmp":"tmp/custom-dashboard-strapi5_0.5.0_1729682465946_0.5523890706475003","host":"s3://npm-registry-packages"}},"0.5.1":{"name":"@cslegany/custom-dashboard-strapi5","version":"0.5.1","description":"A fully customizable Dashboard to replace the default one.","strapi":{"kind":"plugin","name":"custom-dashboard","displayName":"Custom Dashboard","description":"A fully customizable Dashboard to replace the default one."},"keywords":["Custom Dashboard","Strapi 5"],"license":"MIT","type":"commonjs","exports":{"./package.json":"./package.json","./strapi-admin":{"types":"./dist/admin/src/index.d.ts","source":"./admin/src/index.ts","import":"./dist/admin/index.mjs","require":"./dist/admin/index.js","default":"./dist/admin/index.js"},"./strapi-server":{"types":"./dist/server/src/index.d.ts","source":"./server/src/index.ts","import":"./dist/server/index.mjs","require":"./dist/server/index.js","default":"./dist/server/index.js"}},"scripts":{"build":"strapi-plugin build","test:ts:back":"run -T tsc -p server/tsconfig.json","test:ts:front":"run -T tsc -p admin/tsconfig.json","verify":"strapi-plugin verify","watch":"strapi-plugin watch","watch:link":"strapi-plugin watch:link"},"dependencies":{"@dnd-kit/core":"^6.1.0","@dnd-kit/sortable":"^8.0.0","@dnd-kit/utilities":"^3.2.2","@strapi/design-system":"^2.0.0-rc.11","@strapi/icons":"^2.0.0-rc.11","array-move":"^4.0.0","iframe-resizer":"^5.3.2","lodash":"^4.17.21","react-iframe":"^1.8.5","react-intl":"^6.8.0"},"devDependencies":{"@strapi/sdk-plugin":"^5.2.7","@strapi/strapi":"^5.0.0","@strapi/typescript-utils":"^5.0.0","@types/react":"^18.3.11","@types/react-dom":"^18.3.1","prettier":"^3.3.3","react":"^18.3.1","react-dom":"^18.3.1","react-router-dom":"^6.27.0","styled-components":"^6.1.13","typescript":"^5.6.3"},"peerDependencies":{"@strapi/sdk-plugin":"^5.2.7","@strapi/strapi":"^5.0.0","react":"^18.3.1","react-dom":"^18.3.1","react-router-dom":"^6.27.0","styled-components":"^6.1.13"},"author":{"name":"cslegany","email":"cslegany@synerinsoft.com","url":"https://synerinsoft.com/"},"maintainers":[{"name":"cslegany","email":"cslegany@synerinsoft.com"}],"_id":"@cslegany/custom-dashboard-strapi5@0.5.1","gitHead":"4a9b81990730dcce053962134710340d36095ade","_nodeVersion":"20.11.0","_npmVersion":"10.2.4","dist":{"integrity":"sha512-J3fIGYUsrrwwu9Xmbyl/85diy+06nix5CvOktIFHh7mnFc1k/EjikIyPZXTrGiRBGZfkwI6fOijv26YvFQqmqg==","shasum":"7e32d3be04ec4e9f1eaac8a2d271255151c4d87e","tarball":"https://registry.npmjs.org/@cslegany/custom-dashboard-strapi5/-/custom-dashboard-strapi5-0.5.1.tgz","fileCount":16,"unpackedSize":420940,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCLV1lx0vqwJDAIlyf2GEHhjlckxkk4TAHLG606IZzuTgIhAN6ERZcTCvxzgyvU/h6Dvhnrkzxt1JiQwngpWLFmomwC"}]},"_npmUser":{"name":"cslegany","email":"cslegany@synerinsoft.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/custom-dashboard-strapi5_0.5.1_1730193540347_0.77743945686171"},"_hasShrinkwrap":false}},"time":{"created":"2024-10-23T11:21:05.867Z","modified":"2024-10-29T09:19:00.814Z","0.5.0":"2024-10-23T11:21:06.224Z","0.5.1":"2024-10-29T09:19:00.654Z"},"author":{"name":"cslegany","email":"cslegany@synerinsoft.com","url":"https://synerinsoft.com/"},"license":"MIT","keywords":["Custom Dashboard","Strapi 5"],"description":"A fully customizable Dashboard to replace the default one.","maintainers":[{"name":"cslegany","email":"cslegany@synerinsoft.com"}],"readme":"# strapi5-custom-dashboard\n> This package adds a fully customizable Dashboard to replace the default one.\n\n## Installation\n\nNPM:\n\n> `npm install @cslegany/custom-dashboard-strapi5`\n\nYarn:\n\n> `yarn add @cslegany/custom-dashboard-strapi5`\n\n## Usage\n- Install and configure the plugin. Each category is identified by a label, and can have an icon and a hint message. Create as many categories as you wish.\n- Create items in the selected category. An item is identified by a label, and can have an icon and a hint message. It can either be of collection or single type.\n- DB entity ID of the item follows strapi patterns (i.e. api::article.article)\n- A separate list of iframes can also be added. Each iframe is identified by a label, and can have an icon and a hint message. \nYou can set a width and height value and can use iframe-resizer to get rid of the vertical scrollbar so famous for the '90s.\n- Use the drag-and-drop feature to reorder categories, items of iframes.\n- The UI of the plugin is accessible via the Menu link.\n\n## Iframes and middleware customization\n- In order to allow for example youtube.com and https://plausible.io to get loaded in an iframe, add the following code to config/middlewares.ts in your Strapi project:\n\n```\nexport default [\n  ...\n  {\n    name: \"strapi::security\",\n    config: {\n      contentSecurityPolicy: {\n        useDefaults: true,\n        directives: {\n          \"frame-src\": [\n            \"'self'\",\n            \"*.youtube.com\",\n            \"https://plausible.io\",\n          ],\n        },\n        upgradeInsecureRequests: null\n      }\n    }\n  },\n  { resolve: \"./src/middlewares/custom-dashboard\" },\n];\n```\n\nYou'll need an extra middleware to replace the built-in welcome screen with Custom Dashboard.\nAdd the following code to src/middlewares/custom-dashboard.ts :\n\n```\nimport type * as strapi from '@strapi/strapi';\n\nexport default (config, { strapi }: { strapi: strapi.Core.Strapi }) => {\n\tstrapi.server.routes([\n\t\t{\n\t\t\tmethod: 'GET',\n\t\t\tpath: '/',\n\t\t\thandler(ctx) {\n\t\t\t\tctx.redirect(\"/admin/plugins/custom-dashboard\");\n\t\t\t},\n\t\t\tconfig: { auth: false },\n\t\t},\n\t\t{\n\t\t\tmethod: 'GET',\n\t\t\tpath: '/admin',\n\t\t\thandler(ctx) {\n\t\t\t\tctx.redirect(\"/admin/plugins/custom-dashboard\");\n\t\t\t},\n\t\t\tconfig: { auth: false },\n\t\t},\n\t\t{\n\t\t\tmethod: 'GET',\n\t\t\tpath: \"/index.html\",\n\t\t\thandler(ctx) {\n\t\t\t\tctx.redirect(\"/admin/plugins/custom-dashboard\");\n\t\t\t},\n\t\t\tconfig: { auth: false },\n\t\t},\n\t]);\n\n\treturn async (context, next) => {\n\t\tstrapi.log.info(\"In admin-redirect middleware.\");\n\t\tawait next();\n\t};\n};\n```\n\nNote that this middleware rarely works well in develop mode but has been working in other environments.\n\nIf the custom middleware doesn't suit you, you can experiment with app.tsx redirects.\nInstall @types/dom-navigation\nRename src/admin/app.example.tsx to app.tsx and add the following code to bootstrap(app: StrapiApp) { }\n\n```\nbootstrap(app: StrapiApp) {\n\t\tconst url = \"/admin/plugins/custom-dashboard\";\n\n\t\tif (\"navigation\" in window) {\n\t\t\t// Redirect soft /admin navigations to `url`\n\t\t\t// Chrome-only\n\t\t\twindow.navigation.addEventListener(\"navigate\", (e) => {\n\t\t\t\tconst { pathname } = new URL(e.destination.url);\n\n\t\t\t\tif (new RegExp(\"^/admin/?$\").test(pathname)) {\n\t\t\t\t\twindow.navigation.navigate(url);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\t// Redirect hard /admin navigations to `url`\n\t\tif (new RegExp(\"^/admin/?$\").test(location.pathname)) {\n\t\t\tlocation.href = url;\n\t\t}\n\t},\n```\n\n## License\n\nMIT\r\n","readmeFilename":"README.md"}