feat: add board access settings (#249)
* wip: add board access settings * wip: add user access control * wip: add user access control * feat: add user access control * refactor: move away from mantine-modal-manager * fix: ci issues and failing tests * fix: lint issue * fix: format issue * fix: deepsource issues * chore: address pull request feedback
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import type { stringOrTranslation, TranslationFunction } from "./type";
|
||||
|
||||
export * from "./type";
|
||||
|
||||
export const supportedLanguages = ["en", "de"] as const;
|
||||
@@ -5,3 +7,13 @@ export type SupportedLanguage = (typeof supportedLanguages)[number];
|
||||
|
||||
export const defaultLocale = "en";
|
||||
export { languageMapping } from "./lang";
|
||||
|
||||
export const translateIfNecessary = (
|
||||
t: TranslationFunction,
|
||||
value: stringOrTranslation | undefined,
|
||||
) => {
|
||||
if (typeof value === "function") {
|
||||
return value(t);
|
||||
}
|
||||
return value;
|
||||
};
|
||||
|
||||
@@ -191,9 +191,11 @@ export default {
|
||||
},
|
||||
common: {
|
||||
action: {
|
||||
add: "Add",
|
||||
backToOverview: "Back to overview",
|
||||
create: "Create",
|
||||
edit: "Edit",
|
||||
remove: "Remove",
|
||||
save: "Save",
|
||||
saveChanges: "Save changes",
|
||||
cancel: "Cancel",
|
||||
@@ -512,6 +514,35 @@ export default {
|
||||
customCss: {
|
||||
title: "Custom css",
|
||||
},
|
||||
access: {
|
||||
title: "Access control",
|
||||
permission: {
|
||||
userSelect: {
|
||||
title: "Add user permission",
|
||||
label: "Select user",
|
||||
notFound: "No user found",
|
||||
},
|
||||
field: {
|
||||
user: {
|
||||
label: "User",
|
||||
},
|
||||
permission: {
|
||||
label: "Permission",
|
||||
},
|
||||
},
|
||||
item: {
|
||||
"board-view": {
|
||||
label: "View board",
|
||||
},
|
||||
"board-change": {
|
||||
label: "Change board",
|
||||
},
|
||||
"board-full": {
|
||||
label: "Full access",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
dangerZone: {
|
||||
title: "Danger Zone",
|
||||
action: {
|
||||
|
||||
@@ -3,3 +3,4 @@ import type enTranslation from "./lang/en";
|
||||
|
||||
export type TranslationFunction = ReturnType<typeof useI18n>;
|
||||
export type TranslationObject = typeof enTranslation;
|
||||
export type stringOrTranslation = string | ((t: TranslationFunction) => string);
|
||||
|
||||
Reference in New Issue
Block a user