Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix permissions style #10534

Merged
merged 1 commit into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions app/ide-desktop/lib/common/src/utilities/permissions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,6 @@ export enum Permission {
delete = 'delete',
}

/** CSS classes for each permission. */
export const PERMISSION_CLASS_NAME: Readonly<Record<Permission, string>> = {
[Permission.owner]: 'text-tag-text bg-permission-owner',
[Permission.admin]: 'text-tag-text bg-permission-admin',
[Permission.edit]: 'text-tag-text bg-permission-edit',
[Permission.read]: 'text-tag-text bg-permission-read',
[Permission.view]: 'text-tag-text-2 bg-permission-view',
[Permission.delete]: 'text-tag-text bg-delete',
}

/** Precedences for each permission. A lower number means a higher priority. */
export const PERMISSION_PRECEDENCE: Readonly<Record<Permission, number>> = {
// These are not magic numbers - they are just a sequence of numbers.
Expand Down Expand Up @@ -86,11 +76,6 @@ export const PERMISSION_ACTION_PRECEDENCE: Readonly<Record<PermissionAction, num
/* eslint-enable @typescript-eslint/no-magic-numbers */
}

/** CSS classes for the docs permission. */
export const DOCS_CLASS_NAME = 'text-tag-text bg-permission-docs'
/** CSS classes for the execute permission. */
export const EXEC_CLASS_NAME = 'text-tag-text bg-permission-exec'

/** The corresponding {@link Permissions} for each {@link PermissionAction}. */
export const FROM_PERMISSION_ACTION: Readonly<Record<PermissionAction, Permissions>> = {
[PermissionAction.own]: { type: Permission.owner },
Expand Down
17 changes: 17 additions & 0 deletions app/ide-desktop/lib/dashboard/src/utilities/permissions.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/** @file Utilities for working with permissions. */

import * as permissions from 'enso-common/src/utilities/permissions'

export * from 'enso-common/src/utilities/permissions'

/** CSS classes for each permission. */
export const PERMISSION_CLASS_NAME: Readonly<Record<permissions.Permission, string>> = {
[permissions.Permission.owner]: 'text-tag-text bg-permission-owner',
[permissions.Permission.admin]: 'text-tag-text bg-permission-admin',
[permissions.Permission.edit]: 'text-tag-text bg-permission-edit',
[permissions.Permission.read]: 'text-tag-text bg-permission-read',
[permissions.Permission.view]: 'text-tag-text-2 bg-permission-view',
[permissions.Permission.delete]: 'text-tag-text bg-delete',
}

/** CSS classes for the docs permission. */
export const DOCS_CLASS_NAME = 'text-tag-text bg-permission-docs'
/** CSS classes for the execute permission. */
export const EXEC_CLASS_NAME = 'text-tag-text bg-permission-exec'
Loading