@lokalise/harmony 2.0.4 → 2.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/harmony.cjs +1 -1
- package/dist/harmony.mjs +3 -3
- package/dist/harmony102.cjs +1 -1
- package/dist/harmony102.mjs +1 -1
- package/dist/harmony103.cjs +7 -7
- package/dist/harmony103.mjs +7 -7
- package/dist/harmony105.cjs +2 -2
- package/dist/harmony105.mjs +2 -2
- package/dist/harmony106.cjs +2 -165
- package/dist/harmony106.cjs.map +1 -1
- package/dist/harmony106.mjs +3 -166
- package/dist/harmony106.mjs.map +1 -1
- package/dist/harmony107.cjs +16 -42
- package/dist/harmony107.cjs.map +1 -1
- package/dist/harmony107.mjs +16 -42
- package/dist/harmony107.mjs.map +1 -1
- package/dist/harmony108.cjs +75 -13
- package/dist/harmony108.cjs.map +1 -1
- package/dist/harmony108.mjs +75 -13
- package/dist/harmony108.mjs.map +1 -1
- package/dist/harmony109.cjs +10 -10
- package/dist/harmony109.cjs.map +1 -1
- package/dist/harmony109.mjs +10 -10
- package/dist/harmony109.mjs.map +1 -1
- package/dist/harmony110.cjs +35 -13
- package/dist/harmony110.cjs.map +1 -1
- package/dist/harmony110.mjs +34 -12
- package/dist/harmony110.mjs.map +1 -1
- package/dist/harmony111.cjs +9 -3
- package/dist/harmony111.cjs.map +1 -1
- package/dist/harmony111.mjs +9 -3
- package/dist/harmony111.mjs.map +1 -1
- package/dist/harmony112.cjs +41 -12
- package/dist/harmony112.cjs.map +1 -1
- package/dist/harmony112.mjs +43 -14
- package/dist/harmony112.mjs.map +1 -1
- package/dist/harmony113.cjs +9 -76
- package/dist/harmony113.cjs.map +1 -1
- package/dist/harmony113.mjs +8 -75
- package/dist/harmony113.mjs.map +1 -1
- package/dist/harmony114.cjs +10 -10
- package/dist/harmony114.cjs.map +1 -1
- package/dist/harmony114.mjs +10 -10
- package/dist/harmony114.mjs.map +1 -1
- package/dist/harmony115.cjs +13 -35
- package/dist/harmony115.cjs.map +1 -1
- package/dist/harmony115.mjs +12 -34
- package/dist/harmony115.mjs.map +1 -1
- package/dist/harmony116.cjs +10 -8
- package/dist/harmony116.cjs.map +1 -1
- package/dist/harmony116.mjs +11 -9
- package/dist/harmony116.mjs.map +1 -1
- package/dist/harmony117.cjs +21 -47
- package/dist/harmony117.cjs.map +1 -1
- package/dist/harmony117.mjs +20 -46
- package/dist/harmony117.mjs.map +1 -1
- package/dist/harmony118.cjs +166 -9
- package/dist/harmony118.cjs.map +1 -1
- package/dist/harmony118.mjs +165 -8
- package/dist/harmony118.mjs.map +1 -1
- package/dist/harmony119.cjs +44 -11
- package/dist/harmony119.cjs.map +1 -1
- package/dist/harmony119.mjs +44 -11
- package/dist/harmony119.mjs.map +1 -1
- package/dist/harmony120.cjs +14 -21
- package/dist/harmony120.cjs.map +1 -1
- package/dist/harmony120.mjs +13 -20
- package/dist/harmony120.mjs.map +1 -1
- package/dist/harmony121.cjs +98 -6
- package/dist/harmony121.cjs.map +1 -1
- package/dist/harmony121.mjs +82 -7
- package/dist/harmony121.mjs.map +1 -1
- package/dist/harmony122.cjs +6 -16
- package/dist/harmony122.cjs.map +1 -1
- package/dist/harmony122.mjs +7 -17
- package/dist/harmony122.mjs.map +1 -1
- package/dist/harmony123.cjs +16 -7
- package/dist/harmony123.cjs.map +1 -1
- package/dist/harmony123.mjs +16 -7
- package/dist/harmony123.mjs.map +1 -1
- package/dist/harmony124.cjs +3 -3
- package/dist/harmony124.cjs.map +1 -1
- package/dist/harmony124.mjs +3 -3
- package/dist/harmony124.mjs.map +1 -1
- package/dist/harmony125.cjs +7 -14
- package/dist/harmony125.cjs.map +1 -1
- package/dist/harmony125.mjs +7 -14
- package/dist/harmony125.mjs.map +1 -1
- package/dist/harmony126.cjs +15 -20
- package/dist/harmony126.cjs.map +1 -1
- package/dist/harmony126.mjs +15 -20
- package/dist/harmony126.mjs.map +1 -1
- package/dist/harmony127.cjs +20 -87
- package/dist/harmony127.cjs.map +1 -1
- package/dist/harmony127.mjs +20 -87
- package/dist/harmony127.mjs.map +1 -1
- package/dist/harmony128.cjs +10 -31
- package/dist/harmony128.cjs.map +1 -1
- package/dist/harmony128.mjs +9 -30
- package/dist/harmony128.mjs.map +1 -1
- package/dist/harmony129.cjs +11 -98
- package/dist/harmony129.cjs.map +1 -1
- package/dist/harmony129.mjs +11 -81
- package/dist/harmony129.mjs.map +1 -1
- package/dist/harmony130.cjs +15 -9
- package/dist/harmony130.cjs.map +1 -1
- package/dist/harmony130.mjs +14 -8
- package/dist/harmony130.mjs.map +1 -1
- package/dist/harmony131.cjs +13 -6
- package/dist/harmony131.cjs.map +1 -1
- package/dist/harmony131.mjs +15 -8
- package/dist/harmony131.mjs.map +1 -1
- package/dist/harmony132.cjs +7 -12
- package/dist/harmony132.cjs.map +1 -1
- package/dist/harmony132.mjs +9 -14
- package/dist/harmony132.mjs.map +1 -1
- package/dist/harmony133.cjs +20 -13
- package/dist/harmony133.cjs.map +1 -1
- package/dist/harmony133.mjs +22 -15
- package/dist/harmony133.mjs.map +1 -1
- package/dist/harmony134.cjs +9 -7
- package/dist/harmony134.cjs.map +1 -1
- package/dist/harmony134.mjs +11 -9
- package/dist/harmony134.mjs.map +1 -1
- package/dist/harmony135.cjs +30 -18
- package/dist/harmony135.cjs.map +1 -1
- package/dist/harmony135.mjs +32 -20
- package/dist/harmony135.mjs.map +1 -1
- package/dist/harmony136.cjs +6 -6
- package/dist/harmony136.cjs.map +1 -1
- package/dist/harmony136.mjs +6 -6
- package/dist/harmony136.mjs.map +1 -1
- package/dist/harmony137.cjs +13 -29
- package/dist/harmony137.cjs.map +1 -1
- package/dist/harmony137.mjs +14 -30
- package/dist/harmony137.mjs.map +1 -1
- package/dist/harmony138.cjs +31 -7
- package/dist/harmony138.cjs.map +1 -1
- package/dist/harmony138.mjs +32 -8
- package/dist/harmony138.mjs.map +1 -1
- package/dist/harmony139.cjs +21 -22
- package/dist/harmony139.cjs.map +1 -1
- package/dist/harmony139.mjs +20 -21
- package/dist/harmony139.mjs.map +1 -1
- package/dist/harmony140.cjs +15 -30
- package/dist/harmony140.cjs.map +1 -1
- package/dist/harmony140.mjs +17 -32
- package/dist/harmony140.mjs.map +1 -1
- package/dist/harmony141.cjs +3 -18
- package/dist/harmony141.cjs.map +1 -1
- package/dist/harmony141.mjs +3 -18
- package/dist/harmony141.mjs.map +1 -1
- package/dist/harmony142.cjs +15 -21
- package/dist/harmony142.cjs.map +1 -1
- package/dist/harmony142.mjs +14 -20
- package/dist/harmony142.mjs.map +1 -1
- package/dist/harmony143.cjs +87 -6
- package/dist/harmony143.cjs.map +1 -1
- package/dist/harmony143.mjs +86 -5
- package/dist/harmony143.mjs.map +1 -1
- package/dist/harmony144.cjs +31 -16
- package/dist/harmony144.cjs.map +1 -1
- package/dist/harmony144.mjs +30 -15
- package/dist/harmony144.mjs.map +1 -1
- package/dist/harmony145.cjs +6 -4
- package/dist/harmony145.cjs.map +1 -1
- package/dist/harmony145.mjs +5 -3
- package/dist/harmony145.mjs.map +1 -1
- package/dist/harmony146.cjs +6 -4
- package/dist/harmony146.cjs.map +1 -1
- package/dist/harmony146.mjs +5 -3
- package/dist/harmony146.mjs.map +1 -1
- package/dist/harmony147.cjs +3 -3
- package/dist/harmony147.cjs.map +1 -1
- package/dist/harmony147.mjs +3 -3
- package/dist/harmony147.mjs.map +1 -1
- package/dist/harmony148.cjs +3 -14
- package/dist/harmony148.cjs.map +1 -1
- package/dist/harmony148.mjs +3 -14
- package/dist/harmony148.mjs.map +1 -1
- package/dist/harmony149.cjs +3 -14
- package/dist/harmony149.cjs.map +1 -1
- package/dist/harmony149.mjs +3 -14
- package/dist/harmony149.mjs.map +1 -1
- package/dist/harmony150.cjs +14 -3
- package/dist/harmony150.cjs.map +1 -1
- package/dist/harmony150.mjs +14 -3
- package/dist/harmony150.mjs.map +1 -1
- package/dist/harmony151.cjs +15 -6
- package/dist/harmony151.cjs.map +1 -1
- package/dist/harmony151.mjs +14 -5
- package/dist/harmony151.mjs.map +1 -1
- package/dist/harmony152.cjs +4 -6
- package/dist/harmony152.cjs.map +1 -1
- package/dist/harmony152.mjs +3 -5
- package/dist/harmony152.mjs.map +1 -1
- package/dist/harmony153.cjs +96 -10
- package/dist/harmony153.cjs.map +1 -1
- package/dist/harmony153.mjs +96 -10
- package/dist/harmony153.mjs.map +1 -1
- package/dist/harmony154.cjs +14 -10
- package/dist/harmony154.cjs.map +1 -1
- package/dist/harmony154.mjs +13 -9
- package/dist/harmony154.mjs.map +1 -1
- package/dist/harmony155.cjs +15 -7
- package/dist/harmony155.cjs.map +1 -1
- package/dist/harmony155.mjs +14 -6
- package/dist/harmony155.mjs.map +1 -1
- package/dist/harmony156.cjs +37 -10
- package/dist/harmony156.cjs.map +1 -1
- package/dist/harmony156.mjs +36 -9
- package/dist/harmony156.mjs.map +1 -1
- package/dist/harmony157.cjs +29 -25
- package/dist/harmony157.cjs.map +1 -1
- package/dist/harmony157.mjs +28 -24
- package/dist/harmony157.mjs.map +1 -1
- package/dist/harmony158.cjs +6 -3
- package/dist/harmony158.cjs.map +1 -1
- package/dist/harmony158.mjs +6 -3
- package/dist/harmony158.mjs.map +1 -1
- package/dist/harmony159.cjs +3 -9
- package/dist/harmony159.cjs.map +1 -1
- package/dist/harmony159.mjs +3 -9
- package/dist/harmony159.mjs.map +1 -1
- package/dist/harmony160.cjs +6 -3
- package/dist/harmony160.cjs.map +1 -1
- package/dist/harmony160.mjs +6 -3
- package/dist/harmony160.mjs.map +1 -1
- package/dist/harmony161.cjs +24 -32
- package/dist/harmony161.cjs.map +1 -1
- package/dist/harmony161.mjs +23 -31
- package/dist/harmony161.mjs.map +1 -1
- package/dist/harmony162.cjs +7 -97
- package/dist/harmony162.cjs.map +1 -1
- package/dist/harmony162.mjs +6 -96
- package/dist/harmony162.mjs.map +1 -1
- package/dist/harmony163.cjs +13 -14
- package/dist/harmony163.cjs.map +1 -1
- package/dist/harmony163.mjs +12 -13
- package/dist/harmony163.mjs.map +1 -1
- package/dist/harmony164.cjs +7 -15
- package/dist/harmony164.cjs.map +1 -1
- package/dist/harmony164.mjs +6 -14
- package/dist/harmony164.mjs.map +1 -1
- package/dist/harmony165.cjs +10 -36
- package/dist/harmony165.cjs.map +1 -1
- package/dist/harmony165.mjs +10 -36
- package/dist/harmony165.mjs.map +1 -1
- package/dist/harmony166.cjs +31 -27
- package/dist/harmony166.cjs.map +1 -1
- package/dist/harmony166.mjs +31 -27
- package/dist/harmony166.mjs.map +1 -1
- package/dist/harmony167.cjs +1 -1
- package/dist/harmony167.mjs +1 -1
- package/dist/harmony168.cjs +1 -1
- package/dist/harmony168.mjs +1 -1
- package/dist/harmony169.cjs +2 -2
- package/dist/harmony169.mjs +2 -2
- package/dist/harmony17.cjs +1 -1
- package/dist/harmony17.mjs +1 -1
- package/dist/harmony170.cjs +11 -4
- package/dist/harmony170.cjs.map +1 -1
- package/dist/harmony170.mjs +11 -4
- package/dist/harmony170.mjs.map +1 -1
- package/dist/harmony171.cjs +15 -10
- package/dist/harmony171.cjs.map +1 -1
- package/dist/harmony171.mjs +15 -10
- package/dist/harmony171.mjs.map +1 -1
- package/dist/harmony172.cjs +18 -13
- package/dist/harmony172.cjs.map +1 -1
- package/dist/harmony172.mjs +18 -13
- package/dist/harmony172.mjs.map +1 -1
- package/dist/harmony173.cjs +10 -19
- package/dist/harmony173.cjs.map +1 -1
- package/dist/harmony173.mjs +10 -19
- package/dist/harmony173.mjs.map +1 -1
- package/dist/harmony174.cjs +4 -12
- package/dist/harmony174.cjs.map +1 -1
- package/dist/harmony174.mjs +4 -12
- package/dist/harmony174.mjs.map +1 -1
- package/dist/harmony20.cjs +1 -1
- package/dist/harmony20.mjs +1 -1
- package/dist/harmony28.cjs +1 -1
- package/dist/harmony28.mjs +1 -1
- package/dist/harmony29.cjs +1 -1
- package/dist/harmony29.mjs +1 -1
- package/dist/harmony32.cjs +1 -1
- package/dist/harmony32.mjs +1 -1
- package/dist/harmony33.cjs +1 -1
- package/dist/harmony33.mjs +1 -1
- package/dist/harmony34.cjs +1 -1
- package/dist/harmony34.mjs +1 -1
- package/dist/harmony39.cjs +1 -1
- package/dist/harmony39.mjs +1 -1
- package/dist/harmony40.cjs +1 -1
- package/dist/harmony40.mjs +1 -1
- package/dist/harmony41.cjs +1 -1
- package/dist/harmony41.mjs +1 -1
- package/dist/harmony42.cjs +2 -2
- package/dist/harmony42.mjs +2 -2
- package/dist/harmony43.cjs +2 -2
- package/dist/harmony43.mjs +2 -2
- package/dist/harmony44.cjs +1 -1
- package/dist/harmony44.mjs +1 -1
- package/dist/harmony45.cjs +2 -0
- package/dist/harmony45.cjs.map +1 -1
- package/dist/harmony45.mjs +2 -0
- package/dist/harmony45.mjs.map +1 -1
- package/dist/harmony81.cjs +5 -20
- package/dist/harmony81.cjs.map +1 -1
- package/dist/harmony81.mjs +5 -20
- package/dist/harmony81.mjs.map +1 -1
- package/dist/harmony82.cjs +5 -1
- package/dist/harmony82.cjs.map +1 -1
- package/dist/harmony82.mjs +5 -1
- package/dist/harmony82.mjs.map +1 -1
- package/dist/harmony88.cjs +2 -1
- package/dist/harmony88.cjs.map +1 -1
- package/dist/harmony88.mjs +3 -2
- package/dist/harmony88.mjs.map +1 -1
- package/dist/harmony94.cjs +1 -1
- package/dist/harmony94.mjs +1 -1
- package/dist/harmony96.cjs +2 -2
- package/dist/harmony96.mjs +2 -2
- package/dist/harmony98.cjs +2 -2
- package/dist/harmony98.mjs +2 -2
- package/dist/types/src/features/permissions/types.d.ts +5 -1
- package/dist/types/src/features/publicApi/permissionTemplates.d.ts +5 -5
- package/dist/types/src/features/publicApi/projects.d.ts +15 -15
- package/dist/types/src/features/publicApi/teamUsers.d.ts +5 -5
- package/dist/types/src/features/publicApi/types/permissionTemplateTypes.d.ts +9 -10
- package/dist/types/src/features/publicApi/types/permissionTypes.d.ts +4 -4
- package/dist/types/src/features/publicApi/types/projectTypes.d.ts +24 -24
- package/dist/types/src/features/publicApi/types/teamUserTypes.d.ts +8 -8
- package/package.json +1 -1
package/dist/harmony143.cjs
CHANGED
|
@@ -1,9 +1,90 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const permissions = require("./harmony165.cjs");
|
|
4
|
+
const getProjectNavigationVisibilityMap = (project, adminRights, isFeatureEnabled) => {
|
|
5
|
+
var _a, _b;
|
|
6
|
+
return {
|
|
7
|
+
upload: {
|
|
8
|
+
visible: permissions.hasAdminRight(adminRights, "upload"),
|
|
9
|
+
disabled: false
|
|
10
|
+
},
|
|
11
|
+
download: {
|
|
12
|
+
visible: permissions.hasAdminRight(adminRights, "download"),
|
|
13
|
+
disabled: false
|
|
14
|
+
},
|
|
15
|
+
// TODO: HOME-1009, Clean up after permission management
|
|
16
|
+
// -- There is a plan for "Install apps" permission. Right..?
|
|
17
|
+
apps: {
|
|
18
|
+
visible: true,
|
|
19
|
+
disabled: false
|
|
20
|
+
},
|
|
21
|
+
// TODO: HOME-1009, Clean up after permission management
|
|
22
|
+
// -- There is a plan for "Install apps" permission. Right..?
|
|
23
|
+
contentManagement: {
|
|
24
|
+
visible: project.project_type === "content_integration" && permissions.hasAdminRight(adminRights, "keys"),
|
|
25
|
+
disabled: false
|
|
26
|
+
},
|
|
27
|
+
editor: {
|
|
28
|
+
visible: true,
|
|
29
|
+
disabled: false
|
|
30
|
+
},
|
|
31
|
+
files: {
|
|
32
|
+
visible: isFeatureEnabled("lionLfcFilesManagement") && project.project_type === "paged_documents" && permissions.hasAnyAdminRight(adminRights, ["upload", "download"]),
|
|
33
|
+
disabled: false
|
|
34
|
+
},
|
|
35
|
+
tasks: {
|
|
36
|
+
visible: permissions.hasAdminRight(adminRights, "tasks"),
|
|
37
|
+
disabled: false
|
|
38
|
+
},
|
|
39
|
+
contributors: {
|
|
40
|
+
visible: permissions.hasAdminRight(adminRights, "contributors"),
|
|
41
|
+
disabled: false
|
|
42
|
+
},
|
|
43
|
+
workflows: {
|
|
44
|
+
visible: permissions.hasAdminRight(adminRights, "settings"),
|
|
45
|
+
disabled: false
|
|
46
|
+
},
|
|
47
|
+
screenshots: {
|
|
48
|
+
visible: permissions.hasAdminRight(adminRights, "screenshots"),
|
|
49
|
+
disabled: false
|
|
50
|
+
},
|
|
51
|
+
glossary: {
|
|
52
|
+
visible: permissions.hasAdminRight(adminRights, "glossary"),
|
|
53
|
+
disabled: false
|
|
54
|
+
},
|
|
55
|
+
more: {
|
|
56
|
+
visible: true,
|
|
57
|
+
disabled: false
|
|
58
|
+
},
|
|
59
|
+
settings: {
|
|
60
|
+
visible: permissions.hasAdminRight(adminRights, "settings"),
|
|
61
|
+
disabled: false
|
|
62
|
+
},
|
|
63
|
+
branches: {
|
|
64
|
+
visible: !!((_a = project.settings) == null ? void 0 : _a.branching) && permissions.hasAnyAdminRight(adminRights, ["branches_create", "create_branches", "branches_merge"]),
|
|
65
|
+
disabled: false
|
|
66
|
+
},
|
|
67
|
+
otaBundles: {
|
|
68
|
+
visible: permissions.hasAnyAdminRight(adminRights, ["download", "settings", "keys"]) && project.project_type === "localization_files",
|
|
69
|
+
disabled: false
|
|
70
|
+
},
|
|
71
|
+
automations: {
|
|
72
|
+
visible: permissions.hasAdminRight(adminRights, "settings"),
|
|
73
|
+
disabled: false
|
|
74
|
+
},
|
|
75
|
+
duplicateFinder: {
|
|
76
|
+
visible: permissions.hasAdminRight(adminRights, "keys") && project.project_type === "localization_files",
|
|
77
|
+
disabled: false
|
|
78
|
+
},
|
|
79
|
+
activity: {
|
|
80
|
+
visible: !!((_b = project.settings) == null ? void 0 : _b.offline_translation) || permissions.hasAdminRight(adminRights, "activity"),
|
|
81
|
+
disabled: false
|
|
82
|
+
},
|
|
83
|
+
statistics: {
|
|
84
|
+
visible: permissions.hasAdminRight(adminRights, "statistics"),
|
|
85
|
+
disabled: false
|
|
86
|
+
}
|
|
87
|
+
};
|
|
6
88
|
};
|
|
7
|
-
exports.
|
|
8
|
-
exports.logoLink = logoLink;
|
|
89
|
+
exports.getProjectNavigationVisibilityMap = getProjectNavigationVisibilityMap;
|
|
9
90
|
//# sourceMappingURL=harmony143.cjs.map
|
package/dist/harmony143.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"harmony143.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"harmony143.cjs","sources":["../src/features/navigation/utils/toolbarVisibility.ts"],"sourcesContent":["import { hasAdminRight, hasAnyAdminRight } from '@features/auth/utils/permissions'\nimport type { Project } from '@features/node'\n\ntype ToolbarVisibility = {\n\tdisabled: boolean\n\tvisible: boolean\n}\n\nexport type ToolbarVisibilityMap = {\n\tupload: ToolbarVisibility\n\tdownload: ToolbarVisibility\n\tapps: ToolbarVisibility\n\tcontentManagement: ToolbarVisibility\n\teditor: ToolbarVisibility\n\tfiles: ToolbarVisibility\n\ttasks: ToolbarVisibility\n\tworkflows: ToolbarVisibility\n\tcontributors: ToolbarVisibility\n\tscreenshots: ToolbarVisibility\n\tglossary: ToolbarVisibility\n\tmore: ToolbarVisibility\n\tsettings: ToolbarVisibility\n\tbranches: ToolbarVisibility\n\totaBundles: ToolbarVisibility\n\tautomations: ToolbarVisibility\n\tduplicateFinder: ToolbarVisibility\n\tactivity: ToolbarVisibility\n\tstatistics: ToolbarVisibility\n}\n\nexport const getProjectNavigationVisibilityMap = (\n\tproject: Project,\n\tadminRights: string[],\n\tisFeatureEnabled: (key: string) => boolean,\n): ToolbarVisibilityMap => ({\n\tupload: {\n\t\tvisible: hasAdminRight(adminRights, 'upload'),\n\t\tdisabled: false,\n\t},\n\tdownload: {\n\t\tvisible: hasAdminRight(adminRights, 'download'),\n\t\tdisabled: false,\n\t},\n\t// TODO: HOME-1009, Clean up after permission management\n\t// -- There is a plan for \"Install apps\" permission. Right..?\n\tapps: {\n\t\tvisible: true,\n\t\tdisabled: false,\n\t},\n\t// TODO: HOME-1009, Clean up after permission management\n\t// -- There is a plan for \"Install apps\" permission. Right..?\n\tcontentManagement: {\n\t\tvisible: project.project_type === 'content_integration' && hasAdminRight(adminRights, 'keys'),\n\t\tdisabled: false,\n\t},\n\teditor: {\n\t\tvisible: true,\n\t\tdisabled: false,\n\t},\n\tfiles: {\n\t\tvisible:\n\t\t\tisFeatureEnabled('lionLfcFilesManagement') &&\n\t\t\tproject.project_type === 'paged_documents' &&\n\t\t\thasAnyAdminRight(adminRights, ['upload', 'download']),\n\t\tdisabled: false,\n\t},\n\ttasks: {\n\t\tvisible: hasAdminRight(adminRights, 'tasks'),\n\t\tdisabled: false,\n\t},\n\tcontributors: {\n\t\tvisible: hasAdminRight(adminRights, 'contributors'),\n\t\tdisabled: false,\n\t},\n\tworkflows: {\n\t\tvisible: hasAdminRight(adminRights, 'settings'),\n\t\tdisabled: false,\n\t},\n\tscreenshots: {\n\t\tvisible: hasAdminRight(adminRights, 'screenshots'),\n\t\tdisabled: false,\n\t},\n\tglossary: {\n\t\tvisible: hasAdminRight(adminRights, 'glossary'),\n\t\tdisabled: false,\n\t},\n\tmore: {\n\t\tvisible: true,\n\t\tdisabled: false,\n\t},\n\tsettings: {\n\t\tvisible: hasAdminRight(adminRights, 'settings'),\n\t\tdisabled: false,\n\t},\n\tbranches: {\n\t\tvisible:\n\t\t\t!!project.settings?.branching &&\n\t\t\thasAnyAdminRight(adminRights, ['branches_create', 'create_branches', 'branches_merge']),\n\t\tdisabled: false,\n\t},\n\totaBundles: {\n\t\tvisible:\n\t\t\thasAnyAdminRight(adminRights, ['download', 'settings', 'keys']) &&\n\t\t\tproject.project_type === 'localization_files',\n\t\tdisabled: false,\n\t},\n\tautomations: {\n\t\tvisible: hasAdminRight(adminRights, 'settings'),\n\t\tdisabled: false,\n\t},\n\tduplicateFinder: {\n\t\tvisible: hasAdminRight(adminRights, 'keys') && project.project_type === 'localization_files',\n\t\tdisabled: false,\n\t},\n\tactivity: {\n\t\tvisible: !!project.settings?.offline_translation || hasAdminRight(adminRights, 'activity'),\n\t\tdisabled: false,\n\t},\n\tstatistics: {\n\t\tvisible: hasAdminRight(adminRights, 'statistics'),\n\t\tdisabled: false,\n\t},\n})\n"],"names":["hasAdminRight","hasAnyAdminRight"],"mappings":";;;AA8BO,MAAM,oCAAoC,CAChD,SACA,aACA,qBAC2B;;AAAA;AAAA,IAC3B,QAAQ;AAAA,MACP,SAASA,YAAAA,cAAc,aAAa,QAAQ;AAAA,MAC5C,UAAU;AAAA,IACX;AAAA,IACA,UAAU;AAAA,MACT,SAASA,YAAAA,cAAc,aAAa,UAAU;AAAA,MAC9C,UAAU;AAAA,IACX;AAAA;AAAA;AAAA,IAGA,MAAM;AAAA,MACL,SAAS;AAAA,MACT,UAAU;AAAA,IACX;AAAA;AAAA;AAAA,IAGA,mBAAmB;AAAA,MAClB,SAAS,QAAQ,iBAAiB,yBAAyBA,YAAA,cAAc,aAAa,MAAM;AAAA,MAC5F,UAAU;AAAA,IACX;AAAA,IACA,QAAQ;AAAA,MACP,SAAS;AAAA,MACT,UAAU;AAAA,IACX;AAAA,IACA,OAAO;AAAA,MACN,SACC,iBAAiB,wBAAwB,KACzC,QAAQ,iBAAiB,qBACzBC,YAAAA,iBAAiB,aAAa,CAAC,UAAU,UAAU,CAAC;AAAA,MACrD,UAAU;AAAA,IACX;AAAA,IACA,OAAO;AAAA,MACN,SAASD,YAAAA,cAAc,aAAa,OAAO;AAAA,MAC3C,UAAU;AAAA,IACX;AAAA,IACA,cAAc;AAAA,MACb,SAASA,YAAAA,cAAc,aAAa,cAAc;AAAA,MAClD,UAAU;AAAA,IACX;AAAA,IACA,WAAW;AAAA,MACV,SAASA,YAAAA,cAAc,aAAa,UAAU;AAAA,MAC9C,UAAU;AAAA,IACX;AAAA,IACA,aAAa;AAAA,MACZ,SAASA,YAAAA,cAAc,aAAa,aAAa;AAAA,MACjD,UAAU;AAAA,IACX;AAAA,IACA,UAAU;AAAA,MACT,SAASA,YAAAA,cAAc,aAAa,UAAU;AAAA,MAC9C,UAAU;AAAA,IACX;AAAA,IACA,MAAM;AAAA,MACL,SAAS;AAAA,MACT,UAAU;AAAA,IACX;AAAA,IACA,UAAU;AAAA,MACT,SAASA,YAAAA,cAAc,aAAa,UAAU;AAAA,MAC9C,UAAU;AAAA,IACX;AAAA,IACA,UAAU;AAAA,MACT,SACC,CAAC,GAAC,aAAQ,aAAR,mBAAkB,cACpBC,6BAAiB,aAAa,CAAC,mBAAmB,mBAAmB,gBAAgB,CAAC;AAAA,MACvF,UAAU;AAAA,IACX;AAAA,IACA,YAAY;AAAA,MACX,SACCA,YAAAA,iBAAiB,aAAa,CAAC,YAAY,YAAY,MAAM,CAAC,KAC9D,QAAQ,iBAAiB;AAAA,MAC1B,UAAU;AAAA,IACX;AAAA,IACA,aAAa;AAAA,MACZ,SAASD,YAAAA,cAAc,aAAa,UAAU;AAAA,MAC9C,UAAU;AAAA,IACX;AAAA,IACA,iBAAiB;AAAA,MAChB,SAASA,YAAc,cAAA,aAAa,MAAM,KAAK,QAAQ,iBAAiB;AAAA,MACxE,UAAU;AAAA,IACX;AAAA,IACA,UAAU;AAAA,MACT,SAAS,CAAC,GAAC,aAAQ,aAAR,mBAAkB,wBAAuBA,YAAA,cAAc,aAAa,UAAU;AAAA,MACzF,UAAU;AAAA,IACX;AAAA,IACA,YAAY;AAAA,MACX,SAASA,YAAAA,cAAc,aAAa,YAAY;AAAA,MAChD,UAAU;AAAA,IAAA;AAAA,EAEZ;AAAA;;"}
|
package/dist/harmony143.mjs
CHANGED
|
@@ -1,9 +1,90 @@
|
|
|
1
|
-
|
|
2
|
-
const
|
|
3
|
-
|
|
1
|
+
import { hasAdminRight, hasAnyAdminRight } from "./harmony165.mjs";
|
|
2
|
+
const getProjectNavigationVisibilityMap = (project, adminRights, isFeatureEnabled) => {
|
|
3
|
+
var _a, _b;
|
|
4
|
+
return {
|
|
5
|
+
upload: {
|
|
6
|
+
visible: hasAdminRight(adminRights, "upload"),
|
|
7
|
+
disabled: false
|
|
8
|
+
},
|
|
9
|
+
download: {
|
|
10
|
+
visible: hasAdminRight(adminRights, "download"),
|
|
11
|
+
disabled: false
|
|
12
|
+
},
|
|
13
|
+
// TODO: HOME-1009, Clean up after permission management
|
|
14
|
+
// -- There is a plan for "Install apps" permission. Right..?
|
|
15
|
+
apps: {
|
|
16
|
+
visible: true,
|
|
17
|
+
disabled: false
|
|
18
|
+
},
|
|
19
|
+
// TODO: HOME-1009, Clean up after permission management
|
|
20
|
+
// -- There is a plan for "Install apps" permission. Right..?
|
|
21
|
+
contentManagement: {
|
|
22
|
+
visible: project.project_type === "content_integration" && hasAdminRight(adminRights, "keys"),
|
|
23
|
+
disabled: false
|
|
24
|
+
},
|
|
25
|
+
editor: {
|
|
26
|
+
visible: true,
|
|
27
|
+
disabled: false
|
|
28
|
+
},
|
|
29
|
+
files: {
|
|
30
|
+
visible: isFeatureEnabled("lionLfcFilesManagement") && project.project_type === "paged_documents" && hasAnyAdminRight(adminRights, ["upload", "download"]),
|
|
31
|
+
disabled: false
|
|
32
|
+
},
|
|
33
|
+
tasks: {
|
|
34
|
+
visible: hasAdminRight(adminRights, "tasks"),
|
|
35
|
+
disabled: false
|
|
36
|
+
},
|
|
37
|
+
contributors: {
|
|
38
|
+
visible: hasAdminRight(adminRights, "contributors"),
|
|
39
|
+
disabled: false
|
|
40
|
+
},
|
|
41
|
+
workflows: {
|
|
42
|
+
visible: hasAdminRight(adminRights, "settings"),
|
|
43
|
+
disabled: false
|
|
44
|
+
},
|
|
45
|
+
screenshots: {
|
|
46
|
+
visible: hasAdminRight(adminRights, "screenshots"),
|
|
47
|
+
disabled: false
|
|
48
|
+
},
|
|
49
|
+
glossary: {
|
|
50
|
+
visible: hasAdminRight(adminRights, "glossary"),
|
|
51
|
+
disabled: false
|
|
52
|
+
},
|
|
53
|
+
more: {
|
|
54
|
+
visible: true,
|
|
55
|
+
disabled: false
|
|
56
|
+
},
|
|
57
|
+
settings: {
|
|
58
|
+
visible: hasAdminRight(adminRights, "settings"),
|
|
59
|
+
disabled: false
|
|
60
|
+
},
|
|
61
|
+
branches: {
|
|
62
|
+
visible: !!((_a = project.settings) == null ? void 0 : _a.branching) && hasAnyAdminRight(adminRights, ["branches_create", "create_branches", "branches_merge"]),
|
|
63
|
+
disabled: false
|
|
64
|
+
},
|
|
65
|
+
otaBundles: {
|
|
66
|
+
visible: hasAnyAdminRight(adminRights, ["download", "settings", "keys"]) && project.project_type === "localization_files",
|
|
67
|
+
disabled: false
|
|
68
|
+
},
|
|
69
|
+
automations: {
|
|
70
|
+
visible: hasAdminRight(adminRights, "settings"),
|
|
71
|
+
disabled: false
|
|
72
|
+
},
|
|
73
|
+
duplicateFinder: {
|
|
74
|
+
visible: hasAdminRight(adminRights, "keys") && project.project_type === "localization_files",
|
|
75
|
+
disabled: false
|
|
76
|
+
},
|
|
77
|
+
activity: {
|
|
78
|
+
visible: !!((_b = project.settings) == null ? void 0 : _b.offline_translation) || hasAdminRight(adminRights, "activity"),
|
|
79
|
+
disabled: false
|
|
80
|
+
},
|
|
81
|
+
statistics: {
|
|
82
|
+
visible: hasAdminRight(adminRights, "statistics"),
|
|
83
|
+
disabled: false
|
|
84
|
+
}
|
|
85
|
+
};
|
|
4
86
|
};
|
|
5
87
|
export {
|
|
6
|
-
|
|
7
|
-
logoLink
|
|
88
|
+
getProjectNavigationVisibilityMap
|
|
8
89
|
};
|
|
9
90
|
//# sourceMappingURL=harmony143.mjs.map
|
package/dist/harmony143.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"harmony143.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"harmony143.mjs","sources":["../src/features/navigation/utils/toolbarVisibility.ts"],"sourcesContent":["import { hasAdminRight, hasAnyAdminRight } from '@features/auth/utils/permissions'\nimport type { Project } from '@features/node'\n\ntype ToolbarVisibility = {\n\tdisabled: boolean\n\tvisible: boolean\n}\n\nexport type ToolbarVisibilityMap = {\n\tupload: ToolbarVisibility\n\tdownload: ToolbarVisibility\n\tapps: ToolbarVisibility\n\tcontentManagement: ToolbarVisibility\n\teditor: ToolbarVisibility\n\tfiles: ToolbarVisibility\n\ttasks: ToolbarVisibility\n\tworkflows: ToolbarVisibility\n\tcontributors: ToolbarVisibility\n\tscreenshots: ToolbarVisibility\n\tglossary: ToolbarVisibility\n\tmore: ToolbarVisibility\n\tsettings: ToolbarVisibility\n\tbranches: ToolbarVisibility\n\totaBundles: ToolbarVisibility\n\tautomations: ToolbarVisibility\n\tduplicateFinder: ToolbarVisibility\n\tactivity: ToolbarVisibility\n\tstatistics: ToolbarVisibility\n}\n\nexport const getProjectNavigationVisibilityMap = (\n\tproject: Project,\n\tadminRights: string[],\n\tisFeatureEnabled: (key: string) => boolean,\n): ToolbarVisibilityMap => ({\n\tupload: {\n\t\tvisible: hasAdminRight(adminRights, 'upload'),\n\t\tdisabled: false,\n\t},\n\tdownload: {\n\t\tvisible: hasAdminRight(adminRights, 'download'),\n\t\tdisabled: false,\n\t},\n\t// TODO: HOME-1009, Clean up after permission management\n\t// -- There is a plan for \"Install apps\" permission. Right..?\n\tapps: {\n\t\tvisible: true,\n\t\tdisabled: false,\n\t},\n\t// TODO: HOME-1009, Clean up after permission management\n\t// -- There is a plan for \"Install apps\" permission. Right..?\n\tcontentManagement: {\n\t\tvisible: project.project_type === 'content_integration' && hasAdminRight(adminRights, 'keys'),\n\t\tdisabled: false,\n\t},\n\teditor: {\n\t\tvisible: true,\n\t\tdisabled: false,\n\t},\n\tfiles: {\n\t\tvisible:\n\t\t\tisFeatureEnabled('lionLfcFilesManagement') &&\n\t\t\tproject.project_type === 'paged_documents' &&\n\t\t\thasAnyAdminRight(adminRights, ['upload', 'download']),\n\t\tdisabled: false,\n\t},\n\ttasks: {\n\t\tvisible: hasAdminRight(adminRights, 'tasks'),\n\t\tdisabled: false,\n\t},\n\tcontributors: {\n\t\tvisible: hasAdminRight(adminRights, 'contributors'),\n\t\tdisabled: false,\n\t},\n\tworkflows: {\n\t\tvisible: hasAdminRight(adminRights, 'settings'),\n\t\tdisabled: false,\n\t},\n\tscreenshots: {\n\t\tvisible: hasAdminRight(adminRights, 'screenshots'),\n\t\tdisabled: false,\n\t},\n\tglossary: {\n\t\tvisible: hasAdminRight(adminRights, 'glossary'),\n\t\tdisabled: false,\n\t},\n\tmore: {\n\t\tvisible: true,\n\t\tdisabled: false,\n\t},\n\tsettings: {\n\t\tvisible: hasAdminRight(adminRights, 'settings'),\n\t\tdisabled: false,\n\t},\n\tbranches: {\n\t\tvisible:\n\t\t\t!!project.settings?.branching &&\n\t\t\thasAnyAdminRight(adminRights, ['branches_create', 'create_branches', 'branches_merge']),\n\t\tdisabled: false,\n\t},\n\totaBundles: {\n\t\tvisible:\n\t\t\thasAnyAdminRight(adminRights, ['download', 'settings', 'keys']) &&\n\t\t\tproject.project_type === 'localization_files',\n\t\tdisabled: false,\n\t},\n\tautomations: {\n\t\tvisible: hasAdminRight(adminRights, 'settings'),\n\t\tdisabled: false,\n\t},\n\tduplicateFinder: {\n\t\tvisible: hasAdminRight(adminRights, 'keys') && project.project_type === 'localization_files',\n\t\tdisabled: false,\n\t},\n\tactivity: {\n\t\tvisible: !!project.settings?.offline_translation || hasAdminRight(adminRights, 'activity'),\n\t\tdisabled: false,\n\t},\n\tstatistics: {\n\t\tvisible: hasAdminRight(adminRights, 'statistics'),\n\t\tdisabled: false,\n\t},\n})\n"],"names":[],"mappings":";AA8BO,MAAM,oCAAoC,CAChD,SACA,aACA,qBAC2B;;AAAA;AAAA,IAC3B,QAAQ;AAAA,MACP,SAAS,cAAc,aAAa,QAAQ;AAAA,MAC5C,UAAU;AAAA,IACX;AAAA,IACA,UAAU;AAAA,MACT,SAAS,cAAc,aAAa,UAAU;AAAA,MAC9C,UAAU;AAAA,IACX;AAAA;AAAA;AAAA,IAGA,MAAM;AAAA,MACL,SAAS;AAAA,MACT,UAAU;AAAA,IACX;AAAA;AAAA;AAAA,IAGA,mBAAmB;AAAA,MAClB,SAAS,QAAQ,iBAAiB,yBAAyB,cAAc,aAAa,MAAM;AAAA,MAC5F,UAAU;AAAA,IACX;AAAA,IACA,QAAQ;AAAA,MACP,SAAS;AAAA,MACT,UAAU;AAAA,IACX;AAAA,IACA,OAAO;AAAA,MACN,SACC,iBAAiB,wBAAwB,KACzC,QAAQ,iBAAiB,qBACzB,iBAAiB,aAAa,CAAC,UAAU,UAAU,CAAC;AAAA,MACrD,UAAU;AAAA,IACX;AAAA,IACA,OAAO;AAAA,MACN,SAAS,cAAc,aAAa,OAAO;AAAA,MAC3C,UAAU;AAAA,IACX;AAAA,IACA,cAAc;AAAA,MACb,SAAS,cAAc,aAAa,cAAc;AAAA,MAClD,UAAU;AAAA,IACX;AAAA,IACA,WAAW;AAAA,MACV,SAAS,cAAc,aAAa,UAAU;AAAA,MAC9C,UAAU;AAAA,IACX;AAAA,IACA,aAAa;AAAA,MACZ,SAAS,cAAc,aAAa,aAAa;AAAA,MACjD,UAAU;AAAA,IACX;AAAA,IACA,UAAU;AAAA,MACT,SAAS,cAAc,aAAa,UAAU;AAAA,MAC9C,UAAU;AAAA,IACX;AAAA,IACA,MAAM;AAAA,MACL,SAAS;AAAA,MACT,UAAU;AAAA,IACX;AAAA,IACA,UAAU;AAAA,MACT,SAAS,cAAc,aAAa,UAAU;AAAA,MAC9C,UAAU;AAAA,IACX;AAAA,IACA,UAAU;AAAA,MACT,SACC,CAAC,GAAC,aAAQ,aAAR,mBAAkB,cACpB,iBAAiB,aAAa,CAAC,mBAAmB,mBAAmB,gBAAgB,CAAC;AAAA,MACvF,UAAU;AAAA,IACX;AAAA,IACA,YAAY;AAAA,MACX,SACC,iBAAiB,aAAa,CAAC,YAAY,YAAY,MAAM,CAAC,KAC9D,QAAQ,iBAAiB;AAAA,MAC1B,UAAU;AAAA,IACX;AAAA,IACA,aAAa;AAAA,MACZ,SAAS,cAAc,aAAa,UAAU;AAAA,MAC9C,UAAU;AAAA,IACX;AAAA,IACA,iBAAiB;AAAA,MAChB,SAAS,cAAc,aAAa,MAAM,KAAK,QAAQ,iBAAiB;AAAA,MACxE,UAAU;AAAA,IACX;AAAA,IACA,UAAU;AAAA,MACT,SAAS,CAAC,GAAC,aAAQ,aAAR,mBAAkB,wBAAuB,cAAc,aAAa,UAAU;AAAA,MACzF,UAAU;AAAA,IACX;AAAA,IACA,YAAY;AAAA,MACX,SAAS,cAAc,aAAa,YAAY;AAAA,MAChD,UAAU;AAAA,IAAA;AAAA,EAEZ;AAAA;"}
|
package/dist/harmony144.cjs
CHANGED
|
@@ -1,18 +1,33 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const navigationItems = [
|
|
4
|
+
{
|
|
5
|
+
key: "editor",
|
|
6
|
+
labelKey: "Editor",
|
|
7
|
+
path: ({ projectId }) => `/project/${projectId}/editor`
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
key: "dashboard",
|
|
11
|
+
labelKey: "Download",
|
|
12
|
+
path: ({ projectId }) => `/project/${projectId}/dashboard`
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
key: "contributors",
|
|
16
|
+
labelKey: "Contributors",
|
|
17
|
+
path: ({ projectId }) => `/project/${projectId}/contributors`
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
key: "orders",
|
|
21
|
+
labelKey: "Human proofreading",
|
|
22
|
+
path: ({ projectId }) => `/project/${projectId}/orders`,
|
|
23
|
+
shouldShow: ({ flags }) => flags.ap_feature_hraas === "on"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
key: "billing",
|
|
27
|
+
labelKey: "Billing",
|
|
28
|
+
path: ({ projectId }) => `/project/${projectId}/billing`,
|
|
29
|
+
shouldShow: ({ flags }) => flags.ap_feature_billing === "on"
|
|
30
|
+
}
|
|
31
|
+
];
|
|
32
|
+
exports.navigationItems = navigationItems;
|
|
18
33
|
//# sourceMappingURL=harmony144.cjs.map
|
package/dist/harmony144.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"harmony144.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"harmony144.cjs","sources":["../src/features/navigation/schemas/navigationSchema.ts"],"sourcesContent":["import type { DropdownItem, NavItemIcon } from '@features/navigation/types/navigation'\n\nexport type NavKey = 'editor' | 'contributors' | 'orders' | 'billing' | 'settings' | 'dashboard'\n\nexport interface NavigationItem {\n\tkey: NavKey\n\tlabelKey: string // TODO: i18n key inside this package\n\tpath: ({ projectId }: { projectId: string }) => string\n\n\ticon?: NavItemIcon\n\tdropdown?: DropdownItem[][]\n\tbadge?: number | ((ctx: NavCtx) => number)\n\n\tshouldShow?: (ctx: NavCtx) => boolean\n\tdisabled?: boolean | ((ctx: NavCtx) => boolean)\n\tisActive?: (pathname: string) => boolean // custom match, else fallback\n}\n\n/** What the gate functions receive */\nexport interface NavCtx {\n\tflags: Record<string, string>\n\tpathname: string\n\tpermissions?: Array<string> // e.g. contributor admin_rights //TODO: Provide type for permissions\n}\n\n// TODO: Handle Translations on harmony side.\nexport const navigationItems: NavigationItem[] = [\n\t{\n\t\tkey: 'editor',\n\t\tlabelKey: 'Editor',\n\t\tpath: ({ projectId }) => `/project/${projectId}/editor`,\n\t},\n\t{\n\t\tkey: 'dashboard',\n\t\tlabelKey: 'Download',\n\t\tpath: ({ projectId }) => `/project/${projectId}/dashboard`,\n\t},\n\t{\n\t\tkey: 'contributors',\n\t\tlabelKey: 'Contributors',\n\t\tpath: ({ projectId }) => `/project/${projectId}/contributors`,\n\t},\n\n\t{\n\t\tkey: 'orders',\n\t\tlabelKey: 'Human proofreading',\n\t\tpath: ({ projectId }) => `/project/${projectId}/orders`,\n\t\tshouldShow: ({ flags }) => flags.ap_feature_hraas === 'on',\n\t},\n\t{\n\t\tkey: 'billing',\n\t\tlabelKey: 'Billing',\n\t\tpath: ({ projectId }) => `/project/${projectId}/billing`,\n\t\tshouldShow: ({ flags }) => flags.ap_feature_billing === 'on',\n\t},\n]\n"],"names":[],"mappings":";;AA0BO,MAAM,kBAAoC;AAAA,EAChD;AAAA,IACC,KAAK;AAAA,IACL,UAAU;AAAA,IACV,MAAM,CAAC,EAAE,UAAU,MAAM,YAAY,SAAS;AAAA,EAC/C;AAAA,EACA;AAAA,IACC,KAAK;AAAA,IACL,UAAU;AAAA,IACV,MAAM,CAAC,EAAE,UAAU,MAAM,YAAY,SAAS;AAAA,EAC/C;AAAA,EACA;AAAA,IACC,KAAK;AAAA,IACL,UAAU;AAAA,IACV,MAAM,CAAC,EAAE,UAAU,MAAM,YAAY,SAAS;AAAA,EAC/C;AAAA,EAEA;AAAA,IACC,KAAK;AAAA,IACL,UAAU;AAAA,IACV,MAAM,CAAC,EAAE,UAAU,MAAM,YAAY,SAAS;AAAA,IAC9C,YAAY,CAAC,EAAE,YAAY,MAAM,qBAAqB;AAAA,EACvD;AAAA,EACA;AAAA,IACC,KAAK;AAAA,IACL,UAAU;AAAA,IACV,MAAM,CAAC,EAAE,UAAU,MAAM,YAAY,SAAS;AAAA,IAC9C,YAAY,CAAC,EAAE,YAAY,MAAM,uBAAuB;AAAA,EAAA;AAE1D;;"}
|
package/dist/harmony144.mjs
CHANGED
|
@@ -1,18 +1,33 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
1
|
+
const navigationItems = [
|
|
2
|
+
{
|
|
3
|
+
key: "editor",
|
|
4
|
+
labelKey: "Editor",
|
|
5
|
+
path: ({ projectId }) => `/project/${projectId}/editor`
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
key: "dashboard",
|
|
9
|
+
labelKey: "Download",
|
|
10
|
+
path: ({ projectId }) => `/project/${projectId}/dashboard`
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
key: "contributors",
|
|
14
|
+
labelKey: "Contributors",
|
|
15
|
+
path: ({ projectId }) => `/project/${projectId}/contributors`
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
key: "orders",
|
|
19
|
+
labelKey: "Human proofreading",
|
|
20
|
+
path: ({ projectId }) => `/project/${projectId}/orders`,
|
|
21
|
+
shouldShow: ({ flags }) => flags.ap_feature_hraas === "on"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
key: "billing",
|
|
25
|
+
labelKey: "Billing",
|
|
26
|
+
path: ({ projectId }) => `/project/${projectId}/billing`,
|
|
27
|
+
shouldShow: ({ flags }) => flags.ap_feature_billing === "on"
|
|
28
|
+
}
|
|
29
|
+
];
|
|
11
30
|
export {
|
|
12
|
-
|
|
13
|
-
dropdownButton,
|
|
14
|
-
dropdownButtonActive,
|
|
15
|
-
shortcutLabel,
|
|
16
|
-
shortcutMenu
|
|
31
|
+
navigationItems
|
|
17
32
|
};
|
|
18
33
|
//# sourceMappingURL=harmony144.mjs.map
|
package/dist/harmony144.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"harmony144.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"harmony144.mjs","sources":["../src/features/navigation/schemas/navigationSchema.ts"],"sourcesContent":["import type { DropdownItem, NavItemIcon } from '@features/navigation/types/navigation'\n\nexport type NavKey = 'editor' | 'contributors' | 'orders' | 'billing' | 'settings' | 'dashboard'\n\nexport interface NavigationItem {\n\tkey: NavKey\n\tlabelKey: string // TODO: i18n key inside this package\n\tpath: ({ projectId }: { projectId: string }) => string\n\n\ticon?: NavItemIcon\n\tdropdown?: DropdownItem[][]\n\tbadge?: number | ((ctx: NavCtx) => number)\n\n\tshouldShow?: (ctx: NavCtx) => boolean\n\tdisabled?: boolean | ((ctx: NavCtx) => boolean)\n\tisActive?: (pathname: string) => boolean // custom match, else fallback\n}\n\n/** What the gate functions receive */\nexport interface NavCtx {\n\tflags: Record<string, string>\n\tpathname: string\n\tpermissions?: Array<string> // e.g. contributor admin_rights //TODO: Provide type for permissions\n}\n\n// TODO: Handle Translations on harmony side.\nexport const navigationItems: NavigationItem[] = [\n\t{\n\t\tkey: 'editor',\n\t\tlabelKey: 'Editor',\n\t\tpath: ({ projectId }) => `/project/${projectId}/editor`,\n\t},\n\t{\n\t\tkey: 'dashboard',\n\t\tlabelKey: 'Download',\n\t\tpath: ({ projectId }) => `/project/${projectId}/dashboard`,\n\t},\n\t{\n\t\tkey: 'contributors',\n\t\tlabelKey: 'Contributors',\n\t\tpath: ({ projectId }) => `/project/${projectId}/contributors`,\n\t},\n\n\t{\n\t\tkey: 'orders',\n\t\tlabelKey: 'Human proofreading',\n\t\tpath: ({ projectId }) => `/project/${projectId}/orders`,\n\t\tshouldShow: ({ flags }) => flags.ap_feature_hraas === 'on',\n\t},\n\t{\n\t\tkey: 'billing',\n\t\tlabelKey: 'Billing',\n\t\tpath: ({ projectId }) => `/project/${projectId}/billing`,\n\t\tshouldShow: ({ flags }) => flags.ap_feature_billing === 'on',\n\t},\n]\n"],"names":[],"mappings":"AA0BO,MAAM,kBAAoC;AAAA,EAChD;AAAA,IACC,KAAK;AAAA,IACL,UAAU;AAAA,IACV,MAAM,CAAC,EAAE,UAAU,MAAM,YAAY,SAAS;AAAA,EAC/C;AAAA,EACA;AAAA,IACC,KAAK;AAAA,IACL,UAAU;AAAA,IACV,MAAM,CAAC,EAAE,UAAU,MAAM,YAAY,SAAS;AAAA,EAC/C;AAAA,EACA;AAAA,IACC,KAAK;AAAA,IACL,UAAU;AAAA,IACV,MAAM,CAAC,EAAE,UAAU,MAAM,YAAY,SAAS;AAAA,EAC/C;AAAA,EAEA;AAAA,IACC,KAAK;AAAA,IACL,UAAU;AAAA,IACV,MAAM,CAAC,EAAE,UAAU,MAAM,YAAY,SAAS;AAAA,IAC9C,YAAY,CAAC,EAAE,YAAY,MAAM,qBAAqB;AAAA,EACvD;AAAA,EACA;AAAA,IACC,KAAK;AAAA,IACL,UAAU;AAAA,IACV,MAAM,CAAC,EAAE,UAAU,MAAM,YAAY,SAAS;AAAA,IAC9C,YAAY,CAAC,EAAE,YAAY,MAAM,uBAAuB;AAAA,EAAA;AAE1D;"}
|
package/dist/harmony145.cjs
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
|
|
2
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
|
+
const _commonjsHelpers = require("./harmony175.cjs");
|
|
4
|
+
const debounce$1 = require("./harmony153.cjs");
|
|
5
|
+
var debounceExports = debounce$1.__require();
|
|
6
|
+
const debounce = /* @__PURE__ */ _commonjsHelpers.getDefaultExportFromCjs(debounceExports);
|
|
7
|
+
exports.default = debounce;
|
|
6
8
|
//# sourceMappingURL=harmony145.cjs.map
|
package/dist/harmony145.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"harmony145.cjs","sources":[
|
|
1
|
+
{"version":3,"file":"harmony145.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
|
package/dist/harmony145.mjs
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { getDefaultExportFromCjs } from "./harmony175.mjs";
|
|
2
|
+
import { __require as requireDebounce } from "./harmony153.mjs";
|
|
3
|
+
var debounceExports = requireDebounce();
|
|
4
|
+
const debounce = /* @__PURE__ */ getDefaultExportFromCjs(debounceExports);
|
|
3
5
|
export {
|
|
4
|
-
|
|
6
|
+
debounce as default
|
|
5
7
|
};
|
|
6
8
|
//# sourceMappingURL=harmony145.mjs.map
|
package/dist/harmony145.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"harmony145.mjs","sources":[
|
|
1
|
+
{"version":3,"file":"harmony145.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
package/dist/harmony146.cjs
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
|
|
2
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
|
+
const _commonjsHelpers = require("./harmony175.cjs");
|
|
4
|
+
const throttle$1 = require("./harmony157.cjs");
|
|
5
|
+
var throttleExports = throttle$1.__require();
|
|
6
|
+
const throttle = /* @__PURE__ */ _commonjsHelpers.getDefaultExportFromCjs(throttleExports);
|
|
7
|
+
exports.default = throttle;
|
|
6
8
|
//# sourceMappingURL=harmony146.cjs.map
|
package/dist/harmony146.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"harmony146.cjs","sources":[
|
|
1
|
+
{"version":3,"file":"harmony146.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
|
package/dist/harmony146.mjs
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { getDefaultExportFromCjs } from "./harmony175.mjs";
|
|
2
|
+
import { __require as requireThrottle } from "./harmony157.mjs";
|
|
3
|
+
var throttleExports = requireThrottle();
|
|
4
|
+
const throttle = /* @__PURE__ */ getDefaultExportFromCjs(throttleExports);
|
|
3
5
|
export {
|
|
4
|
-
|
|
6
|
+
throttle as default
|
|
5
7
|
};
|
|
6
8
|
//# sourceMappingURL=harmony146.mjs.map
|
package/dist/harmony146.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"harmony146.mjs","sources":[
|
|
1
|
+
{"version":3,"file":"harmony146.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
package/dist/harmony147.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const has = require("./
|
|
4
|
-
const
|
|
5
|
-
exports.
|
|
3
|
+
const has = require("./harmony125.cjs");
|
|
4
|
+
const accessMarketingProjects = ({ enabledFeatureFlags }) => has.has(enabledFeatureFlags, "homeMarketingBeta");
|
|
5
|
+
exports.accessMarketingProjects = accessMarketingProjects;
|
|
6
6
|
//# sourceMappingURL=harmony147.cjs.map
|
package/dist/harmony147.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"harmony147.cjs","sources":["../src/features/permissions/action-resolvers/
|
|
1
|
+
{"version":3,"file":"harmony147.cjs","sources":["../src/features/permissions/action-resolvers/accessMarketingProjects.ts"],"sourcesContent":["import type { ActionResolver } from '../types'\nimport { has } from '../utils/has'\n\nexport const accessMarketingProjects: ActionResolver = ({ enabledFeatureFlags }) =>\n\thas(enabledFeatureFlags, 'homeMarketingBeta')\n"],"names":["has"],"mappings":";;;AAGO,MAAM,0BAA0C,CAAC,EAAE,oBACzD,MAAAA,IAAA,IAAI,qBAAqB,mBAAmB;;"}
|
package/dist/harmony147.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { has } from "./
|
|
2
|
-
const
|
|
1
|
+
import { has } from "./harmony125.mjs";
|
|
2
|
+
const accessMarketingProjects = ({ enabledFeatureFlags }) => has(enabledFeatureFlags, "homeMarketingBeta");
|
|
3
3
|
export {
|
|
4
|
-
|
|
4
|
+
accessMarketingProjects
|
|
5
5
|
};
|
|
6
6
|
//# sourceMappingURL=harmony147.mjs.map
|
package/dist/harmony147.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"harmony147.mjs","sources":["../src/features/permissions/action-resolvers/
|
|
1
|
+
{"version":3,"file":"harmony147.mjs","sources":["../src/features/permissions/action-resolvers/accessMarketingProjects.ts"],"sourcesContent":["import type { ActionResolver } from '../types'\nimport { has } from '../utils/has'\n\nexport const accessMarketingProjects: ActionResolver = ({ enabledFeatureFlags }) =>\n\thas(enabledFeatureFlags, 'homeMarketingBeta')\n"],"names":[],"mappings":";AAGO,MAAM,0BAA0C,CAAC,EAAE,oBACzD,MAAA,IAAI,qBAAqB,mBAAmB;"}
|
package/dist/harmony148.cjs
CHANGED
|
@@ -1,17 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
const canDownloadFiles = ({ projectType, projectPermissions }) => canPerformActionByProjectType.canPerformActionByProjectType(projectType, {
|
|
7
|
-
classic: () => has.has(projectPermissions, "download"),
|
|
8
|
-
// This is a temporary workaround for the marketing project type - upload and download permissions are not yet supported
|
|
9
|
-
// so to restrict translators from accessing the upload/download page we are checking that they have any permissions at all.
|
|
10
|
-
// The reason for this is that, at the moment, the Translators role will assign no permissions to the user. So we are effectively
|
|
11
|
-
// simulating a check for 'is this user a translator?' (since project 'roles' don't actually exist).
|
|
12
|
-
// The correct check is to check for upload permission, so when that is implemented this will continue to work as expected,
|
|
13
|
-
// but will need to remove this first part of the check.
|
|
14
|
-
marketing: () => hasAny.hasAny(projectPermissions, "contributors", "settings", "manage_languages") || has.has(projectPermissions, "download")
|
|
15
|
-
});
|
|
16
|
-
exports.canDownloadFiles = canDownloadFiles;
|
|
3
|
+
const has = require("./harmony125.cjs");
|
|
4
|
+
const deleteProjects = ({ projectPermissions }) => has.has(projectPermissions, "settings");
|
|
5
|
+
exports.deleteProjects = deleteProjects;
|
|
17
6
|
//# sourceMappingURL=harmony148.cjs.map
|
package/dist/harmony148.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"harmony148.cjs","sources":["../src/features/permissions/action-resolvers/
|
|
1
|
+
{"version":3,"file":"harmony148.cjs","sources":["../src/features/permissions/action-resolvers/deleteProjects.ts"],"sourcesContent":["import type { ActionResolver } from '../types'\nimport { has } from '../utils/has'\n\nexport const deleteProjects: ActionResolver = ({ projectPermissions }) =>\n\thas(projectPermissions, 'settings')\n"],"names":["has"],"mappings":";;;AAGO,MAAM,iBAAiC,CAAC,EAAE,mBAChD,MAAAA,IAAA,IAAI,oBAAoB,UAAU;;"}
|
package/dist/harmony148.mjs
CHANGED
|
@@ -1,17 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { has } from "./harmony124.mjs";
|
|
4
|
-
const canDownloadFiles = ({ projectType, projectPermissions }) => canPerformActionByProjectType(projectType, {
|
|
5
|
-
classic: () => has(projectPermissions, "download"),
|
|
6
|
-
// This is a temporary workaround for the marketing project type - upload and download permissions are not yet supported
|
|
7
|
-
// so to restrict translators from accessing the upload/download page we are checking that they have any permissions at all.
|
|
8
|
-
// The reason for this is that, at the moment, the Translators role will assign no permissions to the user. So we are effectively
|
|
9
|
-
// simulating a check for 'is this user a translator?' (since project 'roles' don't actually exist).
|
|
10
|
-
// The correct check is to check for upload permission, so when that is implemented this will continue to work as expected,
|
|
11
|
-
// but will need to remove this first part of the check.
|
|
12
|
-
marketing: () => hasAny(projectPermissions, "contributors", "settings", "manage_languages") || has(projectPermissions, "download")
|
|
13
|
-
});
|
|
1
|
+
import { has } from "./harmony125.mjs";
|
|
2
|
+
const deleteProjects = ({ projectPermissions }) => has(projectPermissions, "settings");
|
|
14
3
|
export {
|
|
15
|
-
|
|
4
|
+
deleteProjects
|
|
16
5
|
};
|
|
17
6
|
//# sourceMappingURL=harmony148.mjs.map
|
package/dist/harmony148.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"harmony148.mjs","sources":["../src/features/permissions/action-resolvers/
|
|
1
|
+
{"version":3,"file":"harmony148.mjs","sources":["../src/features/permissions/action-resolvers/deleteProjects.ts"],"sourcesContent":["import type { ActionResolver } from '../types'\nimport { has } from '../utils/has'\n\nexport const deleteProjects: ActionResolver = ({ projectPermissions }) =>\n\thas(projectPermissions, 'settings')\n"],"names":[],"mappings":";AAGO,MAAM,iBAAiC,CAAC,EAAE,mBAChD,MAAA,IAAI,oBAAoB,UAAU;"}
|
package/dist/harmony149.cjs
CHANGED
|
@@ -1,17 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
const canUploadFiles = ({ projectPermissions, projectType }) => canPerformActionByProjectType.canPerformActionByProjectType(projectType, {
|
|
7
|
-
classic: () => has.has(projectPermissions, "upload"),
|
|
8
|
-
// This is a temporary workaround for the marketing project type - upload and download permissions are not yet supported
|
|
9
|
-
// so to restrict translators from accessing the upload/download page we are checking that they have any permissions at all.
|
|
10
|
-
// The reason for this is that, at the moment, the Translators role will assign no permissions to the user. So we are effectively
|
|
11
|
-
// simulating a check for 'is this user a translator?' (since project 'roles' don't actually exist).
|
|
12
|
-
// The correct check is to check for upload permission, so when that is implemented this will continue to work as expected,
|
|
13
|
-
// but will need to remove this first part of the check.
|
|
14
|
-
marketing: () => hasAny.hasAny(projectPermissions, "contributors", "settings", "manage_languages") || has.has(projectPermissions, "upload")
|
|
15
|
-
});
|
|
16
|
-
exports.canUploadFiles = canUploadFiles;
|
|
3
|
+
const has = require("./harmony125.cjs");
|
|
4
|
+
const manageContributors = ({ projectPermissions }) => has.has(projectPermissions, "contributors");
|
|
5
|
+
exports.manageContributors = manageContributors;
|
|
17
6
|
//# sourceMappingURL=harmony149.cjs.map
|
package/dist/harmony149.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"harmony149.cjs","sources":["../src/features/permissions/action-resolvers/
|
|
1
|
+
{"version":3,"file":"harmony149.cjs","sources":["../src/features/permissions/action-resolvers/manageContributors.ts"],"sourcesContent":["import type { ActionResolver } from '../types'\nimport { has } from '../utils/has'\n\nexport const manageContributors: ActionResolver = ({ projectPermissions }) =>\n\thas(projectPermissions, 'contributors')\n"],"names":["has"],"mappings":";;;AAGO,MAAM,qBAAqC,CAAC,EAAE,mBACpD,MAAAA,IAAA,IAAI,oBAAoB,cAAc;;"}
|
package/dist/harmony149.mjs
CHANGED
|
@@ -1,17 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { has } from "./harmony124.mjs";
|
|
4
|
-
const canUploadFiles = ({ projectPermissions, projectType }) => canPerformActionByProjectType(projectType, {
|
|
5
|
-
classic: () => has(projectPermissions, "upload"),
|
|
6
|
-
// This is a temporary workaround for the marketing project type - upload and download permissions are not yet supported
|
|
7
|
-
// so to restrict translators from accessing the upload/download page we are checking that they have any permissions at all.
|
|
8
|
-
// The reason for this is that, at the moment, the Translators role will assign no permissions to the user. So we are effectively
|
|
9
|
-
// simulating a check for 'is this user a translator?' (since project 'roles' don't actually exist).
|
|
10
|
-
// The correct check is to check for upload permission, so when that is implemented this will continue to work as expected,
|
|
11
|
-
// but will need to remove this first part of the check.
|
|
12
|
-
marketing: () => hasAny(projectPermissions, "contributors", "settings", "manage_languages") || has(projectPermissions, "upload")
|
|
13
|
-
});
|
|
1
|
+
import { has } from "./harmony125.mjs";
|
|
2
|
+
const manageContributors = ({ projectPermissions }) => has(projectPermissions, "contributors");
|
|
14
3
|
export {
|
|
15
|
-
|
|
4
|
+
manageContributors
|
|
16
5
|
};
|
|
17
6
|
//# sourceMappingURL=harmony149.mjs.map
|
package/dist/harmony149.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"harmony149.mjs","sources":["../src/features/permissions/action-resolvers/
|
|
1
|
+
{"version":3,"file":"harmony149.mjs","sources":["../src/features/permissions/action-resolvers/manageContributors.ts"],"sourcesContent":["import type { ActionResolver } from '../types'\nimport { has } from '../utils/has'\n\nexport const manageContributors: ActionResolver = ({ projectPermissions }) =>\n\thas(projectPermissions, 'contributors')\n"],"names":[],"mappings":";AAGO,MAAM,qBAAqC,CAAC,EAAE,mBACpD,MAAA,IAAI,oBAAoB,cAAc;"}
|
package/dist/harmony150.cjs
CHANGED
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
|
|
3
|
+
const canPerformActionByProjectType = require("./harmony166.cjs");
|
|
4
|
+
const hasAny = require("./harmony124.cjs");
|
|
5
|
+
const has = require("./harmony125.cjs");
|
|
6
|
+
const canDownloadFiles = ({ projectType, projectPermissions }) => canPerformActionByProjectType.canPerformActionByProjectType(projectType, {
|
|
7
|
+
classic: () => has.has(projectPermissions, "download"),
|
|
8
|
+
// This is a temporary workaround for the marketing project type - upload and download permissions are not yet supported
|
|
9
|
+
// so to restrict translators from accessing the upload/download page we are checking that they have any permissions at all.
|
|
10
|
+
// The reason for this is that, at the moment, the Translators role will assign no permissions to the user. So we are effectively
|
|
11
|
+
// simulating a check for 'is this user a translator?' (since project 'roles' don't actually exist).
|
|
12
|
+
// The correct check is to check for upload permission, so when that is implemented this will continue to work as expected,
|
|
13
|
+
// but will need to remove this first part of the check.
|
|
14
|
+
marketing: () => hasAny.hasAny(projectPermissions, "contributors", "settings", "manage_languages") || has.has(projectPermissions, "download")
|
|
15
|
+
});
|
|
16
|
+
exports.canDownloadFiles = canDownloadFiles;
|
|
6
17
|
//# sourceMappingURL=harmony150.cjs.map
|