The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Rocket.Chat/apps/meteor/client/views/admin/sidebarItems.ts

128 lines
3.3 KiB

import { hasPermission, hasAtLeastOnePermission, hasAllPermission } from '../../../app/authorization/client';
import { createSidebarItems } from '../../lib/createSidebarItems';
export const {
registerSidebarItem: registerAdminSidebarItem,
unregisterSidebarItem,
Chore: Replace `useSubscription` with `useSyncExternalStore` (#25909) <!-- This is a pull request template, you do not need to uncomment or remove the comments, they won't show up in the PR text. --> <!-- Your Pull Request name should start with one of the following tags [NEW] For new features [IMPROVE] For an improvement (performance or little improvements) in existing features [FIX] For bug fixes that affect the end-user [BREAK] For pull requests including breaking changes Chore: For small tasks Doc: For documentation --> <!-- Checklist!!! If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code. - I have read the Contributing Guide - https://github.com/RocketChat/Rocket.Chat/blob/develop/.github/CONTRIBUTING.md#contributing-to-rocketchat doc - I have signed the CLA - https://cla-assistant.io/RocketChat/Rocket.Chat - Lint and unit tests pass locally with my changes - I have added tests that prove my fix is effective or that my feature works (if applicable) - I have added necessary documentation (if applicable) - Any dependent changes have been merged and published in downstream modules --> ## Proposed changes (including videos or screenshots) <!-- CHANGELOG --> <!-- Describe the big picture of your changes here to communicate to the maintainers why we should accept this pull request. If it fixes a bug or resolves a feature request, be sure to link to that issue below. This description will appear in the release notes if we accept the contribution. --> <!-- END CHANGELOG --> ## Issue(s) <!-- Link the issues being closed by or related to this PR. For example, you can use #594 if this PR closes issue number 594 --> ## Steps to test or reproduce <!-- Mention how you would reproduce the bug if not mentioned on the issue page already. Also mention which screens are going to have the changes if applicable --> ## Further comments <!-- If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc... -->
4 years ago
getSidebarItems: getAdminSidebarItems,
subscribeToSidebarItems: subscribeToAdminSidebarItems,
} = createSidebarItems([
{
href: 'admin-info',
i18nLabel: 'Info',
icon: 'info-circled',
permissionGranted: (): boolean => hasPermission('view-statistics'),
},
{
icon: 'shield-alt',
href: 'moderation-console',
i18nLabel: 'Moderation console',
tag: 'Beta',
permissionGranted: (): boolean => hasPermission('view-moderation-console'),
},
{
href: 'admin-import',
i18nLabel: 'Import',
icon: 'import',
permissionGranted: (): boolean => hasPermission('run-import'),
},
{
href: 'admin-users',
i18nLabel: 'Users',
icon: 'team',
permissionGranted: (): boolean => hasPermission('view-user-administration'),
},
{
href: 'admin-rooms',
i18nLabel: 'Rooms',
icon: 'hashtag',
permissionGranted: (): boolean => hasPermission('view-room-administration'),
},
{
href: 'invites',
i18nLabel: 'Invites',
icon: 'user-plus',
permissionGranted: (): boolean => hasPermission('create-invite-links'),
},
{
icon: 'cloud-plus',
href: 'cloud',
[IMPROVE] Registration Experience (#27820) * chore: add register button to kebab menu * chore: change name section to registration * chore: use new register section * chore: add registered workspace modal * chore: Add workspace registration modal * chore: register workspace setup modal * chore: add modal to register workspace with token * chore: adding translations to workspace registration * chore: open registered modal when user clicks manage * chore: separate register workspace setup modals * feat: Add deregister flow * feat: register workspace connected with backend * feat: register with token connected with backend service * improve: Use workspace token when interacting with Marketplace (#27875) * add: use workspace token when interacting with Marketplace * fix: formatting --------- Co-authored-by: Thassio Victor <tvmcarvalho@gmail.com> Co-authored-by: Aaron Ogle <geekgonecrazy@users.noreply.github.com> * improve: Remove Cloud Login restrictions from Marketplace (#27896) * feat: remove login button * feat: remove login button * fix: add developmentModeButton --------- Co-authored-by: Aaron Ogle <geekgonecrazy@users.noreply.github.com> * Sync disconnect wishes * correct boolean to pass inverse If registerServer is true needs to pass false as they didn't chose not to be * added reconnect method * added reconnect method * add back the disconnect since the unregister code was reverted * chore: move register setup to another modal * chore: add connect workspace functionality * chore: finishing workspace registration * fix broken import * fix: add missing translations * fix: tests dependencies * fix: small lint issue * deregister / unregister -> disconnect in i18n * remove un-necessary sync * finish #27896 remove login requirement from marketplace * remove unused imports * fix: administration model list tests * deregister -> disconnect * fix: duplied translation * fix: iframe modal url token object error * fix: translations error, CS-353, CS-340 --------- Co-authored-by: Pedro Berleze Rorato <41977327+PedroRorato@users.noreply.github.com> Co-authored-by: Aaron Ogle <geekgonecrazy@users.noreply.github.com> Co-authored-by: David Alen <davidalen.dev@gmail.com> Co-authored-by: Thassio Victor <tvmcarvalho@gmail.com> Co-authored-by: Aaron Ogle <aaron@geekgonecrazy.com> Co-authored-by: PedroRorato <pedroberorato@gmail.com>
3 years ago
i18nLabel: 'Registration',
permissionGranted: (): boolean => hasPermission('manage-cloud'),
},
{
href: 'admin-view-logs',
i18nLabel: 'View_Logs',
icon: 'post',
permissionGranted: (): boolean => hasPermission('view-logs'),
},
{
href: 'custom-sounds',
i18nLabel: 'Custom_Sounds',
icon: 'volume',
permissionGranted: (): boolean => hasPermission('manage-sounds'),
},
{
icon: 'discover',
href: 'federation-dashboard',
i18nLabel: 'Federation Dashboard',
permissionGranted: (): boolean => hasPermission('view-federation-data'),
},
{
icon: 'mail',
href: 'admin-email-inboxes',
i18nLabel: 'Email_Inboxes',
tag: 'Alpha',
permissionGranted: (): boolean => hasPermission('manage-email-inbox'),
},
{
icon: 'emoji',
href: 'emoji-custom',
i18nLabel: 'Custom_Emoji',
permissionGranted: (): boolean => hasPermission('manage-emoji'),
},
{
icon: 'code',
href: 'admin-integrations',
i18nLabel: 'Integrations',
permissionGranted: (): boolean =>
hasAtLeastOnePermission([
'manage-outgoing-integrations',
'manage-own-outgoing-integrations',
'manage-incoming-integrations',
'manage-own-incoming-integrations',
]),
},
{
icon: 'discover',
href: 'admin-oauth-apps',
i18nLabel: 'OAuth Apps',
permissionGranted: (): boolean => hasAllPermission('manage-oauth-apps'),
},
{
icon: 'mail',
href: 'admin-mailer',
i18nLabel: 'Mailer',
permissionGranted: (): boolean => hasAllPermission('access-mailer'),
},
{
icon: 'user',
href: 'user-status',
i18nLabel: 'User_Status',
permissionGranted: (): boolean => hasAtLeastOnePermission(['manage-user-status']),
},
{
icon: 'lock',
href: 'admin-permissions',
i18nLabel: 'Permissions',
permissionGranted: (): boolean => hasAtLeastOnePermission(['access-permissions', 'access-setting-permissions']),
},
{
icon: 'customize',
href: 'admin-settings',
i18nLabel: 'Settings',
permissionGranted: (): boolean =>
hasAtLeastOnePermission(['view-privileged-setting', 'edit-privileged-setting', 'manage-selected-settings']),
},
]);