From 919ea1086ba9bbee1eada6031db641ddc2e8a01d Mon Sep 17 00:00:00 2001 From: Stef Winterswijk Date: Tue, 30 Jan 2024 16:24:30 +0100 Subject: [PATCH] Add FileInvoice icon --- package.json | 6 +++--- src/App/Routes/AppRoutes.tsx | 6 +++--- src/components/Sidebar/Sidebar.tsx | 15 ++++++++++++-- src/hooks/usePermissions.ts | 3 +++ yarn.lock | 32 +++++++++++++++--------------- 5 files changed, 38 insertions(+), 24 deletions(-) diff --git a/package.json b/package.json index 7810fed7..8f131640 100644 --- a/package.json +++ b/package.json @@ -6,10 +6,10 @@ "type": "module", "dependencies": { "@headlessui/react": "^1.7.17", - "@pzh-ui/components": "^0.0.452", + "@pzh-ui/components": "^0.0.463", "@pzh-ui/config": "^0.0.56", - "@pzh-ui/css": "^0.0.75", - "@pzh-ui/icons": "^0.0.47", + "@pzh-ui/css": "^0.0.79", + "@pzh-ui/icons": "^0.0.50", "@react-hookz/web": "^24.0.2", "@tanstack/react-query": "^5.14.2", "axios": "^1.6.2", diff --git a/src/App/Routes/AppRoutes.tsx b/src/App/Routes/AppRoutes.tsx index 283b66f9..07dd5616 100644 --- a/src/App/Routes/AppRoutes.tsx +++ b/src/App/Routes/AppRoutes.tsx @@ -393,7 +393,7 @@ const AppRoutes = () => { element: ( @@ -405,7 +405,7 @@ const AppRoutes = () => { element: ( @@ -417,7 +417,7 @@ const AppRoutes = () => { element: ( diff --git a/src/components/Sidebar/Sidebar.tsx b/src/components/Sidebar/Sidebar.tsx index 87c6a3e5..ad82f9dc 100644 --- a/src/components/Sidebar/Sidebar.tsx +++ b/src/components/Sidebar/Sidebar.tsx @@ -1,5 +1,5 @@ import { Text } from '@pzh-ui/components' -import { House, Users } from '@pzh-ui/icons' +import { FileInvoice, House, Users } from '@pzh-ui/icons' import classNames from 'classnames' import { useState } from 'react' import { Link } from 'react-router-dom' @@ -9,7 +9,7 @@ import { ModelType } from '@/config/objects/types' import usePermissions from '@/hooks/usePermissions' const Sidebar = () => { - const { canEditUser } = usePermissions() + const { canEditUser, canCreatePublicationTemplates } = usePermissions() const [expanded, setExpanded] = useState(false) @@ -91,6 +91,17 @@ const Sidebar = () => { /> )} + + {canCreatePublicationTemplates && ( + window.clearTimeout(timer)} + /> + )} diff --git a/src/hooks/usePermissions.ts b/src/hooks/usePermissions.ts index 9989e104..da4c952b 100644 --- a/src/hooks/usePermissions.ts +++ b/src/hooks/usePermissions.ts @@ -12,6 +12,7 @@ export interface Permissions { canCreateUser: boolean canEditUser: boolean canResetUserPassword: boolean + canCreatePublicationTemplates: boolean } const usePermissions = (): Permissions => { @@ -29,6 +30,7 @@ const usePermissions = (): Permissions => { canCreateUser: false, canEditUser: false, canResetUserPassword: false, + canCreatePublicationTemplates: false, } switch (role) { @@ -51,6 +53,7 @@ const usePermissions = (): Permissions => { canCreateUser: true, canEditUser: true, canResetUserPassword: true, + canCreatePublicationTemplates: true, } case 'Behandelend Ambtenaar': return { diff --git a/yarn.lock b/yarn.lock index 1bb34ecb..be5c3b84 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2479,13 +2479,13 @@ __metadata: languageName: node linkType: hard -"@pzh-ui/components@npm:^0.0.452": - version: 0.0.452 - resolution: "@pzh-ui/components@npm:0.0.452" +"@pzh-ui/components@npm:^0.0.463": + version: 0.0.463 + resolution: "@pzh-ui/components@npm:0.0.463" dependencies: "@floating-ui/react": "npm:^0.24.8" "@headlessui/react": "npm:^1.5.0" - "@pzh-ui/icons": "npm:^0.0.47" + "@pzh-ui/icons": "npm:^0.0.50" "@react-aria/utils": "npm:^3.19.0" "@react-hookz/web": "npm:^23.1.0" "@react-types/shared": "npm:^3.19.0" @@ -2531,7 +2531,7 @@ __metadata: react-stately: "npm:^3.18.0" react-table: "npm:^7.8.0" react-toastify: "npm:^9.1.2" - checksum: 63dcd0d4e425dee788102bec43f5d4899843fe81c0961d8d0f9e238e23cce738868e152a42491f03f91a61b1b2dccbe0fee9740b29a815f692cc02eb64d4f7dc + checksum: c7afdde70501bc6ff443757fc0b6d8f15adf7f91c8d2cd3bfa80c9086773562f5b19a2890b86425243a6691f0d042f332fd43881324676cf0d9acd5ddf61f8f8 languageName: node linkType: hard @@ -2563,9 +2563,9 @@ __metadata: languageName: node linkType: hard -"@pzh-ui/css@npm:^0.0.75": - version: 0.0.75 - resolution: "@pzh-ui/css@npm:0.0.75" +"@pzh-ui/css@npm:^0.0.79": + version: 0.0.79 + resolution: "@pzh-ui/css@npm:0.0.79" dependencies: "@rollup/plugin-typescript": "npm:^8.3.1" "@tailwindcss/custom-forms": "npm:^0.2.1" @@ -2574,17 +2574,17 @@ __metadata: "@tailwindcss/typography": "npm:^0.5.9" react-datepicker: "npm:^4.7.0" react-toastify: "npm:^9.1.2" - checksum: 98534c48dbaafe7f7a0c2b2cb5e57c374763e4279b1882f29cd094744fd5f2c827adfc53a60cdcde4524a70451d4a0021fa761133633c29492ba5a586f131358 + checksum: 65f08cd2a33108adf63a83cbe680f6f72733385cff6608d082a7c47d93f5457cb595a15d90c8057553877737be658a21c670ca1693f96a8595c03da232b00614 languageName: node linkType: hard -"@pzh-ui/icons@npm:^0.0.47": - version: 0.0.47 - resolution: "@pzh-ui/icons@npm:0.0.47" +"@pzh-ui/icons@npm:^0.0.50": + version: 0.0.50 + resolution: "@pzh-ui/icons@npm:0.0.50" dependencies: react: "npm:^18.0.0" react-toastify: "npm:^9.1.2" - checksum: 1d677dd9d1d36cf9608d2778fcf1efff423e9c2e1fc0324d750b7c1541c3aca3e61cf459810aa300d9d4fde0ebd8fe8526ec852a22f8f9a8987ab7758f18f4ca + checksum: a94a31decee8c7d314e8befbd4139875700729c136704c4f49c1ccad4dc4e1f2190af5f794d98a27b7479b21fea8c7b7b0fda1bd319d1374b34e6defc2f119de languageName: node linkType: hard @@ -12375,10 +12375,10 @@ __metadata: "@axe-core/react": "npm:^4.8.2" "@faker-js/faker": "npm:^8.3.1" "@headlessui/react": "npm:^1.7.17" - "@pzh-ui/components": "npm:^0.0.452" + "@pzh-ui/components": "npm:^0.0.463" "@pzh-ui/config": "npm:^0.0.56" - "@pzh-ui/css": "npm:^0.0.75" - "@pzh-ui/icons": "npm:^0.0.47" + "@pzh-ui/css": "npm:^0.0.79" + "@pzh-ui/icons": "npm:^0.0.50" "@react-hookz/web": "npm:^24.0.2" "@tanstack/react-query": "npm:^5.14.2" "@testing-library/dom": "npm:^9.3.3"