mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-06-30 18:15:11 +00:00
Update process variable column type (#7664)
This commit is contained in:
parent
c05259e6cf
commit
c95ff1a839
@ -1,4 +0,0 @@
|
||||
// eslint-disable-next-line no-shadow
|
||||
export enum ColumnDataType {
|
||||
processVariableColumn = 'process-variable-column'
|
||||
}
|
@ -1,3 +1,21 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2019 Alfresco Software, Ltd.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
export const PROCESS_LIST_CUSTOM_VARIABLE_COLUMN = 'process-variable-column';
|
||||
export interface ProcessListDataColumnCustomData {
|
||||
assignedVariableDefinitionIds: string[];
|
||||
columnType: string;
|
||||
|
@ -37,7 +37,7 @@ import { ProcessListCloudSortingModel } from '../models/process-list-sorting.mod
|
||||
import { PROCESS_LISTS_PREFERENCES_SERVICE_TOKEN } from '../../../services/cloud-token.service';
|
||||
import { LocalPreferenceCloudService } from '../../../services/local-preference-cloud.service';
|
||||
import { ProcessListCloudPreferences } from '../models/process-cloud-preferences';
|
||||
import { ColumnDataType } from '../../../models/column-data-type.model';
|
||||
import { PROCESS_LIST_CUSTOM_VARIABLE_COLUMN } from '../../../models/data-column-custom-data';
|
||||
|
||||
@Component({
|
||||
template: `
|
||||
@ -116,7 +116,7 @@ describe('ProcessListCloudComponent', () => {
|
||||
id: 'variableColumnId',
|
||||
customData: {
|
||||
assignedVariableDefinitionIds: ['variableDefinitionId'],
|
||||
columnType: ColumnDataType.processVariableColumn
|
||||
columnType: PROCESS_LIST_CUSTOM_VARIABLE_COLUMN
|
||||
}
|
||||
})
|
||||
]
|
||||
|
@ -29,9 +29,8 @@ import { map, switchMap, take, tap } from 'rxjs/operators';
|
||||
import { PreferenceCloudServiceInterface } from '../../../services/preference-cloud.interface';
|
||||
import { PROCESS_LISTS_PREFERENCES_SERVICE_TOKEN } from '../../../services/cloud-token.service';
|
||||
import { ProcessListCloudPreferences } from '../models/process-cloud-preferences';
|
||||
import { ColumnDataType } from '../../../models/column-data-type.model';
|
||||
import { ProcessListDatatableAdapter } from '../datatable/process-list-datatable-adapter';
|
||||
import { ProcessListDataColumnCustomData } from '../../../models/data-column-custom-data';
|
||||
import { ProcessListDataColumnCustomData, PROCESS_LIST_CUSTOM_VARIABLE_COLUMN } from '../../../models/data-column-custom-data';
|
||||
import { VariableMapperService } from '../../../services/variable-mapper.sevice';
|
||||
|
||||
const PRESET_KEY = 'adf-cloud-process-list.presets';
|
||||
@ -473,7 +472,7 @@ export class ProcessListCloudComponent extends DataTableSchema<ProcessListDataCo
|
||||
private getRequestNodeVariableIds(): string[] | undefined {
|
||||
const displayedVariableColumns = this.columns
|
||||
.filter(column =>
|
||||
column.customData?.columnType === ColumnDataType.processVariableColumn &&
|
||||
column.customData?.columnType === PROCESS_LIST_CUSTOM_VARIABLE_COLUMN &&
|
||||
column.isHidden !== true
|
||||
)
|
||||
.map(column => column.customData.assignedVariableDefinitionIds)
|
||||
|
@ -16,9 +16,8 @@
|
||||
*/
|
||||
|
||||
import { DataColumn, DataRow, getDataColumnMock } from '@alfresco/adf-core';
|
||||
import { ColumnDataType } from '../../../models/column-data-type.model';
|
||||
import { getProcessInstanceVariableMock } from '../../../mock/process-instance-variable.mock';
|
||||
import { ProcessListDataColumnCustomData } from '../../../models/data-column-custom-data';
|
||||
import { ProcessListDataColumnCustomData, PROCESS_LIST_CUSTOM_VARIABLE_COLUMN } from '../../../models/data-column-custom-data';
|
||||
import { ProcessInstanceCloudListViewModel } from '../models/perocess-instance-cloud-view.model';
|
||||
import { ProcessListDatatableAdapter } from './process-list-datatable-adapter';
|
||||
|
||||
@ -42,7 +41,7 @@ describe('ProcessListDatatableAdapter', () => {
|
||||
title: 'columnDisplayName1',
|
||||
customData: {
|
||||
assignedVariableDefinitionIds: ['1'],
|
||||
columnType: ColumnDataType.processVariableColumn
|
||||
columnType: PROCESS_LIST_CUSTOM_VARIABLE_COLUMN
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -1,6 +1,5 @@
|
||||
import { DataColumn, DataRow, ObjectDataTableAdapter } from '@alfresco/adf-core';
|
||||
import { ProcessListDataColumnCustomData } from '../../../models/data-column-custom-data';
|
||||
import { ColumnDataType } from '../../../models/column-data-type.model';
|
||||
import { ProcessListDataColumnCustomData, PROCESS_LIST_CUSTOM_VARIABLE_COLUMN } from '../../../models/data-column-custom-data';
|
||||
import { ProcessInstanceCloudListViewModel } from '../models/perocess-instance-cloud-view.model';
|
||||
|
||||
export class ProcessListDatatableAdapter extends ObjectDataTableAdapter {
|
||||
@ -12,7 +11,7 @@ export class ProcessListDatatableAdapter extends ObjectDataTableAdapter {
|
||||
}
|
||||
|
||||
getColumnType(row: DataRow, col: DataColumn<ProcessListDataColumnCustomData>): string {
|
||||
if (col.customData?.columnType === ColumnDataType.processVariableColumn) {
|
||||
if (col.customData?.columnType === PROCESS_LIST_CUSTOM_VARIABLE_COLUMN) {
|
||||
const variableDisplayName = col.title;
|
||||
const columnType = row.obj.variablesMap?.[variableDisplayName]?.type;
|
||||
return columnType ?? 'text';
|
||||
|
@ -16,8 +16,7 @@
|
||||
*/
|
||||
|
||||
import { DataColumn, DataRow, getDataColumnMock } from '@alfresco/adf-core';
|
||||
import { ColumnDataType } from '../../../models/column-data-type.model';
|
||||
import { ProcessListDataColumnCustomData } from '../../../models/data-column-custom-data';
|
||||
import { ProcessListDataColumnCustomData, PROCESS_LIST_CUSTOM_VARIABLE_COLUMN } from '../../../models/data-column-custom-data';
|
||||
import { TasksListDatatableAdapter } from './task-list-datatable-adapter';
|
||||
import { TaskInstanceCloudListViewModel } from '../models/task-cloud-view.model';
|
||||
import { getTaskCloudModelMock } from '../../../mock/task-cloud-model.mock';
|
||||
@ -52,7 +51,7 @@ describe('TasksListDatatableAdapter', () => {
|
||||
title: 'columnDisplayName1',
|
||||
customData: {
|
||||
assignedVariableDefinitionIds: ['variableDefinitionId'],
|
||||
columnType: ColumnDataType.processVariableColumn
|
||||
columnType: PROCESS_LIST_CUSTOM_VARIABLE_COLUMN
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -16,8 +16,7 @@
|
||||
*/
|
||||
|
||||
import { DataColumn, DataRow, ObjectDataTableAdapter } from '@alfresco/adf-core';
|
||||
import { ProcessListDataColumnCustomData } from '../../../models/data-column-custom-data';
|
||||
import { ColumnDataType } from '../../../models/column-data-type.model';
|
||||
import { ProcessListDataColumnCustomData, PROCESS_LIST_CUSTOM_VARIABLE_COLUMN } from '../../../models/data-column-custom-data';
|
||||
import { TaskInstanceCloudListViewModel } from '../models/task-cloud-view.model';
|
||||
|
||||
export class TasksListDatatableAdapter extends ObjectDataTableAdapter {
|
||||
@ -29,7 +28,7 @@ export class TasksListDatatableAdapter extends ObjectDataTableAdapter {
|
||||
}
|
||||
|
||||
getColumnType(row: DataRow, col: DataColumn<ProcessListDataColumnCustomData>): string {
|
||||
if (col.customData?.columnType === ColumnDataType.processVariableColumn) {
|
||||
if (col.customData?.columnType === PROCESS_LIST_CUSTOM_VARIABLE_COLUMN) {
|
||||
const variableDisplayName = col.title;
|
||||
const columnType = row.obj.variablesMap?.[variableDisplayName]?.type;
|
||||
return columnType ?? 'text';
|
||||
|
@ -18,10 +18,4 @@
|
||||
import { TaskCloudModel } from '../../../models/task-cloud.model';
|
||||
import { WithVariablesMap } from '../../../models/process-instance-variable.model';
|
||||
|
||||
// Temporary solution due to incompatibility types for dates (TaskCloudModel is not exposed right now)
|
||||
interface TaskViewCloudModel extends TaskCloudModel {
|
||||
createdDate: any;
|
||||
lastModified: any;
|
||||
}
|
||||
|
||||
export type TaskInstanceCloudListViewModel = WithVariablesMap<TaskViewCloudModel>;
|
||||
export type TaskInstanceCloudListViewModel = WithVariablesMap<TaskCloudModel>;
|
||||
|
@ -19,8 +19,8 @@ export * from './components/task-list-cloud.component';
|
||||
export * from './components/service-task-list-cloud.component';
|
||||
|
||||
export * from './models/service-task-cloud.model';
|
||||
export * from './models/task-preset-cloud.model';
|
||||
export * from './models/tasks-cloud-preferences';
|
||||
export * from './models/task-preset-cloud.model';
|
||||
|
||||
export * from './services/task-list-cloud.service';
|
||||
export * from './services/service-task-list-cloud.service';
|
||||
|
@ -33,5 +33,5 @@ export * from './lib/models/engine-event-cloud.model';
|
||||
export * from './lib/models/task-cloud.model';
|
||||
export * from './lib/models/filter-cloud-model';
|
||||
export * from './lib/models/task-list-sorting.model';
|
||||
export * from './lib/models/column-data-type.model';
|
||||
export * from './lib/models/process-instance-variable.model';
|
||||
export * from './lib/models/variable-definition';
|
||||
|
Loading…
x
Reference in New Issue
Block a user