@netgrif/components 6.2.0-rc.8 → 6.2.1
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/esm2020/lib/admin/ldap-group-role-assignment/ldap-group-role-assignment.component.mjs +5 -5
- package/esm2020/lib/admin/role-assignment/role-assignment.component.mjs +3 -3
- package/esm2020/lib/data-fields/button-field/button-field.component.mjs +3 -3
- package/esm2020/lib/data-fields/data-fields.module.mjs +12 -4
- package/esm2020/lib/data-fields/enumeration-field/enumeration-field.component.mjs +3 -3
- package/esm2020/lib/data-fields/enumeration-field/enumeration-stepper-field/enumeration-stepper-field.component.mjs +2 -2
- package/esm2020/lib/data-fields/file-field-list/file-list-field.component.mjs +2 -2
- package/esm2020/lib/data-fields/i18n-field/i18n-field.component.mjs +3 -3
- package/esm2020/lib/data-fields/multichoice-field/multichoice-autocomplete-field/multichoice-autocomplete-field.component.mjs +24 -0
- package/esm2020/lib/data-fields/multichoice-field/multichoice-field.component.mjs +7 -6
- package/esm2020/lib/data-fields/number-field/number-field.component.mjs +3 -12
- package/esm2020/lib/data-fields/public-api.mjs +2 -1
- package/esm2020/lib/data-fields/text-field/html-textarea-field/html-textarea-field.component.mjs +10 -3
- package/esm2020/lib/data-fields/text-field/rich-textarea-field/easymde-wrapper/easymde-wrapper.component.mjs +2 -2
- package/esm2020/lib/data-fields/text-field/text-field.component.mjs +3 -3
- package/esm2020/lib/data-fields/user-list-field/user-list-field.component.mjs +35 -0
- package/esm2020/lib/header/header-modes/edit-mode/edit-mode.component.mjs +3 -3
- package/esm2020/lib/header/header-modes/loading-mode/loading-mode.component.mjs +3 -3
- package/esm2020/lib/header/header-modes/search-mode/search-mode.component.mjs +3 -3
- package/esm2020/lib/header/header-modes/sort-mode/sort-mode.component.mjs +3 -3
- package/esm2020/lib/header/header.component.mjs +3 -6
- package/esm2020/lib/navigation/breadcrumbs/breadcrumbs.component.mjs +19 -0
- package/esm2020/lib/navigation/group-navigation-component-resolver/default-components/default-tab-view/default-tab-view.component.mjs +15 -2
- package/esm2020/lib/navigation/group-navigation-component-resolver/default-components/default-tabbed-case-view/default-tabbed-case-view.component.mjs +8 -9
- package/esm2020/lib/navigation/group-navigation-component-resolver/default-components/model/injected-tabbed-case-view-data-with-navigation-item-task-data.mjs +1 -1
- package/esm2020/lib/navigation/navigation-double-drawer/navigation-double-drawer.component.mjs +3 -3
- package/esm2020/lib/navigation/navigation.module.mjs +10 -5
- package/esm2020/lib/navigation/public-api.mjs +2 -1
- package/esm2020/lib/panel/case-panel/case-panel.component.mjs +9 -9
- package/esm2020/lib/panel/panel.component.mjs +11 -10
- package/esm2020/lib/panel/panel.module.mjs +10 -5
- package/esm2020/lib/panel/public-api.mjs +2 -1
- package/esm2020/lib/panel/public-workflow-panel/public-workflow-panel.component.mjs +10 -8
- package/esm2020/lib/panel/task-panel/task-panel.component.mjs +11 -8
- package/esm2020/lib/panel/task-panel-single/single-task.component.mjs +31 -0
- package/esm2020/lib/panel/workflow-panel/workflow-panel.component.mjs +10 -8
- package/esm2020/lib/side-menu/side-menu-container/side-menu-container.component.mjs +2 -2
- package/esm2020/lib/tabs/tab-view/tab-view.component.mjs +3 -3
- package/esm2020/lib/task-content/field-component-resolver/field-component-resolver.component.mjs +10 -9
- package/esm2020/lib/view/case-view/case-view.module.mjs +6 -5
- package/esm2020/lib/view/case-view/components/create-case-button/create-case-button.component.mjs +51 -0
- package/esm2020/lib/view/public-api.mjs +2 -1
- package/fesm2015/netgrif-components.mjs +353 -202
- package/fesm2015/netgrif-components.mjs.map +1 -1
- package/fesm2020/netgrif-components.mjs +344 -202
- package/fesm2020/netgrif-components.mjs.map +1 -1
- package/lib/admin/ldap-group-role-assignment/ldap-group-role-assignment.component.d.ts +2 -2
- package/lib/data-fields/data-fields.module.d.ts +39 -37
- package/lib/data-fields/multichoice-field/multichoice-autocomplete-field/multichoice-autocomplete-field.component.d.ts +7 -0
- package/lib/data-fields/number-field/number-field.component.d.ts +0 -1
- package/lib/data-fields/public-api.d.ts +1 -0
- package/lib/data-fields/text-field/html-textarea-field/html-textarea-field.component.d.ts +3 -2
- package/lib/data-fields/user-list-field/user-list-field.component.d.ts +10 -0
- package/lib/header/header.component.d.ts +1 -4
- package/lib/navigation/breadcrumbs/breadcrumbs.component.d.ts +8 -0
- package/lib/navigation/group-navigation-component-resolver/default-components/model/injected-tabbed-case-view-data-with-navigation-item-task-data.d.ts +2 -1
- package/lib/navigation/navigation.module.d.ts +16 -15
- package/lib/navigation/public-api.d.ts +1 -0
- package/lib/panel/case-panel/case-panel.component.d.ts +3 -3
- package/lib/panel/panel.component.d.ts +2 -1
- package/lib/panel/panel.module.d.ts +8 -7
- package/lib/panel/public-api.d.ts +1 -0
- package/lib/panel/public-workflow-panel/public-workflow-panel.component.d.ts +3 -3
- package/lib/panel/task-panel/task-panel.component.d.ts +4 -3
- package/lib/panel/task-panel-single/single-task.component.d.ts +10 -0
- package/lib/panel/workflow-panel/workflow-panel.component.d.ts +3 -3
- package/lib/view/case-view/case-view.module.d.ts +7 -6
- package/lib/view/case-view/components/create-case-button/create-case-button.component.d.ts +18 -0
- package/lib/view/public-api.d.ts +1 -0
- package/package.json +2 -2
- package/schematics/_commons/view-class-info.js +16 -0
- package/schematics/_commons/view-class-info.js.map +1 -1
- package/schematics/view/create-view/models/nullable-create-view-arguments.d.ts +2 -0
- package/schematics/view/create-view/schematic-create-view.js +26 -11
- package/schematics/view/create-view/schematic-create-view.js.map +1 -1
- package/schematics/view/create-view-prompt/models/create-view-arguments.d.ts +27 -1
- package/schematics/view/create-view-prompt/schema-create-view-prompt.json +19 -3
- package/schematics/view/create-view-prompt/schematic-create-view-prompt.js +30 -0
- package/schematics/view/create-view-prompt/schematic-create-view-prompt.js.map +1 -1
- package/schematics/view/create-view-prompt/views/case-view/create-case-view.js +4 -3
- package/schematics/view/create-view-prompt/views/case-view/create-case-view.js.map +1 -1
- package/schematics/view/create-view-prompt/views/case-view/files/common/__className@dasherize__.component.html.template +9 -8
- package/schematics/view/create-view-prompt/views/case-view/files/common/__className@dasherize__.component.spec.ts.template +6 -2
- package/schematics/view/create-view-prompt/views/case-view/files/simple/__className@dasherize__.component.scss.template +27 -5
- package/schematics/view/create-view-prompt/views/case-view/files/simple/__className@dasherize__.component.ts.template +7 -5
- package/schematics/view/create-view-prompt/views/case-view/files/tabbed/__className@dasherize__.component.scss.template +33 -5
- package/schematics/view/create-view-prompt/views/case-view/files/tabbed/__className@dasherize__.component.ts.template +6 -3
- package/schematics/view/create-view-prompt/views/dashboard-view/create-dashboard-view.js +1 -0
- package/schematics/view/create-view-prompt/views/dashboard-view/create-dashboard-view.js.map +1 -1
- package/schematics/view/create-view-prompt/views/dashboard-view/files/__className@dasherize__.component.spec.ts.template +10 -3
- package/schematics/view/create-view-prompt/views/group-view/files/__className@dasherize__.component.scss.template +4 -4
- package/schematics/view/create-view-prompt/views/group-view/files/__className@dasherize__.component.spec.ts.template +5 -2
- package/schematics/view/create-view-prompt/views/ldap-role-assignment-view/files/__className@dasherize__.component.html.template +1 -0
- package/schematics/view/create-view-prompt/views/ldap-role-assignment-view/files/__className@dasherize__.component.scss.template +25 -0
- package/schematics/view/create-view-prompt/views/ldap-role-assignment-view/files/__className@dasherize__.component.spec.ts.template +26 -0
- package/schematics/view/create-view-prompt/views/ldap-role-assignment-view/files/__className@dasherize__.component.ts.template +17 -0
- package/schematics/view/create-view-prompt/views/ldap-role-assignment-view/ldap-role-assignment-view.d.ts +3 -0
- package/schematics/view/create-view-prompt/views/ldap-role-assignment-view/ldap-role-assignment-view.js +36 -0
- package/schematics/view/create-view-prompt/views/ldap-role-assignment-view/ldap-role-assignment-view.js.map +1 -0
- package/schematics/view/create-view-prompt/views/login/files/__className@dasherize__.component.html.template +1 -1
- package/schematics/view/create-view-prompt/views/login/files/__className@dasherize__.component.ts.template +37 -2
- package/schematics/view/create-view-prompt/views/public-resolver-view/create-public-resolver-view.d.ts +4 -0
- package/schematics/view/create-view-prompt/views/public-resolver-view/create-public-resolver-view.js +35 -0
- package/schematics/view/create-view-prompt/views/public-resolver-view/create-public-resolver-view.js.map +1 -0
- package/schematics/view/create-view-prompt/views/public-resolver-view/files/common/__className@dasherize__.component.html.template +4 -0
- package/schematics/view/create-view-prompt/views/public-resolver-view/files/common/__className@dasherize__.component.scss.template +0 -0
- package/schematics/view/create-view-prompt/views/public-resolver-view/files/common/__className@dasherize__.component.spec.ts.template +49 -0
- package/schematics/view/create-view-prompt/views/public-resolver-view/files/common/__className@dasherize__.component.ts.template +46 -0
- package/schematics/view/create-view-prompt/views/public-single-task-view/create-public-single-task-view.d.ts +4 -0
- package/schematics/view/create-view-prompt/views/public-single-task-view/create-public-single-task-view.js +37 -0
- package/schematics/view/create-view-prompt/views/public-single-task-view/create-public-single-task-view.js.map +1 -0
- package/schematics/view/create-view-prompt/views/public-single-task-view/files/common/__className@dasherize__.component.html.template +33 -0
- package/schematics/view/create-view-prompt/views/public-single-task-view/files/common/__className@dasherize__.component.scss.template +69 -0
- package/schematics/view/create-view-prompt/views/public-single-task-view/files/common/__className@dasherize__.component.spec.ts.template +52 -0
- package/schematics/view/create-view-prompt/views/public-single-task-view/files/common/__className@dasherize__.component.ts.template +151 -0
- package/schematics/view/create-view-prompt/views/public-task-view/create-public-task-view.d.ts +4 -0
- package/schematics/view/create-view-prompt/views/public-task-view/create-public-task-view.js +37 -0
- package/schematics/view/create-view-prompt/views/public-task-view/create-public-task-view.js.map +1 -0
- package/schematics/view/create-view-prompt/views/public-task-view/files/common/__className@dasherize__.component.html.template +6 -0
- package/schematics/view/create-view-prompt/views/public-task-view/files/common/__className@dasherize__.component.scss.template +24 -0
- package/schematics/view/create-view-prompt/views/public-task-view/files/common/__className@dasherize__.component.spec.ts.template +52 -0
- package/schematics/view/create-view-prompt/views/public-task-view/files/common/__className@dasherize__.component.ts.template +136 -0
- package/schematics/view/create-view-prompt/views/public-workflow-view/create-public-workflow-view.d.ts +4 -0
- package/schematics/view/create-view-prompt/views/public-workflow-view/create-public-workflow-view.js +38 -0
- package/schematics/view/create-view-prompt/views/public-workflow-view/create-public-workflow-view.js.map +1 -0
- package/schematics/view/create-view-prompt/views/public-workflow-view/files/common/__className@dasherize__.component.html.template +36 -0
- package/schematics/view/create-view-prompt/views/public-workflow-view/files/common/__className@dasherize__.component.scss.template +39 -0
- package/schematics/view/create-view-prompt/views/public-workflow-view/files/common/__className@dasherize__.component.spec.ts.template +67 -0
- package/schematics/view/create-view-prompt/views/public-workflow-view/files/common/__className@dasherize__.component.ts.template +72 -0
- package/schematics/view/create-view-prompt/views/role-assignment-view/files/__className@dasherize__.component.html.template +1 -0
- package/schematics/view/create-view-prompt/views/role-assignment-view/files/__className@dasherize__.component.scss.template +25 -0
- package/schematics/view/create-view-prompt/views/role-assignment-view/files/__className@dasherize__.component.ts.template +17 -0
- package/schematics/view/create-view-prompt/views/role-assignment-view/role-assignment-view.d.ts +3 -0
- package/schematics/view/create-view-prompt/views/role-assignment-view/role-assignment-view.js +36 -0
- package/schematics/view/create-view-prompt/views/role-assignment-view/role-assignment-view.js.map +1 -0
- package/schematics/view/create-view-prompt/views/sidenav-toolbar-view/create-sidenav-or-toolbar-view.js +13 -7
- package/schematics/view/create-view-prompt/views/sidenav-toolbar-view/create-sidenav-or-toolbar-view.js.map +1 -1
- package/schematics/view/create-view-prompt/views/sidenav-toolbar-view/files/__className@dasherize__.component.html.template +3 -3
- package/schematics/view/create-view-prompt/views/task-view/files/common/__className@dasherize__.component.scss.template +4 -4
- package/schematics/view/create-view-prompt/views/task-view/files/common/__className@dasherize__.component.spec.ts.template +5 -2
- package/schematics/view/create-view-prompt/views/task-view/files/simple/__className@dasherize__.component.ts.template +1 -1
- package/schematics/view/create-view-prompt/views/workflow-view/create-workflow-view.d.ts +3 -0
- package/schematics/view/create-view-prompt/views/workflow-view/create-workflow-view.js +38 -0
- package/schematics/view/create-view-prompt/views/workflow-view/create-workflow-view.js.map +1 -0
- package/schematics/view/create-view-prompt/views/workflow-view/files/__className@dasherize__.component.html.template +3 -0
- package/schematics/view/create-view-prompt/views/workflow-view/files/__className@dasherize__.component.scss.template +5 -0
- package/schematics/view/create-view-prompt/views/workflow-view/files/__className@dasherize__.component.ts.template +45 -0
- package/src/lib/data-fields/data-field.theme.scss +47 -1
- package/src/lib/header/header.theme.scss +6 -0
- package/src/lib/panel/panel.theme.scss +10 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createLdapRoleAssignmentView = void 0;
|
|
4
|
+
const schematics_1 = require("@angular-devkit/schematics");
|
|
5
|
+
const utility_functions_1 = require("../../../../_utility/utility-functions");
|
|
6
|
+
const view_class_info_1 = require("../../../../_commons/view-class-info");
|
|
7
|
+
const core_1 = require("@angular-devkit/core");
|
|
8
|
+
const view_utility_functions_1 = require("../../../_utility/view-utility-functions");
|
|
9
|
+
const import_to_add_1 = require("../../../../_commons/import-to-add");
|
|
10
|
+
const view_service_functions_1 = require("../../../_utility/view-service-functions");
|
|
11
|
+
function createLdapRoleAssignmentView(tree, args, addViewToService) {
|
|
12
|
+
const projectInfo = (0, utility_functions_1.getProjectInfo)(tree);
|
|
13
|
+
const view = new view_class_info_1.ViewClassInfo(args.path, args.viewType, args.componentName);
|
|
14
|
+
const templateParams = {
|
|
15
|
+
prefix: projectInfo.projectPrefixDasherized,
|
|
16
|
+
className: view.nameWithoutComponent,
|
|
17
|
+
viewPath: args.path,
|
|
18
|
+
dasherize: core_1.strings.dasherize,
|
|
19
|
+
classify: core_1.strings.classify,
|
|
20
|
+
configName: projectInfo.projectNameClassified,
|
|
21
|
+
configImportPath: (0, utility_functions_1.createRelativePath)(view.fileImportPath, `./${projectInfo.projectNameDasherized}-configuration.service`),
|
|
22
|
+
modulePath: (0, utility_functions_1.createRelativePath)(view.fileImportPath, './app.module'),
|
|
23
|
+
};
|
|
24
|
+
const rules = [];
|
|
25
|
+
const destinationPath = `${projectInfo.path}/views/${args.path}`;
|
|
26
|
+
rules.push((0, utility_functions_1.createFilesFromTemplates)('./views/ldap-role-assignment-view/files', destinationPath, templateParams));
|
|
27
|
+
(0, view_utility_functions_1.updateAppModule)(tree, view.className, view.fileImportPath, [
|
|
28
|
+
new import_to_add_1.ImportToAdd('AdminComponentModule', '@netgrif/components')
|
|
29
|
+
]);
|
|
30
|
+
if (addViewToService) {
|
|
31
|
+
(0, view_service_functions_1.addViewToViewService)(tree, view);
|
|
32
|
+
}
|
|
33
|
+
return (0, schematics_1.chain)(rules);
|
|
34
|
+
}
|
|
35
|
+
exports.createLdapRoleAssignmentView = createLdapRoleAssignmentView;
|
|
36
|
+
//# sourceMappingURL=ldap-role-assignment-view.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ldap-role-assignment-view.js","sourceRoot":"","sources":["../../../../../../../projects/netgrif-components/schematics/view/create-view-prompt/views/ldap-role-assignment-view/ldap-role-assignment-view.ts"],"names":[],"mappings":";;;AAAA,2DAA6D;AAE7D,8EAAoH;AACpH,0EAAmE;AACnE,+CAA6C;AAC7C,qFAAyE;AACzE,sEAA+D;AAC/D,qFAA8E;AAE9E,SAAgB,4BAA4B,CAAC,IAAU,EAAE,IAAyB,EAAE,gBAAyB;IACzG,MAAM,WAAW,GAAG,IAAA,kCAAc,EAAC,IAAI,CAAC,CAAC;IACzC,MAAM,IAAI,GAAG,IAAI,+BAAa,CAC1B,IAAI,CAAC,IAAI,EACT,IAAI,CAAC,QAAQ,EACb,IAAI,CAAC,aAAa,CACrB,CAAC;IACF,MAAM,cAAc,GAAG;QACnB,MAAM,EAAE,WAAW,CAAC,uBAAuB;QAC3C,SAAS,EAAE,IAAI,CAAC,oBAAoB;QACpC,QAAQ,EAAE,IAAI,CAAC,IAAI;QACnB,SAAS,EAAE,cAAO,CAAC,SAAS;QAC5B,QAAQ,EAAE,cAAO,CAAC,QAAQ;QAC1B,UAAU,EAAE,WAAW,CAAC,qBAAqB;QAC7C,gBAAgB,EAAE,IAAA,sCAAkB,EAAC,IAAI,CAAC,cAAc,EAAE,KAAK,WAAW,CAAC,qBAAqB,wBAAwB,CAAC;QACzH,UAAU,EAAE,IAAA,sCAAkB,EAAC,IAAI,CAAC,cAAc,EAAE,cAAc,CAAC;KACtE,CAAC;IAEF,MAAM,KAAK,GAAG,EAAE,CAAC;IACjB,MAAM,eAAe,GAAG,GAAG,WAAW,CAAC,IAAI,UAAU,IAAI,CAAC,IAAI,EAAE,CAAC;IAGjE,KAAK,CAAC,IAAI,CAAC,IAAA,4CAAwB,EAAC,yCAAyC,EAAE,eAAe,EAAE,cAAc,CAAC,CAAC,CAAC;IACjH,IAAA,wCAAe,EAAC,IAAI,EAAE,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,cAAc,EAAE;QACvD,IAAI,2BAAW,CAAC,sBAAsB,EAAE,qBAAqB,CAAC;KACjE,CAAC,CAAC;IAEH,IAAI,gBAAgB,EAAE;QAClB,IAAA,6CAAoB,EAAC,IAAI,EAAE,IAAI,CAAC,CAAC;KACpC;IACD,OAAO,IAAA,kBAAK,EAAC,KAAK,CAAC,CAAC;AACxB,CAAC;AA/BD,oEA+BC"}
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import {Component} from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
NAE_VIEW_ID_SEGMENT,
|
|
4
|
+
ViewIdService,
|
|
5
|
+
SnackBarService,
|
|
6
|
+
LoggerService,
|
|
7
|
+
UserService,
|
|
8
|
+
User,
|
|
9
|
+
} from '@netgrif/components-core';
|
|
10
|
+
import {Router} from '@angular/router';
|
|
11
|
+
import {TranslateService} from '@ngx-translate/core';
|
|
3
12
|
|
|
4
13
|
@Component({
|
|
5
14
|
selector: '<%= prefix %>-<%= dasherize(className) %>',
|
|
@@ -13,6 +22,32 @@ import {NAE_VIEW_ID_SEGMENT, ViewIdService} from '@netgrif/components-core';
|
|
|
13
22
|
})
|
|
14
23
|
export class <%= classify(className) %>Component {
|
|
15
24
|
|
|
16
|
-
constructor(
|
|
25
|
+
constructor(private router: Router,
|
|
26
|
+
private _userService: UserService,
|
|
27
|
+
private _snackbar: SnackBarService,
|
|
28
|
+
private _translate: TranslateService,
|
|
29
|
+
private _log: LoggerService) {
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
ngOnInit(): void {
|
|
33
|
+
if (this._userService.user.id.length !== 0) {
|
|
34
|
+
this.redirectToHome();
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
onLogin(user: User) {
|
|
39
|
+
if (user && user.id) {
|
|
40
|
+
this.redirectToHome();
|
|
41
|
+
} else {
|
|
42
|
+
this._snackbar.openErrorSnackBar(this._translate.instant('forms.login.wrongCredentials'));
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
private redirectToHome() {
|
|
47
|
+
this.router.navigate(['/']).then((value) => {
|
|
48
|
+
this._log.debug('Routed to ' + value);
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
|
|
17
52
|
|
|
18
53
|
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Rule, Tree } from '@angular-devkit/schematics';
|
|
2
|
+
import { TabbedView } from '../../models/tabbed-view';
|
|
3
|
+
import { CreateTaskViewArguments } from '../../models/create-task-view-arguments';
|
|
4
|
+
export declare function createPublicResolverView(tree: Tree, args: CreateTaskViewArguments & TabbedView, addViewToService: boolean): Rule;
|
package/schematics/view/create-view-prompt/views/public-resolver-view/create-public-resolver-view.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createPublicResolverView = void 0;
|
|
4
|
+
const schematics_1 = require("@angular-devkit/schematics");
|
|
5
|
+
const core_1 = require("@angular-devkit/core");
|
|
6
|
+
const utility_functions_1 = require("../../../../_utility/utility-functions");
|
|
7
|
+
const view_utility_functions_1 = require("../../../_utility/view-utility-functions");
|
|
8
|
+
const view_service_functions_1 = require("../../../_utility/view-service-functions");
|
|
9
|
+
const view_class_info_1 = require("../../../../_commons/view-class-info");
|
|
10
|
+
const import_to_add_1 = require("../../../../_commons/import-to-add");
|
|
11
|
+
function createPublicResolverView(tree, args, addViewToService) {
|
|
12
|
+
const projectInfo = (0, utility_functions_1.getProjectInfo)(tree);
|
|
13
|
+
const view = new view_class_info_1.ViewClassInfo(args.path, args.viewType, args.componentName);
|
|
14
|
+
const rules = [];
|
|
15
|
+
const templateParams = {
|
|
16
|
+
prefix: projectInfo.projectPrefixDasherized,
|
|
17
|
+
className: view.nameWithoutComponent,
|
|
18
|
+
dasherize: core_1.strings.dasherize,
|
|
19
|
+
classify: core_1.strings.classify
|
|
20
|
+
};
|
|
21
|
+
const commonPathPrefix = './views/public-resolver-view/files/';
|
|
22
|
+
const destinationPath = `${projectInfo.path}/views/${args.path}`;
|
|
23
|
+
rules.push((0, utility_functions_1.createFilesFromTemplates)(`${commonPathPrefix}common`, destinationPath, templateParams));
|
|
24
|
+
(0, view_utility_functions_1.updateAppModule)(tree, view.className, view.fileImportPath, [
|
|
25
|
+
new import_to_add_1.ImportToAdd('FlexModule', '@angular/flex-layout'),
|
|
26
|
+
new import_to_add_1.ImportToAdd('FlexLayoutModule', '@angular/flex-layout'),
|
|
27
|
+
new import_to_add_1.ImportToAdd('MaterialModule', '@netgrif/components-core')
|
|
28
|
+
]);
|
|
29
|
+
if (addViewToService) {
|
|
30
|
+
(0, view_service_functions_1.addViewToViewService)(tree, view);
|
|
31
|
+
}
|
|
32
|
+
return (0, schematics_1.chain)(rules);
|
|
33
|
+
}
|
|
34
|
+
exports.createPublicResolverView = createPublicResolverView;
|
|
35
|
+
//# sourceMappingURL=create-public-resolver-view.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-public-resolver-view.js","sourceRoot":"","sources":["../../../../../../../projects/netgrif-components/schematics/view/create-view-prompt/views/public-resolver-view/create-public-resolver-view.ts"],"names":[],"mappings":";;;AAAA,2DAA6D;AAC7D,+CAA6C;AAC7C,8EAAgG;AAChG,qFAAyE;AACzE,qFAA8E;AAE9E,0EAAmE;AACnE,sEAA+D;AAI/D,SAAgB,wBAAwB,CAAC,IAAU,EAAE,IAA0C,EAAE,gBAAyB;IACtH,MAAM,WAAW,GAAG,IAAA,kCAAc,EAAC,IAAI,CAAC,CAAC;IACzC,MAAM,IAAI,GAAG,IAAI,+BAAa,CAC1B,IAAI,CAAC,IAAI,EACT,IAAI,CAAC,QAAQ,EACb,IAAI,CAAC,aAAa,CAAC,CAAC;IACxB,MAAM,KAAK,GAAG,EAAE,CAAC;IAEjB,MAAM,cAAc,GAAG;QACnB,MAAM,EAAE,WAAW,CAAC,uBAAuB;QAC3C,SAAS,EAAE,IAAI,CAAC,oBAAoB;QACpC,SAAS,EAAE,cAAO,CAAC,SAAS;QAC5B,QAAQ,EAAE,cAAO,CAAC,QAAQ;KAC7B,CAAC;IAEF,MAAM,gBAAgB,GAAG,qCAAqC,CAAC;IAC/D,MAAM,eAAe,GAAG,GAAG,WAAW,CAAC,IAAI,UAAU,IAAI,CAAC,IAAI,EAAE,CAAC;IACjE,KAAK,CAAC,IAAI,CAAC,IAAA,4CAAwB,EAAC,GAAG,gBAAgB,QAAQ,EAAE,eAAe,EAAE,cAAc,CAAC,CAAC,CAAC;IAEnG,IAAA,wCAAe,EAAC,IAAI,EAAE,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,cAAc,EAAE;QACvD,IAAI,2BAAW,CAAC,YAAY,EAAE,sBAAsB,CAAC;QACrD,IAAI,2BAAW,CAAC,kBAAkB,EAAE,sBAAsB,CAAC;QAC3D,IAAI,2BAAW,CAAC,gBAAgB,EAAE,0BAA0B,CAAC;KAChE,CAAC,CAAC;IAEH,IAAI,gBAAgB,EAAE;QAClB,IAAA,6CAAoB,EAAC,IAAI,EAAE,IAAI,CAAC,CAAC;KACpC;IACD,OAAO,IAAA,kBAAK,EAAC,KAAK,CAAC,CAAC;AACxB,CAAC;AA7BD,4DA6BC"}
|
|
File without changes
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import {waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
import { <%= classify(className) %>Component } from './<%= dasherize(className) %>.component';
|
|
3
|
+
import {<%= configName %>ConfigurationService} from '<%= configImportPath %>';
|
|
4
|
+
import {
|
|
5
|
+
MockAuthenticationMethodService,
|
|
6
|
+
AuthenticationMethodService,
|
|
7
|
+
ConfigurationService,
|
|
8
|
+
UserService,
|
|
9
|
+
MaterialModule,
|
|
10
|
+
TranslateLibModule
|
|
11
|
+
} from '@netgrif/components-core';
|
|
12
|
+
import {HttpClientTestingModule} from '@angular/common/http/testing';
|
|
13
|
+
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
|
|
14
|
+
import {RouterTestingModule} from '@angular/router/testing';
|
|
15
|
+
|
|
16
|
+
describe('<%= classify(className) %>Component', () => {
|
|
17
|
+
let component: <%= classify(className) %>Component;
|
|
18
|
+
let fixture: ComponentFixture<<%= classify(className) %>Component>;
|
|
19
|
+
|
|
20
|
+
beforeEach(waitForAsync(() => {
|
|
21
|
+
TestBed.configureTestingModule({
|
|
22
|
+
declarations: [<%= classify(className) %>Component],
|
|
23
|
+
imports: [
|
|
24
|
+
HttpClientTestingModule,
|
|
25
|
+
MaterialModule,
|
|
26
|
+
BrowserAnimationsModule,
|
|
27
|
+
RouterTestingModule.withRoutes([]),
|
|
28
|
+
TranslateLibModule
|
|
29
|
+
],
|
|
30
|
+
providers: [
|
|
31
|
+
{provide: AuthenticationMethodService, useClass: MockAuthenticationMethodService},
|
|
32
|
+
{provide: ConfigurationService, useClass: <%= configName %>ConfigurationService},
|
|
33
|
+
UserService
|
|
34
|
+
]
|
|
35
|
+
})
|
|
36
|
+
.compileComponents();
|
|
37
|
+
}));
|
|
38
|
+
|
|
39
|
+
beforeEach(() => {
|
|
40
|
+
fixture = TestBed.createComponent(<%= classify(className) %>Component);
|
|
41
|
+
component = fixture.componentInstance;
|
|
42
|
+
fixture.detectChanges();
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
it('should create', () => {
|
|
46
|
+
expect(component).toBeTruthy();
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import {Component, OnDestroy, OnInit} from '@angular/core';
|
|
2
|
+
import {
|
|
3
|
+
UserService,
|
|
4
|
+
SessionService,
|
|
5
|
+
AuthenticationService,
|
|
6
|
+
PublicUrlResolverService,
|
|
7
|
+
RedirectService
|
|
8
|
+
} from '@netgrif/components-core';
|
|
9
|
+
import {Router} from '@angular/router';
|
|
10
|
+
import {Subscription} from 'rxjs';
|
|
11
|
+
|
|
12
|
+
@Component({
|
|
13
|
+
selector: '<%= prefix %>-<%= dasherize(className) %>',
|
|
14
|
+
templateUrl: './<%= dasherize(className) %>.component.html',
|
|
15
|
+
styleUrls: ['./<%= dasherize(className) %>.component.scss']
|
|
16
|
+
})
|
|
17
|
+
export class <%= classify(className) %>Component implements OnInit, OnDestroy {
|
|
18
|
+
|
|
19
|
+
private _userSub: Subscription;
|
|
20
|
+
|
|
21
|
+
constructor(protected _userService: UserService, protected _sessionService: SessionService, protected _router: Router,
|
|
22
|
+
protected _auth: AuthenticationService, protected _publicResolver: PublicUrlResolverService,
|
|
23
|
+
protected _redirectService: RedirectService) {
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
ngOnInit(): void {
|
|
27
|
+
this._userSub = this._userService.user$.subscribe(user => {
|
|
28
|
+
if (!!user && user.id !== '') {
|
|
29
|
+
this._router.navigate([this._redirectService.parseRedirectPath(this._publicResolver.url)],
|
|
30
|
+
{ queryParams: this._redirectService.queryParams });
|
|
31
|
+
this._publicResolver.url = undefined;
|
|
32
|
+
} else {
|
|
33
|
+
if (!this._sessionService.verified && !this._sessionService.isVerifying &&
|
|
34
|
+
this._sessionService.isInitialized && !this._auth.isAuthenticated) {
|
|
35
|
+
this._router.navigate([this._redirectService.parseRedirectPath(this._publicResolver.url)],
|
|
36
|
+
{ queryParams: this._redirectService.queryParams });
|
|
37
|
+
this._publicResolver.url = undefined;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
ngOnDestroy(): void {
|
|
44
|
+
this._userSub.unsubscribe();
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Rule, Tree } from '@angular-devkit/schematics';
|
|
2
|
+
import { TabbedView } from '../../models/tabbed-view';
|
|
3
|
+
import { CreateTaskViewArguments } from '../../models/create-task-view-arguments';
|
|
4
|
+
export declare function createPublicSingleTaskView(tree: Tree, args: CreateTaskViewArguments & TabbedView, addViewToService: boolean): Rule;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createPublicSingleTaskView = void 0;
|
|
4
|
+
const schematics_1 = require("@angular-devkit/schematics");
|
|
5
|
+
const core_1 = require("@angular-devkit/core");
|
|
6
|
+
const utility_functions_1 = require("../../../../_utility/utility-functions");
|
|
7
|
+
const view_utility_functions_1 = require("../../../_utility/view-utility-functions");
|
|
8
|
+
const view_service_functions_1 = require("../../../_utility/view-service-functions");
|
|
9
|
+
const view_class_info_1 = require("../../../../_commons/view-class-info");
|
|
10
|
+
const import_to_add_1 = require("../../../../_commons/import-to-add");
|
|
11
|
+
function createPublicSingleTaskView(tree, args, addViewToService) {
|
|
12
|
+
const projectInfo = (0, utility_functions_1.getProjectInfo)(tree);
|
|
13
|
+
const view = new view_class_info_1.ViewClassInfo(args.path, args.viewType, args.componentName);
|
|
14
|
+
const rules = [];
|
|
15
|
+
const templateParams = {
|
|
16
|
+
prefix: projectInfo.projectPrefixDasherized,
|
|
17
|
+
className: view.nameWithoutComponent,
|
|
18
|
+
dasherize: core_1.strings.dasherize,
|
|
19
|
+
classify: core_1.strings.classify,
|
|
20
|
+
};
|
|
21
|
+
const commonPathPrefix = './views/public-single-task-view/files/';
|
|
22
|
+
const destinationPath = `${projectInfo.path}/views/${args.path}`;
|
|
23
|
+
rules.push((0, utility_functions_1.createFilesFromTemplates)(`${commonPathPrefix}common`, destinationPath, templateParams));
|
|
24
|
+
(0, view_utility_functions_1.updateAppModule)(tree, view.className, view.fileImportPath, [
|
|
25
|
+
new import_to_add_1.ImportToAdd('FlexModule', '@angular/flex-layout'),
|
|
26
|
+
new import_to_add_1.ImportToAdd('MaterialModule', '@netgrif/components-core'),
|
|
27
|
+
new import_to_add_1.ImportToAdd('PanelComponentModule', '@netgrif/components'),
|
|
28
|
+
new import_to_add_1.ImportToAdd('SearchComponentModule', '@netgrif/components'),
|
|
29
|
+
new import_to_add_1.ImportToAdd('HeaderComponentModule', '@netgrif/components')
|
|
30
|
+
]);
|
|
31
|
+
if (addViewToService) {
|
|
32
|
+
(0, view_service_functions_1.addViewToViewService)(tree, view);
|
|
33
|
+
}
|
|
34
|
+
return (0, schematics_1.chain)(rules);
|
|
35
|
+
}
|
|
36
|
+
exports.createPublicSingleTaskView = createPublicSingleTaskView;
|
|
37
|
+
//# sourceMappingURL=create-public-single-task-view.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-public-single-task-view.js","sourceRoot":"","sources":["../../../../../../../projects/netgrif-components/schematics/view/create-view-prompt/views/public-single-task-view/create-public-single-task-view.ts"],"names":[],"mappings":";;;AAAA,2DAA6D;AAC7D,+CAA6C;AAC7C,8EAAgG;AAChG,qFAAyE;AACzE,qFAA8E;AAE9E,0EAAmE;AACnE,sEAA+D;AAI/D,SAAgB,0BAA0B,CAAC,IAAU,EAAE,IAA0C,EAAE,gBAAyB;IACxH,MAAM,WAAW,GAAG,IAAA,kCAAc,EAAC,IAAI,CAAC,CAAC;IACzC,MAAM,IAAI,GAAG,IAAI,+BAAa,CAC1B,IAAI,CAAC,IAAI,EACT,IAAI,CAAC,QAAQ,EACb,IAAI,CAAC,aAAa,CAAC,CAAC;IACxB,MAAM,KAAK,GAAG,EAAE,CAAC;IAEjB,MAAM,cAAc,GAAG;QACnB,MAAM,EAAE,WAAW,CAAC,uBAAuB;QAC3C,SAAS,EAAE,IAAI,CAAC,oBAAoB;QACpC,SAAS,EAAE,cAAO,CAAC,SAAS;QAC5B,QAAQ,EAAE,cAAO,CAAC,QAAQ;KAC7B,CAAC;IAEF,MAAM,gBAAgB,GAAG,wCAAwC,CAAC;IAClE,MAAM,eAAe,GAAG,GAAG,WAAW,CAAC,IAAI,UAAU,IAAI,CAAC,IAAI,EAAE,CAAC;IACjE,KAAK,CAAC,IAAI,CAAC,IAAA,4CAAwB,EAAC,GAAG,gBAAgB,QAAQ,EAAE,eAAe,EAAE,cAAc,CAAC,CAAC,CAAC;IAEnG,IAAA,wCAAe,EAAC,IAAI,EAAE,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,cAAc,EAAE;QACvD,IAAI,2BAAW,CAAC,YAAY,EAAE,sBAAsB,CAAC;QACrD,IAAI,2BAAW,CAAC,gBAAgB,EAAE,0BAA0B,CAAC;QAC7D,IAAI,2BAAW,CAAC,sBAAsB,EAAE,qBAAqB,CAAC;QAC9D,IAAI,2BAAW,CAAC,uBAAuB,EAAE,qBAAqB,CAAC;QAC/D,IAAI,2BAAW,CAAC,uBAAuB,EAAE,qBAAqB,CAAC;KAClE,CAAC,CAAC;IAEH,IAAI,gBAAgB,EAAE;QAClB,IAAA,6CAAoB,EAAC,IAAI,EAAE,IAAI,CAAC,CAAC;KACpC;IACD,OAAO,IAAA,kBAAK,EAAC,KAAK,CAAC,CAAC;AACxB,CAAC;AA/BD,gEA+BC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<div class="task-tab-background full-height">
|
|
2
|
+
<div fxLayout="column" fxLayoutAlign="start stretch" class="content-margin full-height" >
|
|
3
|
+
<nc-header [hidden]='hidden' #header type="task" class="task-panel-padding-mini"></nc-header>
|
|
4
|
+
<nc-single-task [task$]="task$" [loading$]="loading$" [selectedHeaders$]="selectedHeaders$" (taskEvent)="logEvent($event)"
|
|
5
|
+
[pageHeader]='pageHeader' [pageFooter]='pageFooter' [actionButtonTemplates]='[finishButton]'
|
|
6
|
+
[actionRowJustifyContent]='"center"' fxFlex></nc-single-task>
|
|
7
|
+
</div>
|
|
8
|
+
</div>
|
|
9
|
+
|
|
10
|
+
<ng-template #finishButton let-finish="finish">
|
|
11
|
+
<div class="public-button-padding">
|
|
12
|
+
<button mat-raised-button color="primary" class="public-button"
|
|
13
|
+
(click)="finish();">
|
|
14
|
+
<span>{{ 'singleTask.finishButtonTitle' | translate }}</span>
|
|
15
|
+
</button>
|
|
16
|
+
</div>
|
|
17
|
+
</ng-template>
|
|
18
|
+
|
|
19
|
+
<ng-template #pageHeader>
|
|
20
|
+
<div>
|
|
21
|
+
<!-- <img src="TODO LINK" alt="logo" class="logoimg"> -->
|
|
22
|
+
<mat-divider class="upper-divider"></mat-divider>
|
|
23
|
+
</div>
|
|
24
|
+
<mat-card class="upper-card">
|
|
25
|
+
<span class="upper-card-title"><strong>Example task title</strong></span>
|
|
26
|
+
</mat-card>
|
|
27
|
+
</ng-template>
|
|
28
|
+
|
|
29
|
+
<ng-template #pageFooter>
|
|
30
|
+
<mat-toolbar color="primary" class="footer-custom">
|
|
31
|
+
<!-- TODO -->
|
|
32
|
+
</mat-toolbar>
|
|
33
|
+
</ng-template>
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
.task-tab-background{
|
|
2
|
+
height: 100%;
|
|
3
|
+
width: 100%;
|
|
4
|
+
overflow: auto;
|
|
5
|
+
background-color: transparent;
|
|
6
|
+
}
|
|
7
|
+
.search-panel{
|
|
8
|
+
margin-top: 8px;
|
|
9
|
+
}
|
|
10
|
+
.content-margin{
|
|
11
|
+
margin: 0 8px;
|
|
12
|
+
}
|
|
13
|
+
.task-panel-padding-mini{
|
|
14
|
+
padding-bottom: 8px;
|
|
15
|
+
padding-top: 8px;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.search-width {
|
|
19
|
+
width: 100%;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.full-height {
|
|
23
|
+
height: 100%;
|
|
24
|
+
}
|
|
25
|
+
.public-button {
|
|
26
|
+
height: 36px;
|
|
27
|
+
width: 200px;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.public-button-padding {
|
|
31
|
+
padding: 16px;
|
|
32
|
+
flex-direction: column;
|
|
33
|
+
display: flex;
|
|
34
|
+
align-items: center;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.single-page-task {
|
|
38
|
+
width: 85% !important;
|
|
39
|
+
padding-bottom: 25px;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.logoimg {
|
|
43
|
+
height: 120px;
|
|
44
|
+
outline: none !important;
|
|
45
|
+
cursor: pointer;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.upper-card {
|
|
49
|
+
margin-bottom: 10px;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.upper-card-title {
|
|
53
|
+
display: flex;
|
|
54
|
+
align-items: center;
|
|
55
|
+
flex-direction: column;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.upper-divider {
|
|
59
|
+
border-top-width: 20px;
|
|
60
|
+
border-top-color: #023b7e;
|
|
61
|
+
border-radius: 4px;
|
|
62
|
+
margin-bottom: 10px;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.footer-custom {
|
|
66
|
+
border-radius: 4px;
|
|
67
|
+
margin-bottom: 10px;
|
|
68
|
+
}
|
|
69
|
+
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import {waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
import { <%= classify(className) %>Component } from './<%= dasherize(className) %>.component';
|
|
3
|
+
import {
|
|
4
|
+
MaterialModule,
|
|
5
|
+
ConfigurationService,
|
|
6
|
+
AuthenticationMethodService,
|
|
7
|
+
NAE_TAB_DATA,
|
|
8
|
+
SimpleFilter,
|
|
9
|
+
FilterType
|
|
10
|
+
} from '@netgrif/components-core';
|
|
11
|
+
import {
|
|
12
|
+
HeaderComponentModule,
|
|
13
|
+
PanelComponentModule,
|
|
14
|
+
} from '@netgrif/components';
|
|
15
|
+
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
|
|
16
|
+
import {<%= configName %>ConfigurationService} from '<%= configImportPath %>';
|
|
17
|
+
import {Observable} from 'rxjs';
|
|
18
|
+
import {RouterTestingModule} from '@angular/router/testing';
|
|
19
|
+
|
|
20
|
+
describe('<%= classify(className) %>Component', () => {
|
|
21
|
+
let component: <%= classify(className) %>Component;
|
|
22
|
+
let fixture: ComponentFixture<<%= classify(className) %>Component>;
|
|
23
|
+
|
|
24
|
+
beforeEach(waitForAsync(() => {
|
|
25
|
+
TestBed.configureTestingModule({
|
|
26
|
+
imports: [
|
|
27
|
+
MaterialModule,
|
|
28
|
+
HeaderComponentModule,
|
|
29
|
+
PanelComponentModule,
|
|
30
|
+
BrowserAnimationsModule,
|
|
31
|
+
RouterTestingModule.withRoutes([])
|
|
32
|
+
],
|
|
33
|
+
providers: [
|
|
34
|
+
{provide: NAE_TAB_DATA, useValue: {baseFilter: new SimpleFilter('id', FilterType.TASK, {}), tabSelected$: new Observable()}},
|
|
35
|
+
AuthenticationMethodService,
|
|
36
|
+
{provide: ConfigurationService, useClass: <%= configName %>ConfigurationService}
|
|
37
|
+
],
|
|
38
|
+
declarations: [<%= classify(className) %>Component]
|
|
39
|
+
})
|
|
40
|
+
.compileComponents();
|
|
41
|
+
}));
|
|
42
|
+
|
|
43
|
+
beforeEach(() => {
|
|
44
|
+
fixture = TestBed.createComponent(<%= classify(className) %>Component);
|
|
45
|
+
component = fixture.componentInstance;
|
|
46
|
+
fixture.detectChanges();
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
it('should create', () => {
|
|
50
|
+
expect(component).toBeTruthy();
|
|
51
|
+
});
|
|
52
|
+
});
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import {AfterViewInit, Component, ViewChild} from '@angular/core';
|
|
2
|
+
import {
|
|
3
|
+
TaskEventNotification,
|
|
4
|
+
TaskViewService,
|
|
5
|
+
CaseResourceService,
|
|
6
|
+
PublicCaseResourceService,
|
|
7
|
+
PublicTaskResourceService,
|
|
8
|
+
SearchService,
|
|
9
|
+
PublicProcessService,
|
|
10
|
+
ProcessService,
|
|
11
|
+
TaskResourceService,
|
|
12
|
+
SnackBarService,
|
|
13
|
+
UserService,
|
|
14
|
+
SessionService,
|
|
15
|
+
PetriNetResourceService,
|
|
16
|
+
PublicPetriNetResourceService,
|
|
17
|
+
LoggerService,
|
|
18
|
+
ResourceProvider,
|
|
19
|
+
ConfigurationService,
|
|
20
|
+
FieldConverterService,
|
|
21
|
+
AuthenticationService,
|
|
22
|
+
PublicUrlResolverService,
|
|
23
|
+
publicBaseFilterFactory,
|
|
24
|
+
publicFactoryResolver,
|
|
25
|
+
AllowedNetsService,
|
|
26
|
+
PublicTaskLoadingService,
|
|
27
|
+
AllowedNetsServiceFactory,
|
|
28
|
+
NAE_VIEW_ID_SEGMENT,
|
|
29
|
+
ViewIdService,
|
|
30
|
+
NAE_BASE_FILTER,
|
|
31
|
+
ChangedFieldsService,
|
|
32
|
+
AbstractSingleTaskViewComponent,
|
|
33
|
+
TaskContentService,
|
|
34
|
+
TaskDataService,
|
|
35
|
+
FinishTaskService,
|
|
36
|
+
RedirectService,
|
|
37
|
+
SingleTaskContentService, TaskRequestStateService, TaskEventService, NAE_TASK_OPERATIONS, SubjectTaskOperations
|
|
38
|
+
} from '@netgrif/components-core';
|
|
39
|
+
import {HeaderComponent} from '@netgrif/components';
|
|
40
|
+
import {ActivatedRoute, Router} from '@angular/router';
|
|
41
|
+
import {TranslateService} from '@ngx-translate/core';
|
|
42
|
+
import {combineLatest} from 'rxjs';
|
|
43
|
+
import {map} from 'rxjs/operators';
|
|
44
|
+
|
|
45
|
+
const localAllowedNetsServiceFactory = (factory: AllowedNetsServiceFactory, route: ActivatedRoute) => {
|
|
46
|
+
const array = [];
|
|
47
|
+
if (route.snapshot.paramMap.get('petriNetId') !== null) {
|
|
48
|
+
array.push(route.snapshot.paramMap.get('petriNetId'));
|
|
49
|
+
}
|
|
50
|
+
return factory.createFromArray(array);
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
const processServiceFactory = (userService: UserService, sessionService: SessionService, authService: AuthenticationService,
|
|
54
|
+
router: Router, publicResolverService: PublicUrlResolverService, petriNetResource: PetriNetResourceService,
|
|
55
|
+
publicPetriNetResource: PublicPetriNetResourceService, loggerService: LoggerService, redirectService: RedirectService) => {
|
|
56
|
+
return publicFactoryResolver(userService, sessionService, authService, router, publicResolverService,
|
|
57
|
+
new ProcessService(petriNetResource, loggerService),
|
|
58
|
+
new PublicProcessService(publicPetriNetResource, loggerService), redirectService);
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
const taskResourceServiceFactory = (userService: UserService, sessionService: SessionService, authService: AuthenticationService,
|
|
62
|
+
router: Router, publicResolverService: PublicUrlResolverService,
|
|
63
|
+
logger: LoggerService, provider: ResourceProvider, config: ConfigurationService,
|
|
64
|
+
fieldConverter: FieldConverterService, redirectService: RedirectService) => {
|
|
65
|
+
return publicFactoryResolver(userService, sessionService, authService, router, publicResolverService,
|
|
66
|
+
new TaskResourceService(provider, config, fieldConverter, logger),
|
|
67
|
+
new PublicTaskResourceService(provider, config, fieldConverter, logger), redirectService);
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
const caseResourceServiceFactory = (userService: UserService, sessionService: SessionService, authService: AuthenticationService,
|
|
71
|
+
router: Router, publicResolverService: PublicUrlResolverService,
|
|
72
|
+
provider: ResourceProvider, config: ConfigurationService, redirectService: RedirectService) => {
|
|
73
|
+
return publicFactoryResolver(userService, sessionService, authService, router, publicResolverService,
|
|
74
|
+
new CaseResourceService(provider, config),
|
|
75
|
+
new PublicCaseResourceService(provider, config), redirectService);
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
@Component({
|
|
79
|
+
selector: '<%= prefix %>-<%= dasherize(className) %>',
|
|
80
|
+
templateUrl: './<%= dasherize(className) %>.component.html',
|
|
81
|
+
styleUrls: ['./<%= dasherize(className) %>.component.scss'],
|
|
82
|
+
providers: [
|
|
83
|
+
TaskViewService,
|
|
84
|
+
PublicTaskLoadingService,
|
|
85
|
+
SearchService,
|
|
86
|
+
ChangedFieldsService,
|
|
87
|
+
{
|
|
88
|
+
provide: ProcessService,
|
|
89
|
+
useFactory: processServiceFactory,
|
|
90
|
+
deps: [UserService, SessionService, AuthenticationService, Router, PublicUrlResolverService, PetriNetResourceService,
|
|
91
|
+
PublicPetriNetResourceService, LoggerService, RedirectService]
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
provide: TaskResourceService,
|
|
95
|
+
useFactory: taskResourceServiceFactory,
|
|
96
|
+
deps: [UserService, SessionService, AuthenticationService, Router, PublicUrlResolverService,
|
|
97
|
+
LoggerService, ResourceProvider, ConfigurationService, FieldConverterService, RedirectService]
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
provide: CaseResourceService,
|
|
101
|
+
useFactory: caseResourceServiceFactory,
|
|
102
|
+
deps: [UserService, SessionService, AuthenticationService, Router, PublicUrlResolverService,
|
|
103
|
+
ResourceProvider, ConfigurationService, RedirectService]
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
provide: NAE_BASE_FILTER,
|
|
107
|
+
useFactory: publicBaseFilterFactory,
|
|
108
|
+
deps: [Router, ActivatedRoute, ProcessService, CaseResourceService, SnackBarService, TranslateService, PublicTaskLoadingService]
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
provide: AllowedNetsService,
|
|
112
|
+
useFactory: localAllowedNetsServiceFactory,
|
|
113
|
+
deps: [AllowedNetsServiceFactory, ActivatedRoute]
|
|
114
|
+
},
|
|
115
|
+
{ provide: NAE_VIEW_ID_SEGMENT, useValue: 'publicView'},
|
|
116
|
+
ViewIdService,
|
|
117
|
+
{provide: TaskContentService, useClass: SingleTaskContentService},
|
|
118
|
+
TaskDataService,
|
|
119
|
+
FinishTaskService,
|
|
120
|
+
TaskRequestStateService,
|
|
121
|
+
TaskEventService,
|
|
122
|
+
{provide: NAE_TASK_OPERATIONS, useClass: SubjectTaskOperations},
|
|
123
|
+
]
|
|
124
|
+
})
|
|
125
|
+
export class <%= classify(className) %>Component extends AbstractSingleTaskViewComponent implements AfterViewInit {
|
|
126
|
+
|
|
127
|
+
@ViewChild('header') public taskHeaderComponent: HeaderComponent;
|
|
128
|
+
|
|
129
|
+
hidden: boolean;
|
|
130
|
+
|
|
131
|
+
constructor(taskViewService: TaskViewService, publicTaskLoadingService: PublicTaskLoadingService,
|
|
132
|
+
activatedRoute: ActivatedRoute) {
|
|
133
|
+
super(taskViewService, activatedRoute);
|
|
134
|
+
this.hidden = true;
|
|
135
|
+
this.loading$ = combineLatest(taskViewService.loading$, publicTaskLoadingService.loading$).pipe(
|
|
136
|
+
map(sources => {
|
|
137
|
+
return sources[0] || sources[1];
|
|
138
|
+
})
|
|
139
|
+
);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
ngAfterViewInit(): void {
|
|
143
|
+
this.initializeHeader(this.taskHeaderComponent);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
logEvent(event: TaskEventNotification) {
|
|
147
|
+
console.log(event);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
}
|
|
151
|
+
|
package/schematics/view/create-view-prompt/views/public-task-view/create-public-task-view.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Rule, Tree } from '@angular-devkit/schematics';
|
|
2
|
+
import { TabbedView } from '../../models/tabbed-view';
|
|
3
|
+
import { CreateTaskViewArguments } from '../../models/create-task-view-arguments';
|
|
4
|
+
export declare function createPublicTaskView(tree: Tree, args: CreateTaskViewArguments & TabbedView, addViewToService: boolean): Rule;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createPublicTaskView = void 0;
|
|
4
|
+
const schematics_1 = require("@angular-devkit/schematics");
|
|
5
|
+
const core_1 = require("@angular-devkit/core");
|
|
6
|
+
const utility_functions_1 = require("../../../../_utility/utility-functions");
|
|
7
|
+
const view_utility_functions_1 = require("../../../_utility/view-utility-functions");
|
|
8
|
+
const view_service_functions_1 = require("../../../_utility/view-service-functions");
|
|
9
|
+
const view_class_info_1 = require("../../../../_commons/view-class-info");
|
|
10
|
+
const import_to_add_1 = require("../../../../_commons/import-to-add");
|
|
11
|
+
function createPublicTaskView(tree, args, addViewToService) {
|
|
12
|
+
const projectInfo = (0, utility_functions_1.getProjectInfo)(tree);
|
|
13
|
+
const view = new view_class_info_1.ViewClassInfo(args.path, args.viewType, args.componentName);
|
|
14
|
+
const rules = [];
|
|
15
|
+
const templateParams = {
|
|
16
|
+
prefix: projectInfo.projectPrefixDasherized,
|
|
17
|
+
className: view.nameWithoutComponent,
|
|
18
|
+
dasherize: core_1.strings.dasherize,
|
|
19
|
+
classify: core_1.strings.classify,
|
|
20
|
+
};
|
|
21
|
+
const commonPathPrefix = './views/public-task-view/files/';
|
|
22
|
+
const destinationPath = `${projectInfo.path}/views/${args.path}`;
|
|
23
|
+
rules.push((0, utility_functions_1.createFilesFromTemplates)(`${commonPathPrefix}common`, destinationPath, templateParams));
|
|
24
|
+
(0, view_utility_functions_1.updateAppModule)(tree, view.className, view.fileImportPath, [
|
|
25
|
+
new import_to_add_1.ImportToAdd('FlexModule', '@angular/flex-layout'),
|
|
26
|
+
new import_to_add_1.ImportToAdd('MaterialModule', '@netgrif/components-core'),
|
|
27
|
+
new import_to_add_1.ImportToAdd('PanelComponentModule', '@netgrif/components'),
|
|
28
|
+
new import_to_add_1.ImportToAdd('SearchComponentModule', '@netgrif/components'),
|
|
29
|
+
new import_to_add_1.ImportToAdd('HeaderComponentModule', '@netgrif/components')
|
|
30
|
+
]);
|
|
31
|
+
if (addViewToService) {
|
|
32
|
+
(0, view_service_functions_1.addViewToViewService)(tree, view);
|
|
33
|
+
}
|
|
34
|
+
return (0, schematics_1.chain)(rules);
|
|
35
|
+
}
|
|
36
|
+
exports.createPublicTaskView = createPublicTaskView;
|
|
37
|
+
//# sourceMappingURL=create-public-task-view.js.map
|