[ACS-5761] Demo Shell Cleanup (part 2) (#8807)

cleanup demo shell
This commit is contained in:
Denys Vuika
2023-08-10 22:18:21 +01:00
committed by GitHub
parent ca60b392d4
commit f201efd56a
203 changed files with 1005 additions and 10703 deletions

View File

@@ -1,34 +0,0 @@
<mat-tab-group class="app-cloud-layout-tab-body">
<mat-tab label="App">
<adf-sidenav-layout [sidenavMin]="70" [sidenavMax]="270" [stepOver]="780">
<adf-sidenav-layout-navigation>
<ng-template>
<adf-sidebar-action-menu [expanded]="true" [width]="205" title="CREATE">
<mat-icon adf-sidebar-menu-title-icon>arrow_drop_down</mat-icon>
<div adf-sidebar-menu-options>
<button mat-menu-item data-automation-id="btn-start-task" (click)="onStartTask()">
<mat-icon>assessment</mat-icon>
<span>New Task</span>
</button>
</div>
<div adf-sidebar-menu-options>
<button mat-menu-item data-automation-id="btn-start-process" (click)="onStartProcess()">
<mat-icon>assessment</mat-icon>
<span>New Process</span>
</button>
</div>
</adf-sidebar-action-menu>
<app-community-cloud-filters-demo></app-community-cloud-filters-demo>
</ng-template>
</adf-sidenav-layout-navigation>
<adf-sidenav-layout-content>
<ng-template>
<router-outlet></router-outlet>
</ng-template>
</adf-sidenav-layout-content>
</adf-sidenav-layout>
</mat-tab>
<mat-tab label="Settings">
<app-cloud-settings></app-cloud-settings>
</mat-tab>
</mat-tab-group>

View File

@@ -1,20 +0,0 @@
.app-cloud-layout-overflow {
overflow: auto;
}
.app-cloud-layout-tab-body {
height: 100%;
min-height: 100%;
min-width: 100%;
width: 100%;
.mat-tab-body-wrapper {
height: 100%;
}
adf-sidenav-layout {
min-height: 100%;
min-width: 100%;
}
}

View File

@@ -1,59 +0,0 @@
/*!
* @license
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { Component, OnInit, ViewEncapsulation } from '@angular/core';
import { Router, ActivatedRoute } from '@angular/router';
import { CloudLayoutService } from '../services/cloud-layout.service';
@Component({
templateUrl: './community-cloud.component.html',
styleUrls: ['./community-cloud.component.scss'],
encapsulation: ViewEncapsulation.None
})
export class CommunityCloudComponent implements OnInit {
constructor(
private router: Router,
private route: ActivatedRoute,
private cloudLayoutService: CloudLayoutService
) { }
ngOnInit() {
let root: string = '';
if (this.route.snapshot && this.route.snapshot.firstChild) {
root = this.route.snapshot.firstChild.url[0].path;
}
this.route.queryParams.subscribe((params) => {
if (root === 'tasks' && params.id) {
this.cloudLayoutService.setCurrentTaskFilterParam({ id: params.id });
}
if (root === 'processes' && params.id) {
this.cloudLayoutService.setCurrentProcessFilterParam({ id: params.id });
}
});
}
onStartTask() {
this.router.navigate([`/cloud/community/start-task/`]);
}
onStartProcess() {
this.router.navigate([`/cloud/community/start-process/`]);
}
}

View File

@@ -1,29 +0,0 @@
<mat-accordion>
<mat-expansion-panel [expanded]="expandTaskFilter" (opened)="onTaskFilterOpen()" (closed)="onTaskFilterClose()" data-automation-id='Task Filters'>
<mat-expansion-panel-header>
<mat-panel-title>
Task Filters
</mat-panel-title>
</mat-expansion-panel-header>
<adf-cloud-task-filters
*ngIf="expandTaskFilter"
[showIcons]="true"
[filterParam]="currentTaskFilter$ | async"
(filterClick)="onTaskFilterSelected($event)">
</adf-cloud-task-filters>
</mat-expansion-panel>
<mat-expansion-panel [expanded]="expandProcessFilter" (opened)="onProcessFilterOpen()" (closed)="onProcessFilterClose()" data-automation-id='Process Filters'>
<mat-expansion-panel-header>
<mat-panel-title>
Process Filters
</mat-panel-title>
</mat-expansion-panel-header>
<adf-cloud-process-filters
*ngIf="expandProcessFilter"
[showIcons]="true"
[filterParam]="currentProcessFilter$ | async"
(filterClick)="onProcessFilterSelected($event)">
</adf-cloud-process-filters>
</mat-expansion-panel>
</mat-accordion>

View File

@@ -1,92 +0,0 @@
/*!
* @license
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { Component, ViewEncapsulation, OnInit } from '@angular/core';
import { Observable } from 'rxjs';
import { Router, ActivatedRoute } from '@angular/router';
import { CloudLayoutService } from '../services/cloud-layout.service';
@Component({
selector: 'app-community-cloud-filters-demo',
templateUrl: './community-filters.component.html',
encapsulation: ViewEncapsulation.None
})
export class CommunityCloudFiltersDemoComponent implements OnInit {
currentTaskFilter$: Observable<any>;
currentProcessFilter$: Observable<any>;
toggleTaskFilter = true;
toggleProcessFilter = true;
expandTaskFilter = true;
expandProcessFilter = false;
constructor(
private cloudLayoutService: CloudLayoutService,
private router: Router,
private route: ActivatedRoute
) {}
ngOnInit() {
this.currentTaskFilter$ = this.cloudLayoutService.taskFilter$;
this.currentProcessFilter$ = this.cloudLayoutService.processFilter$;
let root = '';
if (this.route.snapshot && this.route.snapshot.firstChild) {
root = this.route.snapshot.firstChild.url[0].path;
if (root === 'tasks') {
this.expandTaskFilter = true;
this.expandProcessFilter = false;
} else if (root === 'processes') {
this.expandProcessFilter = true;
this.expandTaskFilter = false;
}
}
}
onTaskFilterSelected(filter) {
this.cloudLayoutService.setCurrentTaskFilterParam({id: filter.id});
const currentFilter = Object.assign({}, filter);
this.router.navigate([`/cloud/community/tasks/`], { queryParams: currentFilter });
}
onProcessFilterSelected(filter) {
this.cloudLayoutService.setCurrentProcessFilterParam({id: filter.id});
const currentFilter = Object.assign({}, filter);
this.router.navigate([`/cloud/community/processes/`], { queryParams: currentFilter });
}
onTaskFilterOpen(): boolean {
this.expandTaskFilter = true;
this.expandProcessFilter = false;
return this.toggleTaskFilter;
}
onTaskFilterClose(): boolean {
return !this.toggleTaskFilter;
}
onProcessFilterOpen(): boolean {
this.expandProcessFilter = true;
this.expandTaskFilter = false;
return this.toggleProcessFilter;
}
onProcessFilterClose(): boolean {
return !this.toggleProcessFilter;
}
}

View File

@@ -1,21 +0,0 @@
<button data-automation-id="go-back" mat-icon-button (click)="onGoBack()">
<mat-icon>arrow_back</mat-icon> Go Back
</button>
<h4 data-automation-id="process-details-header">Simple page to show the process instance: {{ processInstanceId }}</h4>
<div class="app-process-cloud-container">
<adf-cloud-task-list
class="app-cloud-layout-overflow"
[processInstanceId]="processInstanceId"
(rowClick)="onRowClick($event)">
</adf-cloud-task-list>
<adf-cloud-process-header
class="app-process-cloud-header"
[processInstanceId]="processInstanceId">
</adf-cloud-process-header>
</div>

View File

@@ -1,17 +0,0 @@
app-community-process-details-cloud {
.app {
&-process-cloud-container {
display: flex;
}
&-cloud-layout-overflow {
width: 67%;
flex: 1;
}
&-process-cloud-header {
margin-left: 10px;
width: 25%;
}
}
}

View File

@@ -1,46 +0,0 @@
/*!
* @license
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { Component, ViewEncapsulation } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
@Component({
selector: 'app-community-process-details-cloud',
templateUrl: './community-process-details-cloud.component.html',
styleUrls: ['./community-process-details-cloud.component.scss'],
encapsulation: ViewEncapsulation.None
})
export class CommunityProcessDetailsCloudDemoComponent {
processInstanceId: string;
constructor(private route: ActivatedRoute, private router: Router) {
this.route.params.subscribe((params) => {
this.processInstanceId = params.processInstanceId;
});
}
onGoBack() {
this.router.navigate([`/cloud/community/`]);
}
onRowClick(taskId: string) {
if (taskId) {
this.router.navigate([`/cloud/community/task-details/${taskId}`]);
}
}
}

View File

@@ -1,42 +0,0 @@
<adf-cloud-edit-process-filter
[id]="filterId"
[filterProperties]="processFilterProperties.filterProperties"
[sortProperties]="processFilterProperties.sortProperties"
[actions]="processFilterProperties.actions"
(filterChange)="onFilterChange($event)"
(action)="onProcessFilterAction($event)">
</adf-cloud-edit-process-filter>
<div
class="app-cloud-process-list-container"
*ngIf="editedFilter">
<adf-cloud-process-list
#processCloud
class="app-cloud-layout-overflow"
[initiator]="editedFilter.initiator"
[processDefinitionId]="editedFilter.processDefinitionId"
[processDefinitionKey]="editedFilter.processDefinitionKey"
[id]="editedFilter.processInstanceId"
[status]="editedFilter.status"
[name]="editedFilter.processName"
[businessKey]="editedFilter['businessKey']"
[lastModifiedFrom]="editedFilter.lastModifiedFrom"
[lastModifiedTo]="editedFilter.lastModifiedTo"
[sorting]="sortArray"
[selectionMode]="selectionMode"
[multiselect]="multiselect"
(rowClick)="onRowClick($event)"
(rowsSelected)="onRowsSelected($event)">
</adf-cloud-process-list>
<adf-pagination
[target]="processCloud"
(changePageSize)="onChangePageSize($event)"
(nextPage)="resetSelectedRows()"
(prevPage)="resetSelectedRows()">
</adf-pagination>
<div *ngIf="testingMode">
Selected rows:
<ul>
<li *ngFor="let row of selectedRows">{{ row.id }}</li>
</ul>
</div>
</div>

View File

@@ -1,21 +0,0 @@
app-community-processes-cloud-demo {
height: 100%;
min-height: 100%;
min-width: 100%;
width: 100%;
.app-cloud-process-list-container {
place-content: stretch space-between;
align-items: stretch;
margin-top: 2px;
}
&, .app-cloud-process-list-container {
flex-direction: column;
display: flex;
}
.app-cloud-layout-overflow, .app-cloud-process-list-container {
flex: 1;
}
}

View File

@@ -1,153 +0,0 @@
/*!
* @license
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { Component, OnDestroy, OnInit, ViewChild, ViewEncapsulation } from '@angular/core';
import {
ProcessFilterCloudModel,
ProcessFilterCloudService,
ProcessFiltersCloudComponent,
ProcessListCloudComponent,
ProcessListCloudSortingModel
} from '@alfresco/adf-process-services-cloud';
import { ActivatedRoute, Router } from '@angular/router';
import { AppConfigService, UserPreferencesService } from '@alfresco/adf-core';
import { CloudLayoutService } from '../services/cloud-layout.service';
import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
import { Pagination } from '@alfresco/js-api';
const PROCESS_FILTER_PROPERTY_KEYS = 'adf-edit-process-filter';
const ACTION_SAVE_AS = 'saveAs';
@Component({
selector: 'app-community-processes-cloud-demo',
templateUrl: './community-processes-cloud.component.html',
styleUrls: ['./community-processes-cloud.component.scss'],
encapsulation: ViewEncapsulation.None
})
export class CommunityProcessesCloudDemoComponent implements OnInit, OnDestroy {
@ViewChild('processCloud')
processCloud: ProcessListCloudComponent;
@ViewChild('processFiltersCloud')
processFiltersCloud: ProcessFiltersCloudComponent;
isFilterLoaded: boolean;
filterId: string = '';
sortArray: any = [];
selectedRow: any;
multiselect: boolean;
selectionMode: string;
selectedRows: any[] = [];
testingMode: boolean;
processFilterProperties: any = { filterProperties: [], sortProperties: [], actions: [] };
editedFilter: ProcessFilterCloudModel;
private onDestroy$ = new Subject<boolean>();
constructor(
private route: ActivatedRoute,
private router: Router,
private cloudLayoutService: CloudLayoutService,
private userPreference: UserPreferencesService,
private processFilterCloudService: ProcessFilterCloudService,
private appConfig: AppConfigService) {
const properties = this.appConfig.get<Array<any>>(
PROCESS_FILTER_PROPERTY_KEYS
);
if (properties) {
this.processFilterProperties = properties;
}
}
ngOnInit() {
this.isFilterLoaded = false;
this.route.queryParams.subscribe((params) => {
if (Object.keys(params).length > 0) {
this.isFilterLoaded = true;
this.onFilterChange(params);
this.filterId = params.id;
} else {
this.loadDefaultFilters();
}
});
this.cloudLayoutService
.settings$
.pipe(takeUntil(this.onDestroy$))
.subscribe(settings => this.setCurrentSettings(settings));
}
ngOnDestroy() {
this.onDestroy$.next(true);
this.onDestroy$.complete();
}
loadDefaultFilters() {
this.processFilterCloudService
.getProcessFilters('community')
.subscribe((filters: ProcessFilterCloudModel[]) => {
this.onFilterChange(filters[0]);
});
}
setCurrentSettings(settings) {
if (settings) {
this.multiselect = settings.multiselect;
this.testingMode = settings.testingMode;
this.selectionMode = settings.selectionMode;
}
}
onChangePageSize(event: Pagination) {
this.userPreference.paginationSize = event.maxItems;
}
resetSelectedRows() {
this.selectedRows = [];
}
onRowClick(processInstanceId: string) {
this.router.navigate([`/cloud/community/process-details/${processInstanceId}`]);
}
onFilterChange(query: any) {
this.editedFilter = Object.assign({}, query);
this.sortArray = [
new ProcessListCloudSortingModel({
orderBy: this.editedFilter.sort,
direction: this.editedFilter.order
})
];
}
onProcessFilterAction(filterAction: any) {
this.cloudLayoutService.setCurrentProcessFilterParam({ id: filterAction.filter.id });
if (filterAction.actionType === ACTION_SAVE_AS) {
this.router.navigate([`/cloud/community/processes/`], { queryParams: filterAction.filter });
}
}
onRowsSelected(nodes) {
this.resetSelectedRows();
this.selectedRows = nodes.map((node) => node.obj);
}
}

View File

@@ -1,6 +0,0 @@
<adf-cloud-start-process
[name]="processName"
(error)="openSnackMessage($event)"
(success)="onStartProcessSuccess()"
(cancel)="onCancelStartProcess()">
</adf-cloud-start-process>

View File

@@ -1,55 +0,0 @@
/*!
* @license
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { NotificationService, AppConfigService } from '@alfresco/adf-core';
import { CloudLayoutService } from '../services/cloud-layout.service';
@Component({
templateUrl: './community-start-process-cloud.component.html'
})
export class CommunityStartProcessCloudDemoComponent implements OnInit {
processName: string;
constructor(private appConfig: AppConfigService,
private cloudLayoutService: CloudLayoutService,
private notificationService: NotificationService,
private router: Router) {
}
ngOnInit() {
this.processName = this.appConfig.get<string>('adf-start-process-cloud.name');
}
onStartProcessSuccess() {
this.cloudLayoutService.setCurrentProcessFilterParam({ key: 'running-processes' });
this.router.navigate([`/cloud/community/processes`]);
}
onCancelStartProcess() {
this.cloudLayoutService.setCurrentProcessFilterParam({ key: 'all-processes' });
this.router.navigate([`/cloud/community/processes`]);
}
openSnackMessage(event: any) {
this.notificationService.openSnackMessage(
event.response.body.message
);
}
}

View File

@@ -1,5 +0,0 @@
<adf-cloud-start-task
(error)="openSnackMessage($event)"
(success)="onStartTaskSuccess()"
(cancel)="onCancelStartTask()">
</adf-cloud-start-task>

View File

@@ -1,48 +0,0 @@
/*!
* @license
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { Component } from '@angular/core';
import { Router } from '@angular/router';
import { NotificationService } from '@alfresco/adf-core';
import { CloudLayoutService } from '../services/cloud-layout.service';
@Component({
templateUrl: './community-start-task-cloud.component.html'
})
export class CommunityStartTaskCloudDemoComponent {
constructor(
private cloudLayoutService: CloudLayoutService,
private notificationService: NotificationService,
private router: Router) {
}
onStartTaskSuccess() {
this.cloudLayoutService.setCurrentTaskFilterParam({key: 'community'});
this.router.navigate([`/cloud/community/tasks`]);
}
onCancelStartTask() {
this.cloudLayoutService.setCurrentTaskFilterParam({key: 'community'});
this.router.navigate([`/cloud/community/tasks`]);
}
openSnackMessage(event: any) {
this.notificationService.openSnackMessage(
event.response.body.message
);
}
}

View File

@@ -1,46 +0,0 @@
<adf-cloud-edit-task-filter
[id]="filterId"
[filterProperties]="taskFilterProperties.filterProperties"
[sortProperties]="taskFilterProperties.sortProperties"
[actions]="taskFilterProperties.actions"
(action)="onTaskFilterAction($event)"
(filterChange)="onFilterChange($event)">
</adf-cloud-edit-task-filter>
<div
class="app-cloud-task-list-container"
*ngIf="editedFilter">
<adf-cloud-task-list
#taskCloud
class="app-cloud-layout-overflow"
[processDefinitionId]="editedFilter.processDefinitionId"
[processInstanceId]="editedFilter.processInstanceId"
[name]="editedFilter.taskName"
[id]="editedFilter.taskId"
[parentTaskId]="editedFilter.parentTaskId"
[priority]="editedFilter.priority"
[owner]="editedFilter.owner"
[lastModifiedFrom]="editedFilter.lastModifiedFrom"
[lastModifiedTo]="editedFilter.lastModifiedTo"
[status]="editedFilter.status"
[assignee]="editedFilter.assignee"
[createdDate]="editedFilter.createdDate"
[dueDate]="editedFilter.dueDate"
[sorting]="sortArray"
[multiselect]="multiselect"
[selectionMode]="selectionMode"
(rowClick)="onRowClick($event)"
(rowsSelected)="onRowsSelected($event)">
</adf-cloud-task-list>
<adf-pagination
[target]="taskCloud"
(changePageSize)="onChangePageSize($event)"
(nextPage)="resetSelectedRows()"
(prevPage)="resetSelectedRows()">
</adf-pagination>
<div *ngIf="testingMode">
Selected rows:
<ul>
<li *ngFor="let row of selectedRows" [attr.data-automation-id]="row.id">{{ row.name }}</li>
</ul>
</div>
</div>

View File

@@ -1,27 +0,0 @@
app-community-tasks-cloud-demo {
height: 100%;
min-height: 100%;
min-width: 100%;
width: 100%;
.adf-cloud-layout-tab-body {
.mat-tab-body-wrapper {
height: 100%;
}
}
.app-cloud-task-list-container {
place-content: stretch space-between;
align-items: stretch;
margin-top: 2px;
}
&, .app-cloud-task-list-container {
flex-direction: column;
display: flex;
}
.app-cloud-layout-overflow, .app-cloud-task-list-container {
flex: 1;
}
}

View File

@@ -1,148 +0,0 @@
/*!
* @license
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { Component, OnDestroy, OnInit, ViewChild, ViewEncapsulation } from '@angular/core';
import {
TaskFilterCloudModel,
TaskFilterCloudService,
TaskListCloudComponent,
TaskListCloudSortingModel
} from '@alfresco/adf-process-services-cloud';
import { AppConfigService, UserPreferencesService } from '@alfresco/adf-core';
import { ActivatedRoute, Router } from '@angular/router';
import { CloudLayoutService } from '../services/cloud-layout.service';
import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
import { Pagination } from '@alfresco/js-api';
const ACTION_SAVE_AS = 'saveAs';
const TASK_FILTER_PROPERTY_KEYS = 'adf-edit-task-filter';
@Component({
selector: 'app-community-tasks-cloud-demo',
templateUrl: './community-task-cloud.component.html',
styleUrls: ['./community-task-cloud.component.scss'],
encapsulation: ViewEncapsulation.None
})
export class CommunityTasksCloudDemoComponent implements OnInit, OnDestroy {
@ViewChild('taskCloud')
taskCloud: TaskListCloudComponent;
isFilterLoaded = false;
selectedRow: any;
sortArray: TaskListCloudSortingModel[];
editedFilter: TaskFilterCloudModel;
taskFilterProperties: any = { filterProperties: [], sortProperties: [], actions: [] };
filterId;
multiselect: boolean;
selectedRows: any[] = [];
testingMode: boolean;
selectionMode: string;
taskDetailsRedirection: boolean;
private onDestroy$ = new Subject<boolean>();
constructor(
private cloudLayoutService: CloudLayoutService,
private route: ActivatedRoute,
private router: Router,
private taskFilterCloudService: TaskFilterCloudService,
private userPreference: UserPreferencesService,
private appConfig: AppConfigService) {
const properties = this.appConfig.get<Array<any>>(TASK_FILTER_PROPERTY_KEYS);
if (properties) {
this.taskFilterProperties = properties;
}
}
ngOnInit() {
this.isFilterLoaded = false;
this.route.queryParams.subscribe((params) => {
if (Object.keys(params).length > 0) {
this.isFilterLoaded = true;
this.onFilterChange(params);
this.filterId = params.id;
} else {
setTimeout( () => {
this.loadDefaultFilters();
});
}
});
this.cloudLayoutService
.settings$
.pipe(takeUntil(this.onDestroy$))
.subscribe(settings => this.setCurrentSettings(settings));
}
ngOnDestroy() {
this.onDestroy$.next(true);
this.onDestroy$.complete();
}
loadDefaultFilters() {
this.taskFilterCloudService
.getTaskListFilters('community')
.subscribe((filters: TaskFilterCloudModel[]) => {
this.onFilterChange(filters[0]);
});
}
setCurrentSettings(settings) {
if (settings) {
this.multiselect = settings.multiselect;
this.testingMode = settings.testingMode;
this.selectionMode = settings.selectionMode;
this.taskDetailsRedirection = settings.taskDetailsRedirection;
}
}
onChangePageSize(event: Pagination) {
this.userPreference.paginationSize = event.maxItems;
}
resetSelectedRows() {
this.selectedRows = [];
}
onRowClick(taskId: string) {
if (!this.multiselect && this.selectionMode !== 'multiple' && this.taskDetailsRedirection) {
this.router.navigate([`/cloud/community/task-details/${taskId}`]);
}
}
onRowsSelected(nodes) {
this.resetSelectedRows();
this.selectedRows = nodes.map((node) => node.obj);
}
onFilterChange(filter: any) {
this.editedFilter = Object.assign({}, filter);
this.sortArray = [new TaskListCloudSortingModel({ orderBy: this.editedFilter.sort, direction: this.editedFilter.order })];
}
onTaskFilterAction(filterAction: any) {
this.cloudLayoutService.setCurrentTaskFilterParam({ id: filterAction.filter.id });
if (filterAction.actionType === ACTION_SAVE_AS) {
this.router.navigate([`/cloud/community/tasks/`], { queryParams: filterAction.filter });
}
}
}

View File

@@ -1,16 +0,0 @@
<h4 data-automation-id="task-details-header">Simple page to show the taskId: {{ taskId }}</h4>
<div class="app-community-task-details-cloud-column">
<div class="app-community-task-details-cloud-row">
<adf-cloud-task-form
[taskId]="taskId"
(cancelClick)="goBack()"
(taskClaimed)="onClaimTask()"
(taskCompleted)="onTaskCompleted()"
(taskUnclaimed)="onUnclaimTask()"
(formSaved)="onFormSaved()"
(error)="onError($event)">
</adf-cloud-task-form>
<adf-cloud-task-header [taskId]="taskId"></adf-cloud-task-header>
</div>
</div>

View File

@@ -1,48 +0,0 @@
app-community-task-details-cloud {
.app {
&-task-detail-container {
display: flex;
}
&-task-title {
margin-left: 15px;
}
&-task-control {
width: 70%;
}
&-demop-card-container {
width: 30%;
font-family: inherit;
}
&-community-task-details-cloud-column {
margin: 0;
flex-direction: column;
.app-community-task-details-cloud-row {
flex-direction: row;
adf-cloud-task-form {
flex: 1 1 100%;
flex-direction: column;
display: flex;
max-width: 80%;
}
adf-cloud-task-header {
flex: 1;
}
}
}
&-community-task-details-cloud-column, &-community-task-details-cloud-row {
height: 100%;
min-height: 100%;
min-width: 100%;
width: 100%;
display: flex;
}
}
}

View File

@@ -1,78 +0,0 @@
/*!
* @license
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { Component, ViewEncapsulation } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { NotificationService } from '@alfresco/adf-core';
@Component({
selector: 'app-community-task-details-cloud',
templateUrl: './community-task-details-cloud.component.html',
styleUrls: ['./community-task-details-cloud.component.scss'],
encapsulation: ViewEncapsulation.None
})
export class CommunityTaskDetailsCloudDemoComponent {
taskId: string;
constructor(
private route: ActivatedRoute,
private router: Router,
private notificationService: NotificationService
) {
this.route.params.subscribe((params) => {
this.taskId = params.taskId;
});
}
isTaskValid(): boolean {
return this.taskId !== undefined;
}
goBack() {
this.router.navigate([`/cloud/community/`]);
}
onCompletedTask() {
this.goBack();
}
onUnclaimTask() {
this.goBack();
}
onClaimTask() {
this.goBack();
}
onTaskCompleted() {
this.goBack();
}
onFormSaved() {
this.notificationService.openSnackMessage('Task has been saved successfully');
}
onError({ message: error }: Error) {
let errorMessage;
try {
errorMessage = JSON.parse(error).message || JSON.parse(error).entry?.message;
errorMessage = JSON.parse(errorMessage).message;
} catch {}
this.notificationService.showError(errorMessage || error);
}
}

View File

@@ -1,95 +0,0 @@
/*!
* @license
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { CommonModule } from '@angular/common';
import { CoreModule } from '@alfresco/adf-core';
import {
ProcessServicesCloudModule,
LocalPreferenceCloudService,
PROCESS_FILTERS_SERVICE_TOKEN,
TASK_FILTERS_SERVICE_TOKEN
} from '@alfresco/adf-process-services-cloud';
import { CommunityCloudComponent } from './community-cloud.component';
import { CommunityTasksCloudDemoComponent } from './community-task-cloud.component';
import { CommunityCloudFiltersDemoComponent } from './community-filters.component';
import { CommunityProcessesCloudDemoComponent } from './community-processes-cloud.component';
import { CommunityStartProcessCloudDemoComponent } from './community-start-process-cloud.component';
import { CommunityStartTaskCloudDemoComponent } from './community-start-task-cloud.component';
import { CommunityProcessDetailsCloudDemoComponent } from './community-process-details-cloud.component';
import { CommunityTaskDetailsCloudDemoComponent } from './community-task-details-cloud.component';
import { AppCloudSharedModule } from '../shared/cloud.shared.module';
const routes: Routes = [
{
path: '',
component: CommunityCloudComponent,
children: [
{
path: 'tasks',
component: CommunityTasksCloudDemoComponent
},
{
path: 'processes',
component: CommunityProcessesCloudDemoComponent
},
{
path: 'start-task',
component: CommunityStartTaskCloudDemoComponent
},
{
path: 'start-process',
component: CommunityStartProcessCloudDemoComponent
},
{
path: 'task-details/:taskId',
component: CommunityTaskDetailsCloudDemoComponent
},
{
path: 'process-details/:processInstanceId',
component: CommunityProcessDetailsCloudDemoComponent
}
]
}
];
@NgModule({
imports: [
CommonModule,
CoreModule,
ProcessServicesCloudModule,
RouterModule.forChild(routes),
AppCloudSharedModule
],
declarations: [
CommunityCloudComponent,
CommunityTasksCloudDemoComponent,
CommunityCloudFiltersDemoComponent,
CommunityProcessesCloudDemoComponent,
CommunityStartProcessCloudDemoComponent,
CommunityStartTaskCloudDemoComponent,
CommunityProcessDetailsCloudDemoComponent,
CommunityTaskDetailsCloudDemoComponent
],
providers: [
{ provide: PROCESS_FILTERS_SERVICE_TOKEN, useClass: LocalPreferenceCloudService },
{ provide: TASK_FILTERS_SERVICE_TOKEN, useClass: LocalPreferenceCloudService }
]
})
export class AppCommunityModule {}

View File

@@ -1,128 +0,0 @@
<mat-card class="app-section">
<mat-card-title>People Cloud Component</mat-card-title>
<mat-card-content>
<br>
<mat-radio-group (change)="onChangePeopleMode($event)">
<mat-radio-button [checked]="true" class="app-people-single-mode" data-automation-id="app-people-single-mode" value="single">Single Selection</mat-radio-button>
<mat-radio-button class="app-people-multiple-mode" data-automation-id="app-people-multiple-mode" value="multiple">Multiple Selection</mat-radio-button>
</mat-radio-group>
<div class="app-people-control-options">
<mat-form-field *ngIf="isPeopleAppNameSelected()" class="app-preselect-value">
<mat-label>Application Name</mat-label>
<input matInput (input)="setPeopleAppName($any($event).target?.value)" data-automation-id="app-people-app-input" />
</mat-form-field>
<mat-form-field class="app-preselect-value">
<mat-label>Roles: ["ACTIVITI_ADMIN", "ACTIVITI_USER"]</mat-label>
<input matInput (input)="setPeopleRoles($any($event).target?.value)" data-automation-id="app-people-roles-input"/>
</mat-form-field>
<mat-form-field class="app-preselect-value">
<mat-label>Groups Restriction ["hr", "sales"]</mat-label>
<input matInput
(input)="setPeopleGroupsRestriction($any($event).target?.value)"
data-automation-id="app-people-groups-restriction-input"/>
</mat-form-field>
<mat-form-field class="app-preselect-value-full">
<mat-label>Preselect: {{ defaultPeoplePlaceholder }}</mat-label>
<input matInput (input)="setPeoplePreselectValue($any($event).target?.value)" data-automation-id="app-people-preselect-input" />
</mat-form-field>
<mat-checkbox class="app-preselect-value" (change)="onChangePeopleValidation($event)">Preselect validation</mat-checkbox>
<mat-checkbox data-automation-id="app-people-readonly" value="{{ peopleReadonly }}" (change)="onChangePeopleReadonly($event)">Read-only Mode</mat-checkbox>
</div>
<div>
<adf-cloud-people
[preSelectUsers]="preSelectUsers"
[readOnly]="peopleReadonly"
[validate]="peoplePreselectValidation"
[appName]="peopleAppName"
[roles]="peopleRoles"
[groupsRestriction]="groupsRestriction"
[title]="'ADF_TASK_LIST.START_TASK.FORM.LABEL.ASSIGNEE'"
[mode]="peopleMode"
(warning)="onUsersWarning($event)"></adf-cloud-people>
</div>
<div class="app-people-list" *ngIf="peopleMode === 'multiple'">
<h4>All Preselected Users</h4>
<mat-list role="list">
<mat-list-item *ngFor="let item of preSelectUsers" role="listitem">
<mat-icon mat-list-icon>person</mat-icon>
{{item | fullName}}
</mat-list-item>
</mat-list>
<div *ngIf="invalidUsers.length > 0">
<h4>Invalid Users <mat-icon>warning</mat-icon> </h4>
<mat-list role="list">
<mat-list-item *ngFor="let invalidUser of invalidUsers" role="listitem">
<mat-icon mat-list-icon>person</mat-icon>
{{invalidUser | fullName}}
</mat-list-item>
</mat-list>
</div>
</div>
</mat-card-content>
</mat-card>
<mat-card class="app-section">
<mat-card-title>Groups Cloud Component</mat-card-title>
<mat-card-content>
<br>
<mat-radio-group (change)="onChangeGroupsMode($event)">
<mat-radio-button [checked]="true" class="app-people-single-mode" data-automation-id="app-group-single-mode" value="single">Single Selection</mat-radio-button>
<mat-radio-button class="app-people-multiple-mode" data-automation-id="app-group-multiple-mode" value="multiple">Multiple Selection</mat-radio-button>
</mat-radio-group>
<div class="app-groups-control-options">
<mat-form-field *ngIf="isGroupAppNameSelected()" class="app-preselect-value">
<mat-label>Application Name</mat-label>
<input matInput (input)="setGroupAppName($any($event).target?.value)" data-automation-id="app-group-app-input"/>
</mat-form-field>
<mat-form-field class="app-preselect-value">
<mat-label>Roles: ["ACTIVITI_ADMIN", "ACTIVITI_USER"]</mat-label>
<input matInput (input)="setGroupRoles($any($event).target?.value)" data-automation-id="app-group-roles-input"/>
</mat-form-field>
<mat-form-field class="app-preselect-value-full">
<mat-label>Preselect: {{ defaultGroupPlaceholder }}</mat-label>
<input matInput (input)="setGroupsPreselectValue($any($event).target?.value)" data-automation-id="app-group-preselect-input" />
</mat-form-field>
<mat-checkbox class="app-preselect-value" (change)="onChangeGroupValidation($event)">Preselect validation</mat-checkbox>
<mat-checkbox
data-automation-id="app-group-readonly"
value="{{ groupReadonly }}"
(change)="onChangeGroupReadonly($event)">
Read-only Mode
</mat-checkbox>
</div>
<div>
<adf-cloud-group
[mode]="groupMode"
[readOnly]="groupReadonly"
[validate]="groupPreselectValidation"
[roles]="groupRoles"
[appName]="groupAppName"
[preSelectGroups]="preSelectGroup"
(warning)="onGroupsWarning($event)"></adf-cloud-group>
</div>
<div class="app-group-list" *ngIf="groupMode === 'multiple'">
<h4>All Preselected Groups</h4>
<mat-list role="list">
<mat-list-item *ngFor="let item of preSelectGroup" role="listitem">
<mat-icon mat-list-icon>group</mat-icon>
{{ item.name }}
</mat-list-item>
</mat-list>
<div *ngIf="invalidGroups.length > 0">
<h4>Invalid Groups <mat-icon>warning</mat-icon> </h4>
<mat-list role="list">
<mat-list-item *ngFor="let invalidGroup of invalidGroups" role="listitem">
<mat-icon mat-list-icon>group</mat-icon>
{{invalidGroup?.name}}
</mat-list-item>
</mat-list>
</div>
</div>
</mat-card-content>
</mat-card>

View File

@@ -1,31 +0,0 @@
.app {
&-section {
mat-card-title {
font-size: 18px;
font-weight: bold;
}
mat-radio-group {
margin: 7px 10px;
mat-radio-button {
margin: 0 3px;
}
}
mat-card-content {
.app-preselect-value {
margin-right: 15px;
min-width: 25%;
&-big {
width: 60%;
}
&-full {
width: 100%;
}
}
}
}
}

View File

@@ -1,164 +0,0 @@
/*!
* @license
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { Component, ViewEncapsulation } from '@angular/core';
import { ComponentSelectionMode, IdentityUserModel, IdentityGroupModel } from '@alfresco/adf-process-services-cloud';
import { MatCheckboxChange } from '@angular/material/checkbox';
import { MatRadioChange } from '@angular/material/radio';
@Component({
selector: 'app-people-groups-cloud',
templateUrl: './people-groups-cloud-demo.component.html',
styleUrls: ['./people-groups-cloud-demo.component.scss'],
encapsulation: ViewEncapsulation.None
})
export class PeopleGroupCloudDemoComponent {
defaultFilterMode: string = 'appName';
defaultGroupPlaceholder: string = `[{"id": "1", "name":"activitiUserGroup"}]`;
defaultPeoplePlaceholder: string = `[{"id": "1", email": "user@user.com", "firstName":"user", "lastName": "lastName", "username": "user"}]`;
peopleMode: ComponentSelectionMode = 'single';
preSelectUsers: IdentityUserModel[] = [];
invalidUsers: IdentityUserModel[] = [];
peopleRoles: string[] = [];
groupsRestriction: string[] = [];
peopleAppName: string;
peopleFilterMode: string = this.defaultFilterMode;
peoplePreselectValidation = false;
groupPreselectValidation = false;
peopleReadonly = false;
groupReadonly = false;
groupMode: ComponentSelectionMode = 'single';
preSelectGroup: IdentityGroupModel[] = [];
invalidGroups: IdentityGroupModel[] = [];
groupRoles: string[];
groupAppName: string;
groupFilterMode: string = this.defaultFilterMode;
setPeoplePreselectValue(value: string): void {
this.preSelectUsers = this.getArrayFromString(value);
}
setGroupsPreselectValue(value: string): void {
this.preSelectGroup = this.getArrayFromString(value);
}
setPeopleRoles(value: string): void {
this.peopleRoles = this.getArrayFromString(value);
}
setGroupRoles(value: string): void {
this.groupRoles = this.getArrayFromString(value);
}
setPeopleAppName(value: string): void {
this.peopleAppName = value;
}
setGroupAppName(value: string): void {
this.groupAppName = value;
}
setPeopleGroupsRestriction(value: string): void {
this.groupsRestriction = this.getArrayFromString(value);
}
onChangePeopleMode(event: MatRadioChange): void {
this.peopleMode = event.value;
}
onChangePeopleReadonly(event: MatCheckboxChange): void {
this.peopleReadonly = event.checked;
}
onChangeGroupReadonly(event: MatCheckboxChange): void {
this.groupReadonly = event.checked;
}
onChangeGroupsMode(event: MatRadioChange): void {
this.groupMode = event.value;
}
onChangePeopleFilterMode(event: MatRadioChange): void {
this.peopleFilterMode = event.value;
this.resetPeopleFilter();
}
onChangeGroupsFilterMode(event: MatRadioChange): void {
this.groupFilterMode = event.value;
this.restGroupFilter();
}
isPeopleAppNameSelected(): boolean {
return this.peopleFilterMode === 'appName';
}
isGroupAppNameSelected(): boolean {
return this.groupFilterMode === 'appName';
}
resetPeopleFilter(): void {
if (this.isPeopleAppNameSelected()) {
this.peopleRoles = [];
} else {
this.peopleAppName = '';
}
}
restGroupFilter(): void {
if (this.isGroupAppNameSelected()) {
this.groupRoles = [];
} else {
this.groupAppName = '';
}
}
onChangePeopleValidation(event: MatCheckboxChange): void {
this.peoplePreselectValidation = event.checked;
}
onChangeGroupValidation(event: MatCheckboxChange): void {
this.groupPreselectValidation = event.checked;
}
onGroupsWarning(warning: any): void {
this.invalidGroups = warning.groups;
}
onUsersWarning(warning: any): void {
this.invalidUsers = warning.users;
}
isStringArray(str: string): boolean {
try {
const result = JSON.parse(str);
return Array.isArray(result);
} catch (e) {
return false;
}
}
private getArrayFromString<T = any>(value: string): T[] {
if (this.isStringArray(value)) {
return JSON.parse(value);
} else {
return [];
}
}
}

View File

@@ -1,38 +0,0 @@
<adf-cloud-service-task-filters
[appName]="appName"
[filterParam]="{index: 0}"
(filterClicked)="onTaskFilterSelected($event)"
(filterSelected)="onTaskFilterSelected($event)">
</adf-cloud-service-task-filters>
<div class="app-task-list-with-filter">
<adf-cloud-edit-service-task-filter
[id]="filterId"
[appName]="appName"
[filterProperties]="taskFilterProperties.filterProperties"
[sortProperties]="taskFilterProperties.sortProperties"
[actions]="taskFilterProperties.actions"
(filterChange)="onFilterChange($event)">
</adf-cloud-edit-service-task-filter>
<div
class="app-task-list-container"
*ngIf="editedFilter">
<adf-cloud-service-task-list
#taskCloud
[queryParams]="editedFilter"
class="app-cloud-layout-overflow"
[appName]="editedFilter.appName"
[sorting]="sortArray"
[multiselect]="multiselect"
[selectionMode]="selectionMode"
[stickyHeader]="true"
[showActions]="actionMenu"
[showContextMenu]="contextMenu">
</adf-cloud-service-task-list>
<adf-pagination
[target]="taskCloud"
(changePageSize)="onChangePageSize($event)"
(nextPage)="resetSelectedRows()"
(prevPage)="resetSelectedRows()">
</adf-pagination>
</div>
</div>

View File

@@ -1,25 +0,0 @@
app-service-task-list-cloud-demo {
min-height: 100%;
min-width: 100%;
display: flex;
.app-task-list-with-filter, .app-task-list-container {
flex-direction: column;
display: flex;
flex: 1;
}
&, .app-task-list-container {
height: 100%;
width: 100%;
}
.app-task-list-container {
place-content: stretch space-between;
align-items: stretch;
.app-cloud-layout-overflow {
flex: 1;
}
}
}

View File

@@ -1,114 +0,0 @@
/*!
* @license
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { Component, OnDestroy, OnInit, ViewChild, ViewEncapsulation } from '@angular/core';
import {
ServiceTaskFilterCloudModel,
ServiceTaskListCloudComponent,
TaskListCloudSortingModel
} from '@alfresco/adf-process-services-cloud';
import { AppConfigService, PaginationModel, UserPreferencesService } from '@alfresco/adf-core';
import { CloudLayoutService, CloudServiceSettings } from './services/cloud-layout.service';
import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
const TASK_FILTER_PROPERTY_KEYS = 'adf-edit-service-task-filter';
@Component({
selector: 'app-service-task-list-cloud-demo',
templateUrl: './service-task-list-cloud-demo.component.html',
styleUrls: ['./service-task-list-cloud-demo.component.scss'],
encapsulation: ViewEncapsulation.None
})
export class ServiceTaskListCloudDemoComponent implements OnInit, OnDestroy {
@ViewChild('taskCloud')
taskCloud: ServiceTaskListCloudComponent;
appName = 'simpleapp';
isFilterLoaded = false;
selectedRow: any;
sortArray: TaskListCloudSortingModel[];
editedFilter: ServiceTaskFilterCloudModel;
taskFilterProperties: any = { filterProperties: [], sortProperties: [], actions: [] };
multiselect: boolean;
selectedRows: string[] = [];
actionMenu: boolean;
contextMenu: boolean;
actions: any[] = [];
selectedAction: { id: number; name: string; actionType: string};
selectedContextAction: { id: number; name: string; actionType: string};
selectionMode: string;
filterId: string;
private onDestroy$ = new Subject<boolean>();
constructor(
private cloudLayoutService: CloudLayoutService,
private userPreference: UserPreferencesService,
private appConfig: AppConfigService) {
const properties = this.appConfig.get<Array<any>>(TASK_FILTER_PROPERTY_KEYS);
if (properties === this.taskFilterProperties) {
this.taskFilterProperties = properties;
}
}
ngOnInit() {
this.isFilterLoaded = false;
this.cloudLayoutService.settings$
.pipe(takeUntil(this.onDestroy$))
.subscribe(settings => this.setCurrentSettings(settings));
}
ngOnDestroy() {
this.onDestroy$.next(true);
this.onDestroy$.complete();
}
setCurrentSettings(settings: CloudServiceSettings) {
if (settings) {
this.multiselect = settings.multiselect;
this.selectionMode = settings.selectionMode;
this.actionMenu = settings.actionMenu;
this.contextMenu = settings.contextMenu;
this.actions = settings.actions;
}
}
onTaskFilterSelected(filter: ServiceTaskFilterCloudModel) {
this.filterId = filter.id;
this.editedFilter = filter;
}
onChangePageSize(event: PaginationModel) {
this.userPreference.paginationSize = event.maxItems;
}
resetSelectedRows() {
this.selectedRows = [];
}
onFilterChange(filter: ServiceTaskFilterCloudModel) {
this.appName = filter.appName;
this.editedFilter = Object.assign({}, filter);
this.sortArray = [new TaskListCloudSortingModel({ orderBy: this.editedFilter.sort, direction: this.editedFilter.order })];
}
}

View File

@@ -1,27 +0,0 @@
<h2>Task Header Cloud</h2>
<mat-form-field class="app-appName-input">
App name
<input matInput
[type]="'text'"
[formControl]="appNameFormControl"
(change)="updateTaskHeader()">
</mat-form-field>
<mat-form-field class="app-taskId-input">
Task id
<input matInput
[type]="'text'"
[formControl]="taskIdFormControl"
(change)="updateTaskHeader()">
</mat-form-field>
<mat-error *ngIf="errorMessage">{{errorMessage}}</mat-error>
<div>
<adf-cloud-task-header #taskHeader
[appName]="appName"
[taskId]="taskId"
(error)="onError($event)">
</adf-cloud-task-header>
</div>

View File

@@ -1,15 +0,0 @@
.app {
&-appName-input {
width: 500px;
margin-right: 50px;
}
&-taskId-input {
width: 500px;
}
&-find-task-button {
background-color: #ff9800;
margin-left: 30px;
}
}

View File

@@ -1,49 +0,0 @@
/*!
* @license
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { Component, ViewChild } from '@angular/core';
import { TaskHeaderCloudComponent } from '@alfresco/adf-process-services-cloud';
import { UntypedFormControl } from '@angular/forms';
@Component({
templateUrl: './task-header-cloud-demo.component.html',
styleUrls: ['./task-header-cloud-demo.component.scss']
})
export class TaskHeaderCloudDemoComponent {
@ViewChild('taskHeader', { static: true })
taskHeader: TaskHeaderCloudComponent;
appName: string;
taskId: string;
errorMessage;
appNameFormControl = new UntypedFormControl('');
taskIdFormControl = new UntypedFormControl('');
constructor() {}
updateTaskHeader() {
this.errorMessage = undefined;
this.appName = this.appNameFormControl.value;
this.taskId = this.taskIdFormControl.value;
}
onError(error) {
this.errorMessage = error;
}
}