verben-workflow-ui 0.5.84 → 0.5.85
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/esm2022/src/lib/components/my-queue/my-queue.component.mjs +3 -3
- package/esm2022/src/lib/components/my-queue/my-queue.facade.mjs +6 -6
- package/esm2022/src/lib/components/my-queue/my-queue.state.mjs +4 -4
- package/esm2022/src/lib/components/tasks/tasks.component.mjs +10 -5
- package/esm2022/src/lib/components/tasks/tasks.facade.mjs +23 -11
- package/esm2022/src/lib/components/tasks/tasks.state.mjs +11 -3
- package/fesm2022/verben-workflow-ui-src-lib-components-my-queue.mjs +8 -8
- package/fesm2022/verben-workflow-ui-src-lib-components-my-queue.mjs.map +1 -1
- package/fesm2022/verben-workflow-ui-src-lib-components-tasks.mjs +37 -12
- package/fesm2022/verben-workflow-ui-src-lib-components-tasks.mjs.map +1 -1
- package/package.json +47 -47
- package/src/lib/components/tasks/tasks.component.d.ts +2 -1
- package/src/lib/components/tasks/tasks.facade.d.ts +5 -2
- package/src/lib/components/tasks/tasks.state.d.ts +10 -3
|
@@ -163,7 +163,7 @@ class TaskState {
|
|
|
163
163
|
searchTerm$ = new BehaviorSubject('');
|
|
164
164
|
queryParams$ = new BehaviorSubject({
|
|
165
165
|
skip: 0,
|
|
166
|
-
limit:
|
|
166
|
+
limit: 50,
|
|
167
167
|
sortParam: 'CreatedAt',
|
|
168
168
|
sortOrder: SortDirection.Desc,
|
|
169
169
|
});
|
|
@@ -242,6 +242,14 @@ class TaskState {
|
|
|
242
242
|
const currentRequests = this.tasks$.getValue();
|
|
243
243
|
this.tasks$.next([...currentRequests, ...newRequests]);
|
|
244
244
|
}
|
|
245
|
+
resetQueryParams() {
|
|
246
|
+
this.queryParams$.next({
|
|
247
|
+
skip: 0,
|
|
248
|
+
limit: 50,
|
|
249
|
+
sortParam: 'CreatedAt',
|
|
250
|
+
sortOrder: SortDirection.Desc,
|
|
251
|
+
});
|
|
252
|
+
}
|
|
245
253
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: TaskState, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
246
254
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: TaskState });
|
|
247
255
|
}
|
|
@@ -286,7 +294,7 @@ class TaskFacade {
|
|
|
286
294
|
await this.loadRequestsWithParam(searchTerm);
|
|
287
295
|
}
|
|
288
296
|
else {
|
|
289
|
-
await this.loadRequests(
|
|
297
|
+
await this.loadRequests();
|
|
290
298
|
}
|
|
291
299
|
}
|
|
292
300
|
catch (error) {
|
|
@@ -317,18 +325,22 @@ class TaskFacade {
|
|
|
317
325
|
addNewRequest(task) {
|
|
318
326
|
this.taskState.addRequest(task);
|
|
319
327
|
}
|
|
320
|
-
async loadRequests(
|
|
328
|
+
async loadRequests() {
|
|
321
329
|
try {
|
|
322
330
|
this.taskState.setUpdating(true);
|
|
323
331
|
const params = this.taskState.getQueryParamsValue();
|
|
324
|
-
const requests =
|
|
332
|
+
const requests = params.user
|
|
333
|
+
? await this.taskService.getPossibleTasksForUser(params.user, params.skip, params.limit, params.sortParam || 'createdDate', params.sortOrder)
|
|
334
|
+
: await this.taskService.getTasks(params.skip, params.limit, params.sortParam || 'createdDate', params.sortOrder);
|
|
325
335
|
if (requests instanceof ErrorResponse) {
|
|
326
336
|
this.utilService.showError(requests.ErrorMsg);
|
|
327
337
|
return;
|
|
328
338
|
}
|
|
329
339
|
if (requests?.Result) {
|
|
330
340
|
this.taskState.setRequests(requests.Result);
|
|
331
|
-
this.taskState.updateQueryParams({
|
|
341
|
+
this.taskState.updateQueryParams({
|
|
342
|
+
skip: requests.Skip > 0 ? requests.Skip : requests.Result.length,
|
|
343
|
+
});
|
|
332
344
|
}
|
|
333
345
|
}
|
|
334
346
|
catch (error) {
|
|
@@ -348,7 +360,9 @@ class TaskFacade {
|
|
|
348
360
|
return;
|
|
349
361
|
}
|
|
350
362
|
this.taskState.setRequests(requests.Result);
|
|
351
|
-
this.taskState.updateQueryParams({
|
|
363
|
+
this.taskState.updateQueryParams({
|
|
364
|
+
skip: requests.Skip > 0 ? requests.Skip : requests.Result.length,
|
|
365
|
+
});
|
|
352
366
|
}
|
|
353
367
|
catch (error) {
|
|
354
368
|
throw error;
|
|
@@ -383,6 +397,9 @@ class TaskFacade {
|
|
|
383
397
|
this.taskState.setUpdating(false);
|
|
384
398
|
}
|
|
385
399
|
}
|
|
400
|
+
resetQueryParams() {
|
|
401
|
+
this.taskState.resetQueryParams();
|
|
402
|
+
}
|
|
386
403
|
async updateRequest(request) {
|
|
387
404
|
try {
|
|
388
405
|
this.taskState.setUpdating(true);
|
|
@@ -524,18 +541,21 @@ class TaskFacade {
|
|
|
524
541
|
const searchTerm = this.taskState.getSearchTermValue();
|
|
525
542
|
// The first page is already loaded at skip=0 without advancing the
|
|
526
543
|
// pointer, so fetch the *next* page starting at newSkip.
|
|
527
|
-
const newSkip = currentParams.skip + currentParams.limit;
|
|
544
|
+
// const newSkip = currentParams.skip + currentParams.limit;
|
|
528
545
|
// Load and append data, honouring any active search term
|
|
529
546
|
const response = searchTerm
|
|
530
|
-
? await this.taskService.getTaskWithParam(searchTerm,
|
|
531
|
-
:
|
|
547
|
+
? await this.taskService.getTaskWithParam(searchTerm, currentParams.skip, currentParams.limit, currentParams.sortParam || 'createdDate', currentParams.sortOrder)
|
|
548
|
+
: currentParams.user
|
|
549
|
+
? await this.taskService.getPossibleTasksForUser(currentParams.user, currentParams.skip, currentParams.limit, currentParams.sortParam || 'createdDate', currentParams.sortOrder)
|
|
550
|
+
: await this.taskService.getTasks(currentParams.skip, currentParams.limit, currentParams.sortParam || 'createdDate', currentParams.sortOrder);
|
|
532
551
|
if (response instanceof ErrorResponse) {
|
|
533
552
|
this.utilService.showError(response.ErrorMsg);
|
|
534
553
|
return;
|
|
535
554
|
}
|
|
555
|
+
const { Skip, PageSize, Result } = response;
|
|
536
556
|
this.taskState.appendRequests(response.Result);
|
|
537
557
|
this.taskState.updateQueryParams({
|
|
538
|
-
skip:
|
|
558
|
+
skip: Skip > 0 ? Skip : Result.length,
|
|
539
559
|
limit: currentParams.limit,
|
|
540
560
|
});
|
|
541
561
|
}
|
|
@@ -721,6 +741,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
721
741
|
class TasksComponent extends BaseDataViewComponent {
|
|
722
742
|
cdr;
|
|
723
743
|
taskFacade;
|
|
744
|
+
pageSize = input(50);
|
|
724
745
|
user = input('');
|
|
725
746
|
config = {
|
|
726
747
|
dataSource: [], // Populate from service
|
|
@@ -748,8 +769,12 @@ class TasksComponent extends BaseDataViewComponent {
|
|
|
748
769
|
});
|
|
749
770
|
}
|
|
750
771
|
loadInitialData() {
|
|
772
|
+
this.taskFacade.resetQueryParams();
|
|
773
|
+
if (this.user() && this.user().trim().length > 0) {
|
|
774
|
+
this.taskFacade.updateQueryParams({ user: this.user() });
|
|
775
|
+
}
|
|
751
776
|
try {
|
|
752
|
-
this.taskFacade.loadRequests(
|
|
777
|
+
this.taskFacade.loadRequests();
|
|
753
778
|
}
|
|
754
779
|
catch (error) {
|
|
755
780
|
// Handle error
|
|
@@ -809,7 +834,7 @@ class TasksComponent extends BaseDataViewComponent {
|
|
|
809
834
|
await this.taskFacade.addRequest(payload);
|
|
810
835
|
}
|
|
811
836
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: TasksComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: TaskFacade }], target: i0.ɵɵFactoryTarget.Component });
|
|
812
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: TasksComponent, selector: "lib-tasks", inputs: { user: { classPropertyName: "user", publicName: "user", isSignal: true, isRequired: false, transformFunction: null } }, providers: [TasksService, TaskFacade, TaskState], usesInheritance: true, ngImport: i0, template: "<div class=\"space-y-8\">\n <verben-data-view #vdv [viewState]=\"{\n isSearch: true,\n isColumn: true,\n isFilter: true,\n isSort: true,\n isExport: true,\n isSelect: true,\n isCreate: true,\n isToggle: true,\n }\" [buttonClass]=\"'my-custom-button-class'\" [iconClass]=\"'my-icon-class'\"\n [activeIconClass]=\"'my-active-icon-class'\" [selectedColumnCount]=\"0\" [selectedSortCount]=\"0\"\n [selectedFilterTableCount]=\"0\" (viewChange)=\"onViewChange($event)\" (stateChange)=\"onStateChange($event)\"\n (onSearchChange)=\"handleSearch($event)\">\n <div table-content>\n <lib-data-table [data]=\"data()\" [columns]=\"config.columns\" [styleConfig]=\"styles\"\n (selectionChange)=\"onSelectionChange($event)\">\n <ng-container libColumn=\"history\">\n <ng-template #cell let-value>\n <a [routerLink]=\"['/workflow/task-history', value]\" routerLinkActive=\"router-link-active\"\n class=\"underline text-[var(--vbn-color-border-focus)]\">view history</a>\n </ng-template>\n </ng-container>\n\n <ng-container libColumn=\"workflow\">\n <ng-template #cell let-value>\n <a [routerLink]=\"['/workflow/workflows', value]\" routerLinkActive=\"router-link-active\"\n class=\"underline text-[var(--vbn-color-border-focus)]\">view Workflow</a>\n </ng-template>\n </ng-container>\n\n <ng-container libColumn=\"actions\">\n <ng-template #cell let-row=\"row\">\n <lib-operation-popup [user]=\"user()\" [task]=\"row\" [allowedActions]=\"getActionNamesForTask(row)\"\n (actionComplete)=\"loadInitialData()\">\n <div trigger class=\"cursor-pointer p-2 -m-2 inline-flex items-center justify-center\">\n <verben-svg icon=\"dots\" [width]=\"3\" [height]=\"18\" class=\"w-auto\"></verben-svg>\n </div>\n </lib-operation-popup>\n </ng-template>\n <ng-template #header>\n <strong>Actions</strong>\n </ng-template>\n </ng-container>\n </lib-data-table>\n </div>\n\n <div card-content>\n <verben-card-data-view borderRadius=\"12px\" (loadMoreClick)=\"loadMore()\" #vdcv dataId=\"Id\" border=\"5px\"\n [cardDataList]=\"cardData()\" rbgColor=\"var(--vbn-color-surface-alt)\" mg=\"20px\">\n <verben-left-card-data-view class=\"space-y-7\">\n <verben-left-card-data #vlcd [parent]=\"vdcv\" dataId=\"Code\"\n class=\"bg-secondary-100 rounded-xl border-primary border-[1px]\" [cardDataList]=\"cardData()\">\n <ng-template #card let-cardItem>\n <div (click)=\"currentData = vdcv.onItemClick(cardItem)\" class=\"flex\">\n <div (click)=\"currentData = vdcv.onItemClick(cardItem)\"\n class=\"flex cursor-pointer w-full bg-secondary rounded-xl\">\n <div class=\"w-3 rounded-xl rounded-tr-none rounded-br-none\" [ngClass]=\"\n cardItem.selected ? 'bg-primary' : 'bg-secondary-200'\n \"></div>\n <div class=\"flex flex-col py-2 px-4 w-full\">\n <div class=\"flex items-center gap-4 justify-between\">\n <div class=\"grid gap-y-2\">\n <span class=\"font-semibold text-[var(--vbn-color-on-primary)]\">{{\n cardItem.title\n }}</span>\n <p class=\"flex items-center\">\n <!-- <label for=\"phone\" class=\"text-[10px] font-light\">Current Actors:</label> -->\n @if (cardItem.data.CurrentActors && cardItem.data.CurrentActors.length > 0) {\n @if (cardItem.data.CurrentActors.length === 1) {\n <span id=\"phone\" class=\"text-sm\">{{ cardItem.data.CurrentActors[0].Identifier }}</span>\n } @else {\n <verben-tooltip [top]=\"'0px'\" [textColor]=\"'var(--vbn-color-text)'\" [backgroundColor]=\"'var(--vbn-color-border)'\" [left]=\"'0'\"\n [tooltipContent]=\"actorsTooltipTemplate\" #actorsTooltip>\n <span id=\"phone\" class=\"text-sm cursor-pointer\">\n {{ cardItem.data.CurrentActors[0].Identifier }} and {{ cardItem.data.CurrentActors.length\n - 1 }} others\n </span>\n </verben-tooltip>\n\n <ng-template #actorsTooltipTemplate>\n <div class=\"p-2\">\n <p class=\"text-xs font-semibold mb-1\">Current Actors:</p>\n <ul class=\"list-disc list-inside\">\n @for (actor of cardItem.data.CurrentActors; track actor.Identifier) {\n <li class=\"text-xs\">{{ actor.Identifier }}</li>\n }\n </ul>\n </div>\n </ng-template>\n }\n } @else {\n <span id=\"phone\" class=\"text-sm text-gray-400\">No actors assigned</span>\n }\n </p>\n </div>\n\n <div class=\"grid gap-y-2\">\n <span for=\"role\" class=\"font-light\">{{\n cardItem.data.Code\n }}</span>\n\n <div (click)=\"$event.stopPropagation();\" class=\"flex items-end gap-4\">\n <a [routerLink]=\"[\n '/workflow/task-history',\n cardItem.data.Code\n ]\" routerLinkActive=\"router-link-active\"\n class=\"underline text-[var(--vbn-color-border-focus)] text-xs relative z-10\">view\n history</a>\n\n <lib-operation-popup [user]=\"user()\" [task]=\"cardItem.data\"\n [allowedActions]=\"getActionNamesForTask(cardItem.data)\" (actionComplete)=\"loadInitialData()\">\n <div trigger class=\"cursor-pointer p-2 -m-2 inline-flex items-center justify-center\">\n <verben-svg icon=\"dots\" [width]=\"3\" [height]=\"18\" class=\"w-auto\"></verben-svg>\n </div>\n </lib-operation-popup>\n </div>\n </div>\n </div>\n\n <!-- <div class=\"flex\">\n <span class=\"font-normal text-sm\">{{ item.title }}</span>\n </div>\n @for (ciItem of item.body; track ciItem.value) {\n <div class=\"\">\n <span class=\"text-muted font-light text-xs\"\n >{{ ciItem.title }}:</span\n >\n <span class=\"text-black\">{{ ciItem.value }}</span>\n </div>\n } -->\n </div>\n </div>\n </div>\n </ng-template>\n </verben-left-card-data>\n </verben-left-card-data-view>\n\n <verben-right-card-data-view>\n <ng-template #parent>\n <!-- <lib-user-request-form\n [currentData]=\"currentData\"\n (switchView)=\"vdv.toggleView()\"\n (onApproval)=\"onApprove($event)\"\n ></lib-user-request-form> -->\n <tasks-form [currentData]=\"currentData\" (switchView)=\"vdv.toggleView()\"\n (onSave)=\"onSave($event)\"></tasks-form>\n </ng-template>\n </verben-right-card-data-view>\n\n <verben-card-data-view-footer class=\"w-full\">\n <div [ngClass]=\"{\n 'flex gap-2 items-center': true,\n 'justify-end': true\n }\">\n <!-- <verbena-button\n *ngIf=\"!vdcv.hasCurrentItem()\"\n [fontWeight]=\"'bold'\"\n [bgColor]=\"'var(--vbn-color-text-muted)'\"\n [borderRadius]=\"'4px'\"\n [textColor]=\"'var(--vbn-color-surface)'\"\n [pd]=\"'9.79px 37.28px'\"\n [text]=\"'Delete'\"\n >\n </verbena-button> -->\n <div class=\"flex {{\n vdcv.hasCurrentItem() ? 'flex-1' : ''\n }} justify-end items-center gap-5\">\n <span class=\"paginator-text\">{{ cardData().length }} records loaded</span>\n <button (click)=\"loadMore()\" class=\"load-more view-links text-[var(--vbn-color-border-focus)] underline\">\n Load more\n </button>\n </div>\n </div>\n </verben-card-data-view-footer>\n </verben-card-data-view>\n </div>\n <div column-content>\n <lib-data-columns [columns]=\"config.columns\" (columnsUpdated)=\"onColumnsUpdated($event)\"></lib-data-columns>\n </div>\n <div filter-content>\n <verben-table-filter [border]=\"'1px solid var(--vbn-color-primary)'\" borderRadius=\"10px\"\n boxShadow=\"2px 2px 2px 0px silver\" bgColor=\"white\" width=\"420px\" textColor=\"black\" pd=\"1rem\"\n primaryColor=\"var(--vbn-color-primary)\" secondaryColor=\"var(--vbn-color-border-focus)\" tertiaryColor=\"var(--vbn-color-on-primary)\" [filterOptions]=\"filterArray\"\n [maxFilterLength]=\"3\"></verben-table-filter>\n </div>\n <div sort-content>\n <lib-data-sort [columns]=\"config.columns\" [data]=\"data()\" (sortApplied)=\"onSortUpdated($event)\"></lib-data-sort>\n </div>\n <div export-content>\n <lib-data-export [data]=\"data()\" (exportDataEvent)=\"handleExport($event)\">\n </lib-data-export>\n </div>\n </verben-data-view>\n\n <div *ngIf=\"vdv.isTableView\" class=\"flex gap-2 justify-between\">\n <div class=\"message-log-button-container flex justify-between\">\n <!-- <verbena-button\n [fontWeight]=\"'bold'\"\n [bgColor]=\"'var(--vbn-color-text-muted)'\"\n [borderRadius]=\"'4px'\"\n [textColor]=\"'var(--vbn-color-surface)'\"\n [pd]=\"'9.79px 37.28px'\"\n [text]=\"'Delete'\"\n >\n </verbena-button> -->\n </div>\n <div class=\"flex justify-end items-center gap-5\">\n <span class=\"paginator-text\">{{ cardData().length }} records loaded</span>\n <button (click)=\"loadMore()\" class=\"load-more view-links text-[var(--vbn-color-border-focus)] underline\">\n Load more\n </button>\n </div>\n </div>\n</div>\n", styles: [".view-links{color:var(--vbn-color-border-focus);cursor:pointer}\n"], dependencies: [{ kind: "directive", type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3$1.DataTableComponent, selector: "lib-data-table", inputs: ["data", "columns", "dataKey", "formGroupConfig", "groupBy", "useVirtualScroll", "virtualScrollItemSize", "styleConfig"], outputs: ["rowEdit", "rowSave", "rowRevert", "rowDelete", "selectionChange"] }, { kind: "directive", type: i3$1.ColumnDirective, selector: "[libColumn]", inputs: ["libColumn"] }, { kind: "component", type: i3$1.SvgComponent, selector: "verben-svg", inputs: ["icon", "width", "height", "fill", "stroke", "type", "size"] }, { kind: "component", type: i3$1.DataViewComponent, selector: "verben-data-view", inputs: ["buttonClass", "iconClass", "activeIconClass", "columnCustomClass", "filterCustomClass", "sortCustomClass", "extendCustomClass", "exportCustomClass", "selectCustomClass", "importCustomClass", "zIndex", "createCustomClass", "tableIcon", "cardIcon", "cardClass", "tableClass", "searchKey", "searchValue", "viewState", "searchTemplate", "importTemplate", "columnTemplate", "extendTemplate", "filterTemplate", "sortTemplate", "children", "exportTemplate", "createTemplate", "selectedColumnCount", "selectedSortCount", "selectedFilterTableCount", "inputWidth", "milliseconds", "showColumnChild", "showSortChild", "showFilterChild", "showImportChild", "showExportChild", "showExtendChild", "create", "showSelected", "isTableView"], outputs: ["viewChange", "stateChange", "onSearchChange"] }, { kind: "component", type: i3$1.CardDataViewComponent, selector: "verben-card-data-view", inputs: ["pd", "mg", "lHeight", "rHeight", "rWidth", "lWidth", "textColor", "lbgColor", "rbgColor", "border", "display", "borderRadius", "activeCss", "inActiveCss", "displayAsRow", "cardDataList", "dataId", "totalRecords", "footer", "noOfVisibleChildren", "showEditIcon", "useVirtualScroll", "virtualScrollItemSize", "onItemClick", "onCardChildClick"], outputs: ["editClicked", "loadMoreClick"] }, { kind: "component", type: i3$1.LeftCardDataComponent, selector: "verben-left-card-data", inputs: ["pd", "mg", "height", "weight", "activeCss", "inActiveCss", "cardDataList", "iconCollapse", "iconExpanded", "parent", "useVirtualScroll", "virtualScrollItemSize", "dataId"] }, { kind: "component", type: i3$1.LeftCardDataViewComponent, selector: "verben-left-card-data-view", inputs: ["cardDataList"] }, { kind: "component", type: i3$1.RightCardDataViewComponent, selector: "verben-right-card-data-view", inputs: ["parentData", "chilData", "meth"] }, { kind: "component", type: i3$1.CardDataViewFooterComponent, selector: "verben-card-data-view-footer" }, { kind: "component", type: i3$1.TableFilterComponent, selector: "verben-table-filter", inputs: ["filterOptions", "pd", "mg", "height", "width", "bgColor", "boxShadow", "textColor", "primaryColor", "secondaryColor", "tertiaryColor", "border", "borderRadius", "selectWidth", "maxFilterLength", "savedFilters", "tooltip", "saveCallback"], outputs: ["filtersApplied", "resetSortData"] }, { kind: "component", type: i3$1.DataExportComponent, selector: "lib-data-export", inputs: ["columns", "data", "dataFetchUrl", "dataQueryParameters"], outputs: ["exportDataEvent"] }, { kind: "component", type: i3$1.DataColumnsComponent, selector: "lib-data-columns", inputs: ["columns", "enableDragAndDrop", "maxVisibleItems", "selectedColumns"], outputs: ["columnsUpdated"] }, { kind: "component", type: i3$1.DataSortComponent, selector: "lib-data-sort", inputs: ["columns", "data", "enableDragAndDrop"], outputs: ["sortApplied", "resetFilter"] }, { kind: "directive", type: i4.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: i3$1.TooltipComponent, selector: "verben-tooltip", inputs: ["tooltipContent", "customClass", "backgroundColor", "textColor", "padding", "borderRadius", "zIndex", "border", "width", "top", "bottom", "left", "right"] }, { kind: "component", type: i5$1.OperationPopupComponent, selector: "lib-operation-popup", inputs: ["user", "task", "allowedActions"], outputs: ["actionComplete"] }, { kind: "component", type: TasksFormComponent, selector: "tasks-form", inputs: ["currentData"], outputs: ["onTaskFormSave", "onSave"] }] });
|
|
837
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: TasksComponent, selector: "lib-tasks", inputs: { pageSize: { classPropertyName: "pageSize", publicName: "pageSize", isSignal: true, isRequired: false, transformFunction: null }, user: { classPropertyName: "user", publicName: "user", isSignal: true, isRequired: false, transformFunction: null } }, providers: [TasksService, TaskFacade, TaskState], usesInheritance: true, ngImport: i0, template: "<div class=\"space-y-8\">\n <verben-data-view #vdv [viewState]=\"{\n isSearch: true,\n isColumn: true,\n isFilter: true,\n isSort: true,\n isExport: true,\n isSelect: true,\n isCreate: true,\n isToggle: true,\n }\" [buttonClass]=\"'my-custom-button-class'\" [iconClass]=\"'my-icon-class'\"\n [activeIconClass]=\"'my-active-icon-class'\" [selectedColumnCount]=\"0\" [selectedSortCount]=\"0\"\n [selectedFilterTableCount]=\"0\" (viewChange)=\"onViewChange($event)\" (stateChange)=\"onStateChange($event)\"\n (onSearchChange)=\"handleSearch($event)\">\n <div table-content>\n <lib-data-table [data]=\"data()\" [columns]=\"config.columns\" [styleConfig]=\"styles\"\n (selectionChange)=\"onSelectionChange($event)\">\n <ng-container libColumn=\"history\">\n <ng-template #cell let-value>\n <a [routerLink]=\"['/workflow/task-history', value]\" routerLinkActive=\"router-link-active\"\n class=\"underline text-[var(--vbn-color-border-focus)]\">view history</a>\n </ng-template>\n </ng-container>\n\n <ng-container libColumn=\"workflow\">\n <ng-template #cell let-value>\n <a [routerLink]=\"['/workflow/workflows', value]\" routerLinkActive=\"router-link-active\"\n class=\"underline text-[var(--vbn-color-border-focus)]\">view Workflow</a>\n </ng-template>\n </ng-container>\n\n <ng-container libColumn=\"actions\">\n <ng-template #cell let-row=\"row\">\n <lib-operation-popup [user]=\"user()\" [task]=\"row\" [allowedActions]=\"getActionNamesForTask(row)\"\n (actionComplete)=\"loadInitialData()\">\n <div trigger class=\"cursor-pointer p-2 -m-2 inline-flex items-center justify-center\">\n <verben-svg icon=\"dots\" [width]=\"3\" [height]=\"18\" class=\"w-auto\"></verben-svg>\n </div>\n </lib-operation-popup>\n </ng-template>\n <ng-template #header>\n <strong>Actions</strong>\n </ng-template>\n </ng-container>\n </lib-data-table>\n </div>\n\n <div card-content>\n <verben-card-data-view borderRadius=\"12px\" (loadMoreClick)=\"loadMore()\" #vdcv dataId=\"Id\" border=\"5px\"\n [cardDataList]=\"cardData()\" rbgColor=\"var(--vbn-color-surface-alt)\" mg=\"20px\">\n <verben-left-card-data-view class=\"space-y-7\">\n <verben-left-card-data #vlcd [parent]=\"vdcv\" dataId=\"Code\"\n class=\"bg-secondary-100 rounded-xl border-primary border-[1px]\" [cardDataList]=\"cardData()\">\n <ng-template #card let-cardItem>\n <div (click)=\"currentData = vdcv.onItemClick(cardItem)\" class=\"flex\">\n <div (click)=\"currentData = vdcv.onItemClick(cardItem)\"\n class=\"flex cursor-pointer w-full bg-secondary rounded-xl\">\n <div class=\"w-3 rounded-xl rounded-tr-none rounded-br-none\" [ngClass]=\"\n cardItem.selected ? 'bg-primary' : 'bg-secondary-200'\n \"></div>\n <div class=\"flex flex-col py-2 px-4 w-full\">\n <div class=\"flex items-center gap-4 justify-between\">\n <div class=\"grid gap-y-2\">\n <span class=\"font-semibold text-[var(--vbn-color-on-primary)]\">{{\n cardItem.title\n }}</span>\n <p class=\"flex items-center\">\n <!-- <label for=\"phone\" class=\"text-[10px] font-light\">Current Actors:</label> -->\n @if (cardItem.data.CurrentActors && cardItem.data.CurrentActors.length > 0) {\n @if (cardItem.data.CurrentActors.length === 1) {\n <span id=\"phone\" class=\"text-sm\">{{ cardItem.data.CurrentActors[0].Identifier }}</span>\n } @else {\n <verben-tooltip [top]=\"'0px'\" [textColor]=\"'var(--vbn-color-text)'\" [backgroundColor]=\"'var(--vbn-color-border)'\" [left]=\"'0'\"\n [tooltipContent]=\"actorsTooltipTemplate\" #actorsTooltip>\n <span id=\"phone\" class=\"text-sm cursor-pointer\">\n {{ cardItem.data.CurrentActors[0].Identifier }} and {{ cardItem.data.CurrentActors.length\n - 1 }} others\n </span>\n </verben-tooltip>\n\n <ng-template #actorsTooltipTemplate>\n <div class=\"p-2\">\n <p class=\"text-xs font-semibold mb-1\">Current Actors:</p>\n <ul class=\"list-disc list-inside\">\n @for (actor of cardItem.data.CurrentActors; track actor.Identifier) {\n <li class=\"text-xs\">{{ actor.Identifier }}</li>\n }\n </ul>\n </div>\n </ng-template>\n }\n } @else {\n <span id=\"phone\" class=\"text-sm text-gray-400\">No actors assigned</span>\n }\n </p>\n </div>\n\n <div class=\"grid gap-y-2\">\n <span for=\"role\" class=\"font-light\">{{\n cardItem.data.Code\n }}</span>\n\n <div (click)=\"$event.stopPropagation();\" class=\"flex items-end gap-4\">\n <a [routerLink]=\"[\n '/workflow/task-history',\n cardItem.data.Code\n ]\" routerLinkActive=\"router-link-active\"\n class=\"underline text-[var(--vbn-color-border-focus)] text-xs relative z-10\">view\n history</a>\n\n <lib-operation-popup [user]=\"user()\" [task]=\"cardItem.data\"\n [allowedActions]=\"getActionNamesForTask(cardItem.data)\" (actionComplete)=\"loadInitialData()\">\n <div trigger class=\"cursor-pointer p-2 -m-2 inline-flex items-center justify-center\">\n <verben-svg icon=\"dots\" [width]=\"3\" [height]=\"18\" class=\"w-auto\"></verben-svg>\n </div>\n </lib-operation-popup>\n </div>\n </div>\n </div>\n\n <!-- <div class=\"flex\">\n <span class=\"font-normal text-sm\">{{ item.title }}</span>\n </div>\n @for (ciItem of item.body; track ciItem.value) {\n <div class=\"\">\n <span class=\"text-muted font-light text-xs\"\n >{{ ciItem.title }}:</span\n >\n <span class=\"text-black\">{{ ciItem.value }}</span>\n </div>\n } -->\n </div>\n </div>\n </div>\n </ng-template>\n </verben-left-card-data>\n </verben-left-card-data-view>\n\n <verben-right-card-data-view>\n <ng-template #parent>\n <!-- <lib-user-request-form\n [currentData]=\"currentData\"\n (switchView)=\"vdv.toggleView()\"\n (onApproval)=\"onApprove($event)\"\n ></lib-user-request-form> -->\n <tasks-form [currentData]=\"currentData\" (switchView)=\"vdv.toggleView()\"\n (onSave)=\"onSave($event)\"></tasks-form>\n </ng-template>\n </verben-right-card-data-view>\n\n <verben-card-data-view-footer class=\"w-full\">\n <div [ngClass]=\"{\n 'flex gap-2 items-center': true,\n 'justify-end': true\n }\">\n <!-- <verbena-button\n *ngIf=\"!vdcv.hasCurrentItem()\"\n [fontWeight]=\"'bold'\"\n [bgColor]=\"'var(--vbn-color-text-muted)'\"\n [borderRadius]=\"'4px'\"\n [textColor]=\"'var(--vbn-color-surface)'\"\n [pd]=\"'9.79px 37.28px'\"\n [text]=\"'Delete'\"\n >\n </verbena-button> -->\n <div class=\"flex {{\n vdcv.hasCurrentItem() ? 'flex-1' : ''\n }} justify-end items-center gap-5\">\n <span class=\"paginator-text\">{{ cardData().length }} records loaded</span>\n <button (click)=\"loadMore()\" class=\"load-more view-links text-[var(--vbn-color-border-focus)] underline\">\n Load more\n </button>\n </div>\n </div>\n </verben-card-data-view-footer>\n </verben-card-data-view>\n </div>\n <div column-content>\n <lib-data-columns [columns]=\"config.columns\" (columnsUpdated)=\"onColumnsUpdated($event)\"></lib-data-columns>\n </div>\n <div filter-content>\n <verben-table-filter [border]=\"'1px solid var(--vbn-color-primary)'\" borderRadius=\"10px\"\n boxShadow=\"2px 2px 2px 0px silver\" bgColor=\"white\" width=\"420px\" textColor=\"black\" pd=\"1rem\"\n primaryColor=\"var(--vbn-color-primary)\" secondaryColor=\"var(--vbn-color-border-focus)\" tertiaryColor=\"var(--vbn-color-on-primary)\" [filterOptions]=\"filterArray\"\n [maxFilterLength]=\"3\"></verben-table-filter>\n </div>\n <div sort-content>\n <lib-data-sort [columns]=\"config.columns\" [data]=\"data()\" (sortApplied)=\"onSortUpdated($event)\"></lib-data-sort>\n </div>\n <div export-content>\n <lib-data-export [data]=\"data()\" (exportDataEvent)=\"handleExport($event)\">\n </lib-data-export>\n </div>\n </verben-data-view>\n\n <div *ngIf=\"vdv.isTableView\" class=\"flex gap-2 justify-between\">\n <div class=\"message-log-button-container flex justify-between\">\n <!-- <verbena-button\n [fontWeight]=\"'bold'\"\n [bgColor]=\"'var(--vbn-color-text-muted)'\"\n [borderRadius]=\"'4px'\"\n [textColor]=\"'var(--vbn-color-surface)'\"\n [pd]=\"'9.79px 37.28px'\"\n [text]=\"'Delete'\"\n >\n </verbena-button> -->\n </div>\n <div class=\"flex justify-end items-center gap-5\">\n <span class=\"paginator-text\">{{ cardData().length }} records loaded</span>\n <button (click)=\"loadMore()\" class=\"load-more view-links text-[var(--vbn-color-border-focus)] underline\">\n Load more\n </button>\n </div>\n </div>\n</div>\n", styles: [".view-links{color:var(--vbn-color-border-focus);cursor:pointer}\n"], dependencies: [{ kind: "directive", type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3$1.DataTableComponent, selector: "lib-data-table", inputs: ["data", "columns", "dataKey", "formGroupConfig", "groupBy", "useVirtualScroll", "virtualScrollItemSize", "styleConfig"], outputs: ["rowEdit", "rowSave", "rowRevert", "rowDelete", "selectionChange"] }, { kind: "directive", type: i3$1.ColumnDirective, selector: "[libColumn]", inputs: ["libColumn"] }, { kind: "component", type: i3$1.SvgComponent, selector: "verben-svg", inputs: ["icon", "width", "height", "fill", "stroke", "type", "size"] }, { kind: "component", type: i3$1.DataViewComponent, selector: "verben-data-view", inputs: ["buttonClass", "iconClass", "activeIconClass", "columnCustomClass", "filterCustomClass", "sortCustomClass", "extendCustomClass", "exportCustomClass", "selectCustomClass", "importCustomClass", "zIndex", "createCustomClass", "tableIcon", "cardIcon", "cardClass", "tableClass", "searchKey", "searchValue", "viewState", "searchTemplate", "importTemplate", "columnTemplate", "extendTemplate", "filterTemplate", "sortTemplate", "children", "exportTemplate", "createTemplate", "selectedColumnCount", "selectedSortCount", "selectedFilterTableCount", "inputWidth", "milliseconds", "showColumnChild", "showSortChild", "showFilterChild", "showImportChild", "showExportChild", "showExtendChild", "create", "showSelected", "isTableView"], outputs: ["viewChange", "stateChange", "onSearchChange"] }, { kind: "component", type: i3$1.CardDataViewComponent, selector: "verben-card-data-view", inputs: ["pd", "mg", "lHeight", "rHeight", "rWidth", "lWidth", "textColor", "lbgColor", "rbgColor", "border", "display", "borderRadius", "activeCss", "inActiveCss", "displayAsRow", "cardDataList", "dataId", "totalRecords", "footer", "noOfVisibleChildren", "showEditIcon", "useVirtualScroll", "virtualScrollItemSize", "onItemClick", "onCardChildClick"], outputs: ["editClicked", "loadMoreClick"] }, { kind: "component", type: i3$1.LeftCardDataComponent, selector: "verben-left-card-data", inputs: ["pd", "mg", "height", "weight", "activeCss", "inActiveCss", "cardDataList", "iconCollapse", "iconExpanded", "parent", "useVirtualScroll", "virtualScrollItemSize", "dataId"] }, { kind: "component", type: i3$1.LeftCardDataViewComponent, selector: "verben-left-card-data-view", inputs: ["cardDataList"] }, { kind: "component", type: i3$1.RightCardDataViewComponent, selector: "verben-right-card-data-view", inputs: ["parentData", "chilData", "meth"] }, { kind: "component", type: i3$1.CardDataViewFooterComponent, selector: "verben-card-data-view-footer" }, { kind: "component", type: i3$1.TableFilterComponent, selector: "verben-table-filter", inputs: ["filterOptions", "pd", "mg", "height", "width", "bgColor", "boxShadow", "textColor", "primaryColor", "secondaryColor", "tertiaryColor", "border", "borderRadius", "selectWidth", "maxFilterLength", "savedFilters", "tooltip", "saveCallback"], outputs: ["filtersApplied", "resetSortData"] }, { kind: "component", type: i3$1.DataExportComponent, selector: "lib-data-export", inputs: ["columns", "data", "dataFetchUrl", "dataQueryParameters"], outputs: ["exportDataEvent"] }, { kind: "component", type: i3$1.DataColumnsComponent, selector: "lib-data-columns", inputs: ["columns", "enableDragAndDrop", "maxVisibleItems", "selectedColumns"], outputs: ["columnsUpdated"] }, { kind: "component", type: i3$1.DataSortComponent, selector: "lib-data-sort", inputs: ["columns", "data", "enableDragAndDrop"], outputs: ["sortApplied", "resetFilter"] }, { kind: "directive", type: i4.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: i3$1.TooltipComponent, selector: "verben-tooltip", inputs: ["tooltipContent", "customClass", "backgroundColor", "textColor", "padding", "borderRadius", "zIndex", "border", "width", "top", "bottom", "left", "right"] }, { kind: "component", type: i5$1.OperationPopupComponent, selector: "lib-operation-popup", inputs: ["user", "task", "allowedActions"], outputs: ["actionComplete"] }, { kind: "component", type: TasksFormComponent, selector: "tasks-form", inputs: ["currentData"], outputs: ["onTaskFormSave", "onSave"] }] });
|
|
813
838
|
}
|
|
814
839
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: TasksComponent, decorators: [{
|
|
815
840
|
type: Component,
|