@valtimo/dashboard 4.15.2-next-main.15 → 4.15.3-next-main.16

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.
@@ -4,203 +4,199 @@
4
4
  (global = global || self, factory((global.valtimo = global.valtimo || {}, global.valtimo.dashboard = {}), global.ng.core, global.core$1, global.context, global.ng.router, global.task, global.moment, global.rxjs.operators, global.rxjs, global.ng.common, global.httpLoader, global.security, global.contract, global.components, global.ng.common.http));
5
5
  }(this, (function (exports, core, core$1, context, router, task, moment_, operators, rxjs, common, httpLoader, security, contract, components, http) { 'use strict';
6
6
 
7
- /*
8
- * Copyright 2015-2020 Ritense BV, the Netherlands.
9
- *
10
- * Licensed under EUPL, Version 1.2 (the "License");
11
- * you may not use this file except in compliance with the License.
12
- * You may obtain a copy of the License at
13
- *
14
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
15
- *
16
- * Unless required by applicable law or agreed to in writing, software
17
- * distributed under the License is distributed on an "AS IS" basis,
18
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
- * See the License for the specific language governing permissions and
20
- * limitations under the License.
21
- */
22
- var moment = moment_;
23
- moment.locale(localStorage.getItem('langKey') || '');
24
- moment.defaultFormat = 'DD MMM YYYY HH:mm';
25
- var DashboardComponent = /** @class */ (function () {
26
- function DashboardComponent(router, contextService, taskService, route, translate) {
27
- this.router = router;
28
- this.contextService = contextService;
29
- this.taskService = taskService;
30
- this.route = route;
31
- this.translate = translate;
32
- this.openTaskFields = [
33
- {
34
- key: 'created',
35
- label: 'Created'
36
- },
37
- {
38
- key: 'name',
39
- label: 'Name'
40
- },
41
- {
42
- key: 'valtimoAssignee.fullName',
43
- label: 'Assignee'
44
- }
45
- ];
46
- this.loading$ = new rxjs.BehaviorSubject(true);
47
- }
48
- DashboardComponent.prototype.ngOnInit = function () {
49
- this.getOpenTasks();
50
- };
51
- DashboardComponent.prototype.getOpenTasks = function () {
52
- var _this = this;
53
- this.taskService.getTasks().subscribe(function (response) {
54
- _this.openTasks = response;
55
- _this.openTasks.map(function (task) {
56
- task.created = moment(task.created).format('DD MMM YYYY HH:mm');
57
- });
58
- _this.checkRouteForTaskId(response);
59
- _this.loading$.next(false);
60
- });
61
- };
62
- DashboardComponent.prototype.rowOpenTaskClick = function (task) {
63
- if (!task.endTime) {
64
- this.taskDetail.openTaskDetails(task);
65
- }
66
- };
67
- DashboardComponent.prototype.checkRouteForTaskId = function (tasks) {
68
- var _this = this;
69
- this.route.queryParams.pipe(operators.take(1))
70
- .subscribe(function (params) {
71
- var taskId = params === null || params === void 0 ? void 0 : params.taskId;
72
- var findTaskFromId = tasks.find(function (task) { return task.id === taskId; });
73
- if (findTaskFromId) {
74
- _this.rowOpenTaskClick(findTaskFromId);
75
- }
76
- });
77
- };
78
- return DashboardComponent;
79
- }());
80
- DashboardComponent.decorators = [
81
- { type: core.Component, args: [{
82
- selector: 'valtimo-dashboard',
83
- template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div class=\"px-3\">\n <div class=\"main-content container-fluid\" *ngIf=\"{loading: loading$ | async} as obs\">\n <h4 class=\"title\">\n {{ 'dashboard.openTasks.title' | translate }}\n <sup *ngIf=\"obs.loading === false\" class=\"ml-1 badge badge-pill badge-primary\">{{ openTasks?.length }}</sup>\n </h4>\n <ng-container *ngIf=\"obs.loading === false; else loading\">\n <valtimo-widget>\n <valtimo-list\n [items]=\"openTasks\"\n [fields]=\"openTaskFields\"\n (rowClicked)=\"rowOpenTaskClick($event)\"\n ></valtimo-list>\n </valtimo-widget>\n </ng-container>\n <valtimo-task-detail-modal\n #taskDetail\n (formSubmit)=\"getOpenTasks()\"\n (assignmentOfTaskChanged)=\"getOpenTasks()\"\n ></valtimo-task-detail-modal>\n </div>\n</div>\n\n<ng-template #loading>\n <valtimo-spinner></valtimo-spinner>\n</ng-template>\n",
84
- styles: [""]
85
- },] }
86
- ];
87
- DashboardComponent.ctorParameters = function () { return [
88
- { type: router.Router },
89
- { type: context.ContextService },
90
- { type: task.TaskService },
91
- { type: router.ActivatedRoute },
92
- { type: core$1.TranslateService }
93
- ]; };
94
- DashboardComponent.propDecorators = {
95
- taskDetail: [{ type: core.ViewChild, args: ['taskDetail',] }]
7
+ /*
8
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
9
+ *
10
+ * Licensed under EUPL, Version 1.2 (the "License");
11
+ * you may not use this file except in compliance with the License.
12
+ * You may obtain a copy of the License at
13
+ *
14
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
15
+ *
16
+ * Unless required by applicable law or agreed to in writing, software
17
+ * distributed under the License is distributed on an "AS IS" basis,
18
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
+ * See the License for the specific language governing permissions and
20
+ * limitations under the License.
21
+ */
22
+ var moment = moment_;
23
+ moment.locale(localStorage.getItem('langKey') || '');
24
+ moment.defaultFormat = 'DD MMM YYYY HH:mm';
25
+ var DashboardComponent = /** @class */ (function () {
26
+ function DashboardComponent(router, contextService, taskService, route, translate) {
27
+ this.router = router;
28
+ this.contextService = contextService;
29
+ this.taskService = taskService;
30
+ this.route = route;
31
+ this.translate = translate;
32
+ this.openTaskFields = [
33
+ {
34
+ key: 'created',
35
+ label: 'Created',
36
+ },
37
+ {
38
+ key: 'name',
39
+ label: 'Name',
40
+ },
41
+ {
42
+ key: 'valtimoAssignee.fullName',
43
+ label: 'Assignee',
44
+ },
45
+ ];
46
+ this.loading$ = new rxjs.BehaviorSubject(true);
47
+ }
48
+ DashboardComponent.prototype.ngOnInit = function () {
49
+ this.getOpenTasks();
50
+ };
51
+ DashboardComponent.prototype.getOpenTasks = function () {
52
+ var _this = this;
53
+ this.taskService.getTasks().subscribe(function (response) {
54
+ _this.openTasks = response;
55
+ _this.openTasks.map(function (task) {
56
+ task.created = moment(task.created).format('DD MMM YYYY HH:mm');
57
+ });
58
+ _this.checkRouteForTaskId(response);
59
+ _this.loading$.next(false);
60
+ });
61
+ };
62
+ DashboardComponent.prototype.rowOpenTaskClick = function (task) {
63
+ if (!task.endTime) {
64
+ this.taskDetail.openTaskDetails(task);
65
+ }
66
+ };
67
+ DashboardComponent.prototype.checkRouteForTaskId = function (tasks) {
68
+ var _this = this;
69
+ this.route.queryParams.pipe(operators.take(1)).subscribe(function (params) {
70
+ var taskId = params === null || params === void 0 ? void 0 : params.taskId;
71
+ var findTaskFromId = tasks.find(function (task) { return task.id === taskId; });
72
+ if (findTaskFromId) {
73
+ _this.rowOpenTaskClick(findTaskFromId);
74
+ }
75
+ });
76
+ };
77
+ return DashboardComponent;
78
+ }());
79
+ DashboardComponent.decorators = [
80
+ { type: core.Component, args: [{
81
+ selector: 'valtimo-dashboard',
82
+ template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div class=\"px-3\">\n <div class=\"main-content container-fluid\" *ngIf=\"{loading: loading$ | async} as obs\">\n <h4 class=\"title\">\n {{ 'dashboard.openTasks.title' | translate }}\n <sup *ngIf=\"obs.loading === false\" class=\"ml-1 badge badge-pill badge-primary\">{{\n openTasks?.length\n }}</sup>\n </h4>\n <ng-container *ngIf=\"obs.loading === false; else loading\">\n <valtimo-widget>\n <valtimo-list\n [items]=\"openTasks\"\n [fields]=\"openTaskFields\"\n (rowClicked)=\"rowOpenTaskClick($event)\"\n ></valtimo-list>\n </valtimo-widget>\n </ng-container>\n <valtimo-task-detail-modal\n #taskDetail\n (formSubmit)=\"getOpenTasks()\"\n (assignmentOfTaskChanged)=\"getOpenTasks()\"\n ></valtimo-task-detail-modal>\n </div>\n</div>\n\n<ng-template #loading>\n <valtimo-spinner></valtimo-spinner>\n</ng-template>\n",
83
+ styles: [""]
84
+ },] }
85
+ ];
86
+ DashboardComponent.ctorParameters = function () { return [
87
+ { type: router.Router },
88
+ { type: context.ContextService },
89
+ { type: task.TaskService },
90
+ { type: router.ActivatedRoute },
91
+ { type: core$1.TranslateService }
92
+ ]; };
93
+ DashboardComponent.propDecorators = {
94
+ taskDetail: [{ type: core.ViewChild, args: ['taskDetail',] }]
96
95
  };
97
96
 
98
- /*
99
- * Copyright 2015-2020 Ritense BV, the Netherlands.
100
- *
101
- * Licensed under EUPL, Version 1.2 (the "License");
102
- * you may not use this file except in compliance with the License.
103
- * You may obtain a copy of the License at
104
- *
105
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
106
- *
107
- * Unless required by applicable law or agreed to in writing, software
108
- * distributed under the License is distributed on an "AS IS" basis,
109
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
110
- * See the License for the specific language governing permissions and
111
- * limitations under the License.
112
- */
113
- var ɵ0 = { title: 'Dashboard', roles: [contract.ROLE_USER] };
114
- var routes = [
115
- {
116
- path: '',
117
- component: DashboardComponent,
118
- canActivate: [security.AuthGuardService],
119
- data: ɵ0
120
- }
121
- ];
122
- var DashboardRoutingModule = /** @class */ (function () {
123
- function DashboardRoutingModule() {
124
- }
125
- return DashboardRoutingModule;
126
- }());
127
- DashboardRoutingModule.decorators = [
128
- { type: core.NgModule, args: [{
129
- declarations: [],
130
- imports: [
131
- common.CommonModule,
132
- router.RouterModule.forChild(routes)
133
- ],
134
- exports: [router.RouterModule]
135
- },] }
97
+ /*
98
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
99
+ *
100
+ * Licensed under EUPL, Version 1.2 (the "License");
101
+ * you may not use this file except in compliance with the License.
102
+ * You may obtain a copy of the License at
103
+ *
104
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
105
+ *
106
+ * Unless required by applicable law or agreed to in writing, software
107
+ * distributed under the License is distributed on an "AS IS" basis,
108
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
109
+ * See the License for the specific language governing permissions and
110
+ * limitations under the License.
111
+ */
112
+ var ɵ0 = { title: 'Dashboard', roles: [contract.ROLE_USER] };
113
+ var routes = [
114
+ {
115
+ path: '',
116
+ component: DashboardComponent,
117
+ canActivate: [security.AuthGuardService],
118
+ data: ɵ0,
119
+ },
120
+ ];
121
+ var DashboardRoutingModule = /** @class */ (function () {
122
+ function DashboardRoutingModule() {
123
+ }
124
+ return DashboardRoutingModule;
125
+ }());
126
+ DashboardRoutingModule.decorators = [
127
+ { type: core.NgModule, args: [{
128
+ declarations: [],
129
+ imports: [common.CommonModule, router.RouterModule.forChild(routes)],
130
+ exports: [router.RouterModule],
131
+ },] }
136
132
  ];
137
133
 
138
- /*
139
- * Copyright 2015-2020 Ritense BV, the Netherlands.
140
- *
141
- * Licensed under EUPL, Version 1.2 (the "License");
142
- * you may not use this file except in compliance with the License.
143
- * You may obtain a copy of the License at
144
- *
145
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
146
- *
147
- * Unless required by applicable law or agreed to in writing, software
148
- * distributed under the License is distributed on an "AS IS" basis,
149
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
150
- * See the License for the specific language governing permissions and
151
- * limitations under the License.
152
- */
153
- // AoT requires an exported function for factories
154
- function HttpLoaderFactory(httpClient) {
155
- return new httpLoader.TranslateHttpLoader(httpClient);
156
- }
157
- var DashboardModule = /** @class */ (function () {
158
- function DashboardModule() {
159
- }
160
- return DashboardModule;
161
- }());
162
- DashboardModule.decorators = [
163
- { type: core.NgModule, args: [{
164
- declarations: [DashboardComponent],
165
- imports: [
166
- common.CommonModule,
167
- DashboardRoutingModule,
168
- components.WidgetModule,
169
- components.ListModule,
170
- components.BpmnJsDiagramModule,
171
- core$1.TranslateModule.forRoot({
172
- loader: {
173
- provide: core$1.TranslateLoader,
174
- useFactory: HttpLoaderFactory,
175
- deps: [http.HttpClient]
176
- }
177
- }),
178
- components.AlertModule,
179
- task.TaskModule,
180
- components.SpinnerModule
181
- ],
182
- exports: [DashboardComponent]
183
- },] }
134
+ /*
135
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
136
+ *
137
+ * Licensed under EUPL, Version 1.2 (the "License");
138
+ * you may not use this file except in compliance with the License.
139
+ * You may obtain a copy of the License at
140
+ *
141
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
142
+ *
143
+ * Unless required by applicable law or agreed to in writing, software
144
+ * distributed under the License is distributed on an "AS IS" basis,
145
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
146
+ * See the License for the specific language governing permissions and
147
+ * limitations under the License.
148
+ */
149
+ // AoT requires an exported function for factories
150
+ function HttpLoaderFactory(httpClient) {
151
+ return new httpLoader.TranslateHttpLoader(httpClient);
152
+ }
153
+ var DashboardModule = /** @class */ (function () {
154
+ function DashboardModule() {
155
+ }
156
+ return DashboardModule;
157
+ }());
158
+ DashboardModule.decorators = [
159
+ { type: core.NgModule, args: [{
160
+ declarations: [DashboardComponent],
161
+ imports: [
162
+ common.CommonModule,
163
+ DashboardRoutingModule,
164
+ components.WidgetModule,
165
+ components.ListModule,
166
+ components.BpmnJsDiagramModule,
167
+ core$1.TranslateModule.forRoot({
168
+ loader: {
169
+ provide: core$1.TranslateLoader,
170
+ useFactory: HttpLoaderFactory,
171
+ deps: [http.HttpClient],
172
+ },
173
+ }),
174
+ components.AlertModule,
175
+ task.TaskModule,
176
+ components.SpinnerModule,
177
+ ],
178
+ exports: [DashboardComponent],
179
+ },] }
184
180
  ];
185
181
 
186
- /*
187
- * Copyright 2015-2020 Ritense BV, the Netherlands.
188
- *
189
- * Licensed under EUPL, Version 1.2 (the "License");
190
- * you may not use this file except in compliance with the License.
191
- * You may obtain a copy of the License at
192
- *
193
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
194
- *
195
- * Unless required by applicable law or agreed to in writing, software
196
- * distributed under the License is distributed on an "AS IS" basis,
197
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
198
- * See the License for the specific language governing permissions and
199
- * limitations under the License.
182
+ /*
183
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
184
+ *
185
+ * Licensed under EUPL, Version 1.2 (the "License");
186
+ * you may not use this file except in compliance with the License.
187
+ * You may obtain a copy of the License at
188
+ *
189
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
190
+ *
191
+ * Unless required by applicable law or agreed to in writing, software
192
+ * distributed under the License is distributed on an "AS IS" basis,
193
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
194
+ * See the License for the specific language governing permissions and
195
+ * limitations under the License.
200
196
  */
201
197
 
202
- /**
203
- * Generated bundle index. Do not edit.
198
+ /**
199
+ * Generated bundle index. Do not edit.
204
200
  */
205
201
 
206
202
  exports.DashboardComponent = DashboardComponent;
@@ -1 +1 @@
1
- {"version":3,"file":"valtimo-dashboard.umd.js","sources":["../../../../projects/valtimo/dashboard/src/lib/dashboard.component.ts","../../../../projects/valtimo/dashboard/src/lib/dashboard-routing.module.ts","../../../../projects/valtimo/dashboard/src/lib/dashboard.module.ts","../../../../projects/valtimo/dashboard/src/public_api.ts","../../../../projects/valtimo/dashboard/src/valtimo-dashboard.ts"],"sourcesContent":["/*\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {Component, OnInit, ViewChild} from '@angular/core';\nimport { TranslateService } from '@ngx-translate/core';\nimport { ContextService } from '@valtimo/context';\nimport {ActivatedRoute, Router} from '@angular/router';\nimport { TaskDetailModalComponent, TaskService } from '@valtimo/task';\nimport * as moment_ from 'moment';\nimport {take} from 'rxjs/operators';\nimport {Task} from '@valtimo/contract';\nimport {BehaviorSubject} from 'rxjs';\nimport {NgxSpinnerService} from 'ngx-spinner';\n\nconst moment = moment_;\nmoment.locale(localStorage.getItem('langKey') || '');\nmoment.defaultFormat = 'DD MMM YYYY HH:mm';\n\n@Component({\n selector: 'valtimo-dashboard',\n templateUrl: './dashboard.component.html',\n styleUrls: ['./dashboard.component.css']\n})\nexport class DashboardComponent implements OnInit {\n public processDefinitions: Array<any>;\n public openTasks: Array<any>;\n public openTaskFields = [\n {\n key: 'created',\n label: 'Created'\n },\n {\n key: 'name',\n label: 'Name'\n },\n {\n key: 'valtimoAssignee.fullName',\n label: 'Assignee'\n }\n ];\n @ViewChild('taskDetail') taskDetail: TaskDetailModalComponent;\n\n loading$ = new BehaviorSubject<boolean>(true);\n\n constructor(\n private router: Router,\n private contextService: ContextService,\n private taskService: TaskService,\n private readonly route: ActivatedRoute,\n public translate: TranslateService,\n ) {\n }\n\n ngOnInit() {\n this.getOpenTasks();\n }\n\n public getOpenTasks() {\n this.taskService.getTasks().subscribe((response) => {\n this.openTasks = response;\n this.openTasks.map((task) => {\n task.created = moment(task.created).format('DD MMM YYYY HH:mm');\n });\n this.checkRouteForTaskId(response);\n this.loading$.next(false);\n });\n }\n\n public rowOpenTaskClick(task) {\n if (!task.endTime) {\n this.taskDetail.openTaskDetails(task);\n }\n }\n\n private checkRouteForTaskId(tasks: Array<Task>): void {\n this.route.queryParams.pipe(take(1))\n .subscribe((params) => {\n const taskId = params?.taskId;\n const findTaskFromId = tasks.find((task) => task.id === taskId);\n\n if (findTaskFromId) {\n this.rowOpenTaskClick(findTaskFromId);\n }\n });\n }\n}\n","/*\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {NgModule} from '@angular/core';\nimport {RouterModule, Routes} from '@angular/router';\nimport {CommonModule} from '@angular/common';\nimport {AuthGuardService} from '@valtimo/security';\nimport {DashboardComponent} from './dashboard.component';\nimport {ROLE_USER} from '@valtimo/contract';\n\nconst routes: Routes = [\n {\n path: '',\n component: DashboardComponent,\n canActivate: [AuthGuardService],\n data: {title: 'Dashboard', roles: [ROLE_USER]}\n }\n];\n\n@NgModule({\n declarations: [],\n imports: [\n CommonModule,\n RouterModule.forChild(routes)\n ],\n exports: [RouterModule]\n})\nexport class DashboardRoutingModule {\n}\n","/*\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {NgModule} from '@angular/core';\nimport {CommonModule} from '@angular/common';\nimport {TranslateLoader, TranslateModule} from '@ngx-translate/core';\nimport {TranslateHttpLoader} from '@ngx-translate/http-loader';\nimport {DashboardComponent} from './dashboard.component';\nimport {DashboardRoutingModule} from './dashboard-routing.module';\nimport {AlertModule, BpmnJsDiagramModule, ListModule, SpinnerModule, WidgetModule} from '@valtimo/components';\nimport {HttpClient} from '@angular/common/http';\nimport {TaskModule} from '@valtimo/task';\n\n// AoT requires an exported function for factories\nexport function HttpLoaderFactory(httpClient: HttpClient) {\n return new TranslateHttpLoader(httpClient);\n}\n\n@NgModule({\n declarations: [DashboardComponent],\n imports: [\n CommonModule,\n DashboardRoutingModule,\n WidgetModule,\n ListModule,\n BpmnJsDiagramModule,\n TranslateModule.forRoot({\n loader: {\n provide: TranslateLoader,\n useFactory: HttpLoaderFactory,\n deps: [HttpClient]\n }\n }),\n AlertModule,\n TaskModule,\n SpinnerModule\n ],\n exports: [DashboardComponent]\n})\nexport class DashboardModule {\n}\n","/*\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/*\n * Public API Surface of dashboard\n */\n\nexport * from './lib/dashboard.component';\nexport * from './lib/dashboard.module';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n\nexport {DashboardRoutingModule as ɵa} from './lib/dashboard-routing.module';"],"names":["BehaviorSubject","take","Component","Router","ContextService","TaskService","ActivatedRoute","TranslateService","ViewChild","ROLE_USER","AuthGuardService","NgModule","CommonModule","RouterModule","TranslateHttpLoader","WidgetModule","ListModule","BpmnJsDiagramModule","TranslateModule","TranslateLoader","HttpClient","AlertModule","TaskModule","SpinnerModule"],"mappings":";;;;;;IAAA;;;;;;;;;;;;;;;IA2BA,IAAM,MAAM,GAAG,OAAO,CAAC;IACvB,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC,CAAC;IACrD,MAAM,CAAC,aAAa,GAAG,mBAAmB,CAAC;;QA4BzC,4BACU,MAAc,EACd,cAA8B,EAC9B,WAAwB,EACf,KAAqB,EAC/B,SAA2B;YAJ1B,WAAM,GAAN,MAAM,CAAQ;YACd,mBAAc,GAAd,cAAc,CAAgB;YAC9B,gBAAW,GAAX,WAAW,CAAa;YACf,UAAK,GAAL,KAAK,CAAgB;YAC/B,cAAS,GAAT,SAAS,CAAkB;YAvB7B,mBAAc,GAAG;gBACtB;oBACE,GAAG,EAAE,SAAS;oBACd,KAAK,EAAE,SAAS;iBACjB;gBACD;oBACE,GAAG,EAAE,MAAM;oBACX,KAAK,EAAE,MAAM;iBACd;gBACD;oBACE,GAAG,EAAE,0BAA0B;oBAC/B,KAAK,EAAE,UAAU;iBAClB;aACF,CAAC;YAGF,aAAQ,GAAG,IAAIA,oBAAe,CAAU,IAAI,CAAC,CAAC;SAS7C;QAED,qCAAQ,GAAR;YACE,IAAI,CAAC,YAAY,EAAE,CAAC;SACrB;QAEM,yCAAY,GAAZ;YAAA,iBASN;YARC,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE,CAAC,SAAS,CAAC,UAAC,QAAQ;gBAC7C,KAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;gBAC1B,KAAI,CAAC,SAAS,CAAC,GAAG,CAAC,UAAC,IAAI;oBACtB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAAC;iBACjE,CAAC,CAA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ARCC,aAAQ,SAAC;oBACR,YAAY,EAAE,EAAE;oBAChB,OAAO,EAAE;wBACPC,mBAAY;wBACZC,mBAAY,CAAC,QAAQ,CAAC,MAAM,CAAC;qBAC9B;oBACD,OAAO,EAAE,CAACA,mBAAY,CAAC;iBACxB;;;ICvCD;;;;;;;;;;;;;;;IA0BA;aACgB,iBAAiB,CAAC,UAAsB;QACtD,OAAO,IAAIC,8BAAmB,CAAC,UAAU,CAAC,CAAC;IAC7C,CAAC;;QAuBD;;;;;gBArBCH,aAAQ,SAAC;oBACR,YAAY,EAAE,CAAC,kBAAkB,CAAC;oBAChC,OAAO,EAAE;wBACLC,mBAAY;wBACZ,sBAAsB;wBACtBG,uBAAY;wBACZC,qBAAU;wBACVC,8BAAmB;wBACnBC,sBAAe,CAAC,OAAO,CAAC;4BACpB,MAAM,EAAE;gCACJ,OAAO,EAAEC,sBAAe;gCACxB,UAAU,EAAE,iBAAiB;gCAC7B,IAAI,EAAE,CAACC,eAAU,CAAC;6BACrB;yBACJ,CAAC;wBACFC,sBAAW;wBACXC,eAAU;wBACVC,wBAAa;qBAChB;oBACH,OAAO,EAAE,CAAC,kBAAkB,CAAC;iBAC9B;;;ICnDD;;;;;;;;;;;;;;;;ICAA;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"valtimo-dashboard.umd.js","sources":["../../../../projects/valtimo/dashboard/src/lib/dashboard.component.ts","../../../../projects/valtimo/dashboard/src/lib/dashboard-routing.module.ts","../../../../projects/valtimo/dashboard/src/lib/dashboard.module.ts","../../../../projects/valtimo/dashboard/src/public_api.ts","../../../../projects/valtimo/dashboard/src/valtimo-dashboard.ts"],"sourcesContent":["/*\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {Component, OnInit, ViewChild} from '@angular/core';\nimport {TranslateService} from '@ngx-translate/core';\nimport {ContextService} from '@valtimo/context';\nimport {ActivatedRoute, Router} from '@angular/router';\nimport {TaskDetailModalComponent, TaskService} from '@valtimo/task';\nimport * as moment_ from 'moment';\nimport {take} from 'rxjs/operators';\nimport {Task} from '@valtimo/contract';\nimport {BehaviorSubject} from 'rxjs';\nimport {NgxSpinnerService} from 'ngx-spinner';\n\nconst moment = moment_;\nmoment.locale(localStorage.getItem('langKey') || '');\nmoment.defaultFormat = 'DD MMM YYYY HH:mm';\n\n@Component({\n selector: 'valtimo-dashboard',\n templateUrl: './dashboard.component.html',\n styleUrls: ['./dashboard.component.css'],\n})\nexport class DashboardComponent implements OnInit {\n public processDefinitions: Array<any>;\n public openTasks: Array<any>;\n public openTaskFields = [\n {\n key: 'created',\n label: 'Created',\n },\n {\n key: 'name',\n label: 'Name',\n },\n {\n key: 'valtimoAssignee.fullName',\n label: 'Assignee',\n },\n ];\n @ViewChild('taskDetail') taskDetail: TaskDetailModalComponent;\n\n loading$ = new BehaviorSubject<boolean>(true);\n\n constructor(\n private router: Router,\n private contextService: ContextService,\n private taskService: TaskService,\n private readonly route: ActivatedRoute,\n public translate: TranslateService\n ) {}\n\n ngOnInit() {\n this.getOpenTasks();\n }\n\n public getOpenTasks() {\n this.taskService.getTasks().subscribe(response => {\n this.openTasks = response;\n this.openTasks.map(task => {\n task.created = moment(task.created).format('DD MMM YYYY HH:mm');\n });\n this.checkRouteForTaskId(response);\n this.loading$.next(false);\n });\n }\n\n public rowOpenTaskClick(task) {\n if (!task.endTime) {\n this.taskDetail.openTaskDetails(task);\n }\n }\n\n private checkRouteForTaskId(tasks: Array<Task>): void {\n this.route.queryParams.pipe(take(1)).subscribe(params => {\n const taskId = params?.taskId;\n const findTaskFromId = tasks.find(task => task.id === taskId);\n\n if (findTaskFromId) {\n this.rowOpenTaskClick(findTaskFromId);\n }\n });\n }\n}\n","/*\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {NgModule} from '@angular/core';\nimport {RouterModule, Routes} from '@angular/router';\nimport {CommonModule} from '@angular/common';\nimport {AuthGuardService} from '@valtimo/security';\nimport {DashboardComponent} from './dashboard.component';\nimport {ROLE_USER} from '@valtimo/contract';\n\nconst routes: Routes = [\n {\n path: '',\n component: DashboardComponent,\n canActivate: [AuthGuardService],\n data: {title: 'Dashboard', roles: [ROLE_USER]},\n },\n];\n\n@NgModule({\n declarations: [],\n imports: [CommonModule, RouterModule.forChild(routes)],\n exports: [RouterModule],\n})\nexport class DashboardRoutingModule {}\n","/*\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {NgModule} from '@angular/core';\nimport {CommonModule} from '@angular/common';\nimport {TranslateLoader, TranslateModule} from '@ngx-translate/core';\nimport {TranslateHttpLoader} from '@ngx-translate/http-loader';\nimport {DashboardComponent} from './dashboard.component';\nimport {DashboardRoutingModule} from './dashboard-routing.module';\nimport {\n AlertModule,\n BpmnJsDiagramModule,\n ListModule,\n SpinnerModule,\n WidgetModule,\n} from '@valtimo/components';\nimport {HttpClient} from '@angular/common/http';\nimport {TaskModule} from '@valtimo/task';\n\n// AoT requires an exported function for factories\nexport function HttpLoaderFactory(httpClient: HttpClient) {\n return new TranslateHttpLoader(httpClient);\n}\n\n@NgModule({\n declarations: [DashboardComponent],\n imports: [\n CommonModule,\n DashboardRoutingModule,\n WidgetModule,\n ListModule,\n BpmnJsDiagramModule,\n TranslateModule.forRoot({\n loader: {\n provide: TranslateLoader,\n useFactory: HttpLoaderFactory,\n deps: [HttpClient],\n },\n }),\n AlertModule,\n TaskModule,\n SpinnerModule,\n ],\n exports: [DashboardComponent],\n})\nexport class DashboardModule {}\n","/*\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/*\n * Public API Surface of dashboard\n */\n\nexport * from './lib/dashboard.component';\nexport * from './lib/dashboard.module';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n\nexport {DashboardRoutingModule as ɵa} from './lib/dashboard-routing.module';"],"names":["BehaviorSubject","take","Component","Router","ContextService","TaskService","ActivatedRoute","TranslateService","ViewChild","ROLE_USER","AuthGuardService","NgModule","CommonModule","RouterModule","TranslateHttpLoader","WidgetModule","ListModule","BpmnJsDiagramModule","TranslateModule","TranslateLoader","HttpClient","AlertModule","TaskModule","SpinnerModule"],"mappings":";;;;;;IAAA;;;;;;;;;;;;;;;IA2BA,IAAM,MAAM,GAAG,OAAO,CAAC;IACvB,MAAM,CAAC,MAAM,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B,iBAAiB,CAAC,UAAsB;QACtD,OAAO,IAAIC,8BAAmB,CAAC,UAAU,CAAC,CAAC;IAC7C,CAAC;;QAuBD;;;;;gBArBCH,aAAQ,SAAC;oBACR,YAAY,EAAE,CAAC,kBAAkB,CAAC;oBAClC,OAAO,EAAE;wBACPC,mBAAY;wBACZ,sBAAsB;wBACtBG,uBAAY;wBACZC,qBAAU;wBACVC,8BAAmB;wBACnBC,sBAAe,CAAC,OAAO,CAAC;4BACtB,MAAM,EAAE;gCACN,OAAO,EAAEC,sBAAe;gCACxB,UAAU,EAAE,iBAAiB;gCAC7B,IAAI,EAAE,CAACC,eAAU,CAAC;6BACnB;yBACF,CAAC;wBACFC,sBAAW;wBACXC,eAAU;wBACVC,wBAAa;qBACd;oBACD,OAAO,EAAE,CAAC,kBAAkB,CAAC;iBAC9B;;;ICzDD;;;;;;;;;;;;;;;;ICAA;;;;;;;;;;;;;;;;;"}
@@ -1,2 +1,2 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@ngx-translate/core"),require("@valtimo/context"),require("@angular/router"),require("@valtimo/task"),require("moment"),require("rxjs/operators"),require("rxjs"),require("@angular/common"),require("@ngx-translate/http-loader"),require("@valtimo/security"),require("@valtimo/contract"),require("@valtimo/components"),require("@angular/common/http")):"function"==typeof define&&define.amd?define("@valtimo/dashboard",["exports","@angular/core","@ngx-translate/core","@valtimo/context","@angular/router","@valtimo/task","moment","rxjs/operators","rxjs","@angular/common","@ngx-translate/http-loader","@valtimo/security","@valtimo/contract","@valtimo/components","@angular/common/http"],t):t(((e=e||self).valtimo=e.valtimo||{},e.valtimo.dashboard={}),e.ng.core,e.core$1,e.context,e.ng.router,e.task,e.moment,e.rxjs.operators,e.rxjs,e.ng.common,e.httpLoader,e.security,e.contract,e.components,e.ng.common.http)}(this,(function(e,t,n,o,a,r,i,s,l,c,u,d,p,m,g){"use strict";var h=i;h.locale(localStorage.getItem("langKey")||""),h.defaultFormat="DD MMM YYYY HH:mm";var v=function(){function e(e,t,n,o,a){this.router=e,this.contextService=t,this.taskService=n,this.route=o,this.translate=a,this.openTaskFields=[{key:"created",label:"Created"},{key:"name",label:"Name"},{key:"valtimoAssignee.fullName",label:"Assignee"}],this.loading$=new l.BehaviorSubject(!0)}return e.prototype.ngOnInit=function(){this.getOpenTasks()},e.prototype.getOpenTasks=function(){var e=this;this.taskService.getTasks().subscribe((function(t){e.openTasks=t,e.openTasks.map((function(e){e.created=h(e.created).format("DD MMM YYYY HH:mm")})),e.checkRouteForTaskId(t),e.loading$.next(!1)}))},e.prototype.rowOpenTaskClick=function(e){e.endTime||this.taskDetail.openTaskDetails(e)},e.prototype.checkRouteForTaskId=function(e){var t=this;this.route.queryParams.pipe(s.take(1)).subscribe((function(n){var o=null==n?void 0:n.taskId,a=e.find((function(e){return e.id===o}));a&&t.rowOpenTaskClick(a)}))},e}();v.decorators=[{type:t.Component,args:[{selector:"valtimo-dashboard",template:'\x3c!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the "License");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an "AS IS" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n --\x3e\n\n<div class="px-3">\n <div class="main-content container-fluid" *ngIf="{loading: loading$ | async} as obs">\n <h4 class="title">\n {{ \'dashboard.openTasks.title\' | translate }}\n <sup *ngIf="obs.loading === false" class="ml-1 badge badge-pill badge-primary">{{ openTasks?.length }}</sup>\n </h4>\n <ng-container *ngIf="obs.loading === false; else loading">\n <valtimo-widget>\n <valtimo-list\n [items]="openTasks"\n [fields]="openTaskFields"\n (rowClicked)="rowOpenTaskClick($event)"\n ></valtimo-list>\n </valtimo-widget>\n </ng-container>\n <valtimo-task-detail-modal\n #taskDetail\n (formSubmit)="getOpenTasks()"\n (assignmentOfTaskChanged)="getOpenTasks()"\n ></valtimo-task-detail-modal>\n </div>\n</div>\n\n<ng-template #loading>\n <valtimo-spinner></valtimo-spinner>\n</ng-template>\n',styles:[""]}]}],v.ctorParameters=function(){return[{type:a.Router},{type:o.ContextService},{type:r.TaskService},{type:a.ActivatedRoute},{type:n.TranslateService}]},v.propDecorators={taskDetail:[{type:t.ViewChild,args:["taskDetail"]}]};var f={title:"Dashboard",roles:[p.ROLE_USER]},k=[{path:"",component:v,canActivate:[d.AuthGuardService],data:f}],y=function(){};function b(e){return new u.TranslateHttpLoader(e)}y.decorators=[{type:t.NgModule,args:[{declarations:[],imports:[c.CommonModule,a.RouterModule.forChild(k)],exports:[a.RouterModule]}]}];var T=function(){};T.decorators=[{type:t.NgModule,args:[{declarations:[v],imports:[c.CommonModule,y,m.WidgetModule,m.ListModule,m.BpmnJsDiagramModule,n.TranslateModule.forRoot({loader:{provide:n.TranslateLoader,useFactory:b,deps:[g.HttpClient]}}),m.AlertModule,r.TaskModule,m.SpinnerModule],exports:[v]}]}],e.DashboardComponent=v,e.DashboardModule=T,e.HttpLoaderFactory=b,e.ɵa=y,Object.defineProperty(e,"__esModule",{value:!0})}));
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@ngx-translate/core"),require("@valtimo/context"),require("@angular/router"),require("@valtimo/task"),require("moment"),require("rxjs/operators"),require("rxjs"),require("@angular/common"),require("@ngx-translate/http-loader"),require("@valtimo/security"),require("@valtimo/contract"),require("@valtimo/components"),require("@angular/common/http")):"function"==typeof define&&define.amd?define("@valtimo/dashboard",["exports","@angular/core","@ngx-translate/core","@valtimo/context","@angular/router","@valtimo/task","moment","rxjs/operators","rxjs","@angular/common","@ngx-translate/http-loader","@valtimo/security","@valtimo/contract","@valtimo/components","@angular/common/http"],t):t(((e=e||self).valtimo=e.valtimo||{},e.valtimo.dashboard={}),e.ng.core,e.core$1,e.context,e.ng.router,e.task,e.moment,e.rxjs.operators,e.rxjs,e.ng.common,e.httpLoader,e.security,e.contract,e.components,e.ng.common.http)}(this,(function(e,t,n,o,a,r,i,s,l,c,u,d,p,m,g){"use strict";var h=i;h.locale(localStorage.getItem("langKey")||""),h.defaultFormat="DD MMM YYYY HH:mm";var v=function(){function e(e,t,n,o,a){this.router=e,this.contextService=t,this.taskService=n,this.route=o,this.translate=a,this.openTaskFields=[{key:"created",label:"Created"},{key:"name",label:"Name"},{key:"valtimoAssignee.fullName",label:"Assignee"}],this.loading$=new l.BehaviorSubject(!0)}return e.prototype.ngOnInit=function(){this.getOpenTasks()},e.prototype.getOpenTasks=function(){var e=this;this.taskService.getTasks().subscribe((function(t){e.openTasks=t,e.openTasks.map((function(e){e.created=h(e.created).format("DD MMM YYYY HH:mm")})),e.checkRouteForTaskId(t),e.loading$.next(!1)}))},e.prototype.rowOpenTaskClick=function(e){e.endTime||this.taskDetail.openTaskDetails(e)},e.prototype.checkRouteForTaskId=function(e){var t=this;this.route.queryParams.pipe(s.take(1)).subscribe((function(n){var o=null==n?void 0:n.taskId,a=e.find((function(e){return e.id===o}));a&&t.rowOpenTaskClick(a)}))},e}();v.decorators=[{type:t.Component,args:[{selector:"valtimo-dashboard",template:'\x3c!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the "License");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an "AS IS" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n --\x3e\n\n<div class="px-3">\n <div class="main-content container-fluid" *ngIf="{loading: loading$ | async} as obs">\n <h4 class="title">\n {{ \'dashboard.openTasks.title\' | translate }}\n <sup *ngIf="obs.loading === false" class="ml-1 badge badge-pill badge-primary">{{\n openTasks?.length\n }}</sup>\n </h4>\n <ng-container *ngIf="obs.loading === false; else loading">\n <valtimo-widget>\n <valtimo-list\n [items]="openTasks"\n [fields]="openTaskFields"\n (rowClicked)="rowOpenTaskClick($event)"\n ></valtimo-list>\n </valtimo-widget>\n </ng-container>\n <valtimo-task-detail-modal\n #taskDetail\n (formSubmit)="getOpenTasks()"\n (assignmentOfTaskChanged)="getOpenTasks()"\n ></valtimo-task-detail-modal>\n </div>\n</div>\n\n<ng-template #loading>\n <valtimo-spinner></valtimo-spinner>\n</ng-template>\n',styles:[""]}]}],v.ctorParameters=function(){return[{type:a.Router},{type:o.ContextService},{type:r.TaskService},{type:a.ActivatedRoute},{type:n.TranslateService}]},v.propDecorators={taskDetail:[{type:t.ViewChild,args:["taskDetail"]}]};var f={title:"Dashboard",roles:[p.ROLE_USER]},k=[{path:"",component:v,canActivate:[d.AuthGuardService],data:f}],y=function(){};function b(e){return new u.TranslateHttpLoader(e)}y.decorators=[{type:t.NgModule,args:[{declarations:[],imports:[c.CommonModule,a.RouterModule.forChild(k)],exports:[a.RouterModule]}]}];var T=function(){};T.decorators=[{type:t.NgModule,args:[{declarations:[v],imports:[c.CommonModule,y,m.WidgetModule,m.ListModule,m.BpmnJsDiagramModule,n.TranslateModule.forRoot({loader:{provide:n.TranslateLoader,useFactory:b,deps:[g.HttpClient]}}),m.AlertModule,r.TaskModule,m.SpinnerModule],exports:[v]}]}],e.DashboardComponent=v,e.DashboardModule=T,e.HttpLoaderFactory=b,e.ɵa=y,Object.defineProperty(e,"__esModule",{value:!0})}));
2
2
  //# sourceMappingURL=valtimo-dashboard.umd.min.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../projects/valtimo/dashboard/src/lib/dashboard.component.ts","../../../../projects/valtimo/dashboard/src/lib/dashboard-routing.module.ts","../../../../projects/valtimo/dashboard/src/lib/dashboard.module.ts"],"names":["moment","moment_","locale","localStorage","getItem","defaultFormat","DashboardComponent","router","contextService","taskService","route","translate","this","openTaskFields","key","label","loading$","BehaviorSubject","prototype","ngOnInit","getOpenTasks","_this","getTasks","subscribe","response","openTasks","map","task","created","format","checkRouteForTaskId","next","rowOpenTaskClick","endTime","taskDetail","openTaskDetails","tasks","queryParams","pipe","take","params","taskId","findTaskFromId","find","id","Component","args","selector","template","Router","ContextService","TaskService","ActivatedRoute","TranslateService","ViewChild","title","roles","ROLE_USER","routes","path","component","canActivate","AuthGuardService","data","ɵ0","HttpLoaderFactory","httpClient","TranslateHttpLoader","NgModule","declarations","imports","CommonModule","RouterModule","forChild","exports","DashboardRoutingModule","WidgetModule","ListModule","BpmnJsDiagramModule","TranslateModule","forRoot","loader","provide","TranslateLoader","useFactory","deps","HttpClient","AlertModule","TaskModule","SpinnerModule"],"mappings":"sjCA2BA,IAAMA,EAASC,EACfD,EAAOE,OAAOC,aAAaC,QAAQ,YAAc,IACjDJ,EAAOK,cAAgB,qCA4BrB,SAAAC,EACUC,EACAC,EACAC,EACSC,EACVC,GAJCC,KAAAL,OAAAA,EACAK,KAAAJ,eAAAA,EACAI,KAAAH,YAAAA,EACSG,KAAAF,MAAAA,EACVE,KAAAD,UAAAA,EAvBFC,KAAAC,eAAiB,CACtB,CACEC,IAAK,UACLC,MAAO,WAET,CACED,IAAK,OACLC,MAAO,QAET,CACED,IAAK,2BACLC,MAAO,aAKXH,KAAAI,SAAW,IAAIC,EAAAA,iBAAyB,UAWxCX,EAAAY,UAAAC,SAAA,WACEP,KAAKQ,gBAGAd,EAAAY,UAAAE,aAAA,WAAA,IAAAC,EAAAT,KACLA,KAAKH,YAAYa,WAAWC,WAAU,SAACC,GACrCH,EAAKI,UAAYD,EACjBH,EAAKI,UAAUC,KAAI,SAACC,GAClBA,EAAKC,QAAU5B,EAAO2B,EAAKC,SAASC,OAAO,wBAE7CR,EAAKS,oBAAoBN,GACzBH,EAAKL,SAASe,MAAK,OA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Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {Component, OnInit, ViewChild} from '@angular/core';\nimport { TranslateService } from '@ngx-translate/core';\nimport { ContextService } from '@valtimo/context';\nimport {ActivatedRoute, Router} from '@angular/router';\nimport { TaskDetailModalComponent, TaskService } from '@valtimo/task';\nimport * as moment_ from 'moment';\nimport {take} from 'rxjs/operators';\nimport {Task} from '@valtimo/contract';\nimport {BehaviorSubject} from 'rxjs';\nimport {NgxSpinnerService} from 'ngx-spinner';\n\nconst moment = moment_;\nmoment.locale(localStorage.getItem('langKey') || '');\nmoment.defaultFormat = 'DD MMM YYYY HH:mm';\n\n@Component({\n selector: 'valtimo-dashboard',\n templateUrl: './dashboard.component.html',\n styleUrls: ['./dashboard.component.css']\n})\nexport class DashboardComponent implements OnInit {\n public processDefinitions: Array<any>;\n public openTasks: Array<any>;\n public openTaskFields = [\n {\n key: 'created',\n label: 'Created'\n },\n {\n key: 'name',\n label: 'Name'\n },\n {\n key: 'valtimoAssignee.fullName',\n label: 'Assignee'\n }\n ];\n @ViewChild('taskDetail') taskDetail: TaskDetailModalComponent;\n\n loading$ = new BehaviorSubject<boolean>(true);\n\n constructor(\n private router: Router,\n private contextService: ContextService,\n private taskService: TaskService,\n private readonly route: ActivatedRoute,\n public translate: TranslateService,\n ) {\n }\n\n ngOnInit() {\n this.getOpenTasks();\n }\n\n public getOpenTasks() {\n this.taskService.getTasks().subscribe((response) => {\n this.openTasks = response;\n this.openTasks.map((task) => {\n task.created = moment(task.created).format('DD MMM YYYY HH:mm');\n });\n this.checkRouteForTaskId(response);\n this.loading$.next(false);\n });\n }\n\n public rowOpenTaskClick(task) {\n if (!task.endTime) {\n this.taskDetail.openTaskDetails(task);\n }\n }\n\n private checkRouteForTaskId(tasks: Array<Task>): void {\n this.route.queryParams.pipe(take(1))\n .subscribe((params) => {\n const taskId = params?.taskId;\n const findTaskFromId = tasks.find((task) => task.id === taskId);\n\n if (findTaskFromId) {\n this.rowOpenTaskClick(findTaskFromId);\n }\n });\n }\n}\n","/*\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {NgModule} from '@angular/core';\nimport {RouterModule, Routes} from '@angular/router';\nimport {CommonModule} from '@angular/common';\nimport {AuthGuardService} from '@valtimo/security';\nimport {DashboardComponent} from './dashboard.component';\nimport {ROLE_USER} from '@valtimo/contract';\n\nconst routes: Routes = [\n {\n path: '',\n component: DashboardComponent,\n canActivate: [AuthGuardService],\n data: {title: 'Dashboard', roles: [ROLE_USER]}\n }\n];\n\n@NgModule({\n declarations: [],\n imports: [\n CommonModule,\n RouterModule.forChild(routes)\n ],\n exports: [RouterModule]\n})\nexport class DashboardRoutingModule {\n}\n","/*\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {NgModule} from '@angular/core';\nimport {CommonModule} from '@angular/common';\nimport {TranslateLoader, TranslateModule} from '@ngx-translate/core';\nimport {TranslateHttpLoader} from '@ngx-translate/http-loader';\nimport {DashboardComponent} from './dashboard.component';\nimport {DashboardRoutingModule} from './dashboard-routing.module';\nimport {AlertModule, BpmnJsDiagramModule, ListModule, SpinnerModule, WidgetModule} from '@valtimo/components';\nimport {HttpClient} from '@angular/common/http';\nimport {TaskModule} from '@valtimo/task';\n\n// AoT requires an exported function for factories\nexport function HttpLoaderFactory(httpClient: HttpClient) {\n return new TranslateHttpLoader(httpClient);\n}\n\n@NgModule({\n declarations: [DashboardComponent],\n imports: [\n CommonModule,\n DashboardRoutingModule,\n WidgetModule,\n ListModule,\n BpmnJsDiagramModule,\n TranslateModule.forRoot({\n loader: {\n provide: TranslateLoader,\n useFactory: HttpLoaderFactory,\n deps: [HttpClient]\n }\n }),\n AlertModule,\n TaskModule,\n SpinnerModule\n ],\n exports: [DashboardComponent]\n})\nexport class DashboardModule {\n}\n"]}
1
+ {"version":3,"sources":["../../../../projects/valtimo/dashboard/src/lib/dashboard.component.ts","../../../../projects/valtimo/dashboard/src/lib/dashboard-routing.module.ts","../../../../projects/valtimo/dashboard/src/lib/dashboard.module.ts"],"names":["moment","moment_","locale","localStorage","getItem","defaultFormat","DashboardComponent","router","contextService","taskService","route","translate","this","openTaskFields","key","label","loading$","BehaviorSubject","prototype","ngOnInit","getOpenTasks","_this","getTasks","subscribe","response","openTasks","map","task","created","format","checkRouteForTaskId","next","rowOpenTaskClick","endTime","taskDetail","openTaskDetails","tasks","queryParams","pipe","take","params","taskId","findTaskFromId","find","id","Component","args","selector","template","Router","ContextService","TaskService","ActivatedRoute","TranslateService","ViewChild","title","roles","ROLE_USER","routes","path","component","canActivate","AuthGuardService","data","HttpLoaderFactory","httpClient","TranslateHttpLoader","NgModule","declarations","imports","CommonModule","RouterModule","forChild","exports","DashboardRoutingModule","WidgetModule","ListModule","BpmnJsDiagramModule","TranslateModule","forRoot","loader","provide","TranslateLoader","useFactory","deps","HttpClient","AlertModule","TaskModule","SpinnerModule"],"mappings":"sjCA2BA,IAAMA,EAASC,EACfD,EAAOE,OAAOC,aAAaC,QAAQ,YAAc,IACjDJ,EAAOK,cAAgB,qCA4BrB,SAAAC,EACUC,EACAC,EACAC,EACSC,EACVC,GAJCC,KAAAL,OAAAA,EACAK,KAAAJ,eAAAA,EACAI,KAAAH,YAAAA,EACSG,KAAAF,MAAAA,EACVE,KAAAD,UAAAA,EAvBFC,KAAAC,eAAiB,CACtB,CACEC,IAAK,UACLC,MAAO,WAET,CACED,IAAK,OACLC,MAAO,QAET,CACED,IAAK,2BACLC,MAAO,aAKXH,KAAAI,SAAW,IAAIC,EAAAA,iBAAyB,UAUxCX,EAAAY,UAAAC,SAAA,WACEP,KAAKQ,gBAGAd,EAAAY,UAAAE,aAAA,WAAA,IAAAC,EAAAT,KACLA,KAAKH,YAAYa,WAAWC,WAAU,SAAAC,GACpCH,EAAKI,UAAYD,EACjBH,EAAKI,UAAUC,KAAI,SAAAC,GACjBA,EAAKC,QAAU5B,EAAO2B,EAAKC,SAASC,OAAO,wBAE7CR,EAAKS,oBAAoBN,GACzBH,EAAKL,SAASe,MAAK,OAIhBzB,EAAAY,UAAAc,iBAAA,SAAiBL,GACjBA,EAAKM,SACRrB,KAAKsB,WAAWC,gBAAgBR,IAI5BrB,EAAAY,UAAAY,oBAAA,SAAoBM,GAApB,IAAAf,EAAAT,KACNA,KAAKF,MAAM2B,YAAYC,KAAKC,EAAAA,KAAK,IAAIhB,WAAU,SAAAiB,GAC7C,IAAMC,EAASD,MAAAA,OAAM,EAANA,EAAQC,OACjBC,EAAiBN,EAAMO,MAAK,SAAAhB,GAAQ,OAAAA,EAAKiB,KAAOH,KAElDC,GACFrB,EAAKW,iBAAiBU,gCA7D7BG,EAAAA,UAASC,KAAA,CAAC,CACTC,SAAU,oBACVC,SAAA,ulDAdsBC,EAAAA,cADhBC,EAAAA,sBAE0BC,EAAAA,mBAD1BC,EAAAA,sBAFAC,EAAAA,wDAoCLC,EAAAA,UAASR,KAAA,CAAC,uBCzBH,CAACS,MAAO,YAAaC,MAAO,CAACC,EAAAA,YALjCC,EAAiB,CACrB,CACEC,KAAM,GACNC,UAAWtD,EACXuD,YAAa,CAACC,EAAAA,kBACdC,KAAI,MASR,sBCJgBC,EAAkBC,GAChC,OAAO,IAAIC,EAAAA,oBAAoBD,uBDFhCE,EAAAA,SAAQrB,KAAA,CAAC,CACRsB,aAAc,GACdC,QAAS,CAACC,EAAAA,aAAcC,EAAAA,aAAaC,SAASd,IAC9Ce,QAAS,CAACF,EAAAA,wBCuBZ,iCArBCJ,EAAAA,SAAQrB,KAAA,CAAC,CACRsB,aAAc,CAAC9D,GACf+D,QAAS,CACPC,EAAAA,aACAI,EACAC,EAAAA,aACAC,EAAAA,WACAC,EAAAA,oBACAC,EAAAA,gBAAgBC,QAAQ,CACtBC,OAAQ,CACNC,QAASC,EAAAA,gBACTC,WAAYnB,EACZoB,KAAM,CAACC,EAAAA,eAGXC,EAAAA,YACAC,EAAAA,WACAC,EAAAA,eAEFf,QAAS,CAACnE","sourcesContent":["/*\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {Component, OnInit, ViewChild} from '@angular/core';\nimport {TranslateService} from '@ngx-translate/core';\nimport {ContextService} from '@valtimo/context';\nimport {ActivatedRoute, Router} from '@angular/router';\nimport {TaskDetailModalComponent, TaskService} from '@valtimo/task';\nimport * as moment_ from 'moment';\nimport {take} from 'rxjs/operators';\nimport {Task} from '@valtimo/contract';\nimport {BehaviorSubject} from 'rxjs';\nimport {NgxSpinnerService} from 'ngx-spinner';\n\nconst moment = moment_;\nmoment.locale(localStorage.getItem('langKey') || '');\nmoment.defaultFormat = 'DD MMM YYYY HH:mm';\n\n@Component({\n selector: 'valtimo-dashboard',\n templateUrl: './dashboard.component.html',\n styleUrls: ['./dashboard.component.css'],\n})\nexport class DashboardComponent implements OnInit {\n public processDefinitions: Array<any>;\n public openTasks: Array<any>;\n public openTaskFields = [\n {\n key: 'created',\n label: 'Created',\n },\n {\n key: 'name',\n label: 'Name',\n },\n {\n key: 'valtimoAssignee.fullName',\n label: 'Assignee',\n },\n ];\n @ViewChild('taskDetail') taskDetail: TaskDetailModalComponent;\n\n loading$ = new BehaviorSubject<boolean>(true);\n\n constructor(\n private router: Router,\n private contextService: ContextService,\n private taskService: TaskService,\n private readonly route: ActivatedRoute,\n public translate: TranslateService\n ) {}\n\n ngOnInit() {\n this.getOpenTasks();\n }\n\n public getOpenTasks() {\n this.taskService.getTasks().subscribe(response => {\n this.openTasks = response;\n this.openTasks.map(task => {\n task.created = moment(task.created).format('DD MMM YYYY HH:mm');\n });\n this.checkRouteForTaskId(response);\n this.loading$.next(false);\n });\n }\n\n public rowOpenTaskClick(task) {\n if (!task.endTime) {\n this.taskDetail.openTaskDetails(task);\n }\n }\n\n private checkRouteForTaskId(tasks: Array<Task>): void {\n this.route.queryParams.pipe(take(1)).subscribe(params => {\n const taskId = params?.taskId;\n const findTaskFromId = tasks.find(task => task.id === taskId);\n\n if (findTaskFromId) {\n this.rowOpenTaskClick(findTaskFromId);\n }\n });\n }\n}\n","/*\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {NgModule} from '@angular/core';\nimport {RouterModule, Routes} from '@angular/router';\nimport {CommonModule} from '@angular/common';\nimport {AuthGuardService} from '@valtimo/security';\nimport {DashboardComponent} from './dashboard.component';\nimport {ROLE_USER} from '@valtimo/contract';\n\nconst routes: Routes = [\n {\n path: '',\n component: DashboardComponent,\n canActivate: [AuthGuardService],\n data: {title: 'Dashboard', roles: [ROLE_USER]},\n },\n];\n\n@NgModule({\n declarations: [],\n imports: [CommonModule, RouterModule.forChild(routes)],\n exports: [RouterModule],\n})\nexport class DashboardRoutingModule {}\n","/*\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {NgModule} from '@angular/core';\nimport {CommonModule} from '@angular/common';\nimport {TranslateLoader, TranslateModule} from '@ngx-translate/core';\nimport {TranslateHttpLoader} from '@ngx-translate/http-loader';\nimport {DashboardComponent} from './dashboard.component';\nimport {DashboardRoutingModule} from './dashboard-routing.module';\nimport {\n AlertModule,\n BpmnJsDiagramModule,\n ListModule,\n SpinnerModule,\n WidgetModule,\n} from '@valtimo/components';\nimport {HttpClient} from '@angular/common/http';\nimport {TaskModule} from '@valtimo/task';\n\n// AoT requires an exported function for factories\nexport function HttpLoaderFactory(httpClient: HttpClient) {\n return new TranslateHttpLoader(httpClient);\n}\n\n@NgModule({\n declarations: [DashboardComponent],\n imports: [\n CommonModule,\n DashboardRoutingModule,\n WidgetModule,\n ListModule,\n BpmnJsDiagramModule,\n TranslateModule.forRoot({\n loader: {\n provide: TranslateLoader,\n useFactory: HttpLoaderFactory,\n deps: [HttpClient],\n },\n }),\n AlertModule,\n TaskModule,\n SpinnerModule,\n ],\n exports: [DashboardComponent],\n})\nexport class DashboardModule {}\n"]}