mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-05-12 17:04:46 +00:00
[ACS-4129] Folder rules - temporarily change 'Category value' to text box (#2830)
* ACS-4129 - temporarily changed category-value to text box * ACS-4129 - typo correction
This commit is contained in:
parent
95ed79bc0e
commit
79243bad54
@ -133,6 +133,14 @@ const actionParam5TransformedMock: ActionParameterDefinitionTransformed = {
|
||||
parameterConstraintName: ''
|
||||
};
|
||||
|
||||
const actionParamLinkToCategoryTransformedMock = {
|
||||
name: 'category-value',
|
||||
type: 'd:noderef',
|
||||
multiValued: false,
|
||||
mandatory: true,
|
||||
displayLabel: 'Category value'
|
||||
};
|
||||
|
||||
const action1TransformedMock: ActionDefinitionTransformed = {
|
||||
id: 'mock-action-1-definition',
|
||||
name: 'mock-action-1-definition',
|
||||
@ -159,6 +167,16 @@ const action2TransformedMock: ActionDefinitionTransformed = {
|
||||
parameterDefinitions: []
|
||||
};
|
||||
|
||||
export const actionLinkToCategoryTransformedMock: ActionDefinitionTransformed = {
|
||||
id: 'mock-action-3-definition',
|
||||
name: 'mock-action-3-definition',
|
||||
description: '',
|
||||
title: 'mock-action-3-definition',
|
||||
applicableTypes: [],
|
||||
trackStatus: false,
|
||||
parameterDefinitions: [actionParamLinkToCategoryTransformedMock]
|
||||
};
|
||||
|
||||
export const actionsTransformedListMock: ActionDefinitionTransformed[] = [action1TransformedMock, action2TransformedMock];
|
||||
|
||||
export const validActionMock: RuleAction = {
|
||||
|
@ -26,7 +26,7 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { CardViewBoolItemModel, CardViewComponent, CardViewSelectItemModel, CardViewTextItemModel, CoreTestingModule } from '@alfresco/adf-core';
|
||||
import { RuleActionUiComponent } from './rule-action.ui-component';
|
||||
import { actionsTransformedListMock } from '../../mock/actions.mock';
|
||||
import { actionLinkToCategoryTransformedMock, actionsTransformedListMock } from '../../mock/actions.mock';
|
||||
import { DebugElement } from '@angular/core';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { dummyConstraints } from '../../mock/action-parameter-constraints.mock';
|
||||
@ -90,4 +90,19 @@ describe('RuleActionUiComponent', () => {
|
||||
changeMatSelectValue('rule-action-select', 'mock-action-2-definition');
|
||||
expect(cardView.properties.length).toBe(0);
|
||||
});
|
||||
|
||||
it('should create category-value action parameter as a text box rather than node picker', () => {
|
||||
component.actionDefinitions = [actionLinkToCategoryTransformedMock];
|
||||
component.parameterConstraints = dummyConstraints;
|
||||
fixture.detectChanges();
|
||||
|
||||
const cardView = getByDataAutomationId('rule-action-card-view').componentInstance as CardViewComponent;
|
||||
expect(cardView.properties.length).toBe(0);
|
||||
|
||||
changeMatSelectValue('rule-action-select', 'mock-action-3-definition');
|
||||
|
||||
expect(cardView.properties[0].icon).toBeFalsy();
|
||||
expect(cardView.properties[0].value).toBeFalsy();
|
||||
expect(cardView.properties[0]).toBeInstanceOf(CardViewTextItemModel);
|
||||
});
|
||||
});
|
||||
|
@ -190,7 +190,7 @@ export class RuleActionUiComponent implements ControlValueAccessor, OnInit, OnDe
|
||||
value: this.parameters[paramDef.name] ?? false
|
||||
});
|
||||
case 'd:noderef':
|
||||
if (!constraintsForDropdownBox && !this.readOnly) {
|
||||
if (!constraintsForDropdownBox && !this.readOnly && paramDef.name !== 'category-value') {
|
||||
return new CardViewTextItemModel({
|
||||
...cardViewPropertiesModel,
|
||||
icon: 'folder',
|
||||
|
Loading…
x
Reference in New Issue
Block a user