@openinc/parse-server-opendash 3.12.0 → 3.13.0
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.
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.init = init;
|
|
4
|
+
const initIssuecategory_1 = require("./issuecategory/initIssuecategory");
|
|
4
5
|
const initKanbanStates_1 = require("./kanbanState/initKanbanStates");
|
|
5
6
|
const initMessages_1 = require("./messages/initMessages");
|
|
6
7
|
const initTicket_1 = require("./ticket/initTicket");
|
|
7
8
|
async function init() {
|
|
8
9
|
console.log("Initializing open.SERVICE feature...");
|
|
9
10
|
await (0, initKanbanStates_1.initKanbanStates)();
|
|
11
|
+
await (0, initIssuecategory_1.initIssuecategory)();
|
|
10
12
|
await (0, initMessages_1.initializeMessages)();
|
|
11
13
|
await (0, initKanbanStates_1.initCurrentTicketStates)();
|
|
12
14
|
await (0, initTicket_1.updateTicketDescription)();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function initIssuecategory(): Promise<void>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.initIssuecategory = initIssuecategory;
|
|
4
|
+
const types_1 = require("../../../types");
|
|
5
|
+
async function initIssuecategory() {
|
|
6
|
+
const tenant = await new Parse.Query(types_1.Tenant)
|
|
7
|
+
.ascending("createdAt")
|
|
8
|
+
.first({ useMasterKey: true });
|
|
9
|
+
const issueCategory = await new Parse.Query(types_1.Maintenance_Issuecategory)
|
|
10
|
+
.equalTo("catchall", true)
|
|
11
|
+
.first({ useMasterKey: true });
|
|
12
|
+
if (!issueCategory) {
|
|
13
|
+
const newIssueCategory = new types_1.Maintenance_Issuecategory({
|
|
14
|
+
name: "Allgemeiner Fehler",
|
|
15
|
+
catchall: true,
|
|
16
|
+
enabled: true,
|
|
17
|
+
issuecode: "0",
|
|
18
|
+
tenant: tenant,
|
|
19
|
+
});
|
|
20
|
+
const acl = new Parse.ACL();
|
|
21
|
+
acl.setPublicReadAccess(false);
|
|
22
|
+
acl.setPublicWriteAccess(false);
|
|
23
|
+
acl.setRoleReadAccess("od-admin", true);
|
|
24
|
+
acl.setRoleWriteAccess("od-admin", true);
|
|
25
|
+
if (tenant) {
|
|
26
|
+
acl.setRoleReadAccess(`od-tenant-user-${tenant.id}`, true);
|
|
27
|
+
acl.setRoleWriteAccess(`od-tenant-user-${tenant.id}`, true);
|
|
28
|
+
acl.setRoleReadAccess(`od-tenant-admin-${tenant.id}`, true);
|
|
29
|
+
acl.setRoleWriteAccess(`od-tenant-admin-${tenant.id}`, true);
|
|
30
|
+
}
|
|
31
|
+
newIssueCategory.setACL(acl);
|
|
32
|
+
await newIssueCategory.save(null, { useMasterKey: true });
|
|
33
|
+
}
|
|
34
|
+
}
|