Skip to content

Missing viewConfig in ForeignKeyPickerData #183

@gitpm

Description

@gitpm

Internal Issue created: 472280

To my point of view the "ForeignKeyPickerData" - interface -> Link is missing a viewConfig - Configuration-parameter in order to control the view of the fkSelector.

Hence this is my suggestion:

export interface ForeignKeyPickerData {
    fkRelations: IForeignKeyInfo[];
    selectedTableName?: string;
    idList?: string[];
    isMultiValue?: boolean;
    isRequired?: boolean;
    disabledIds?: string[];
    viewConfig?: DataSourceToolbarViewConfig;  **// ccc-change**
}

in the fk-selector.component.ts I use this parameter to control the viewConfig:

 this.settings = {
          dataSource: this.builder.buildReadWriteEntities(
            await this.selectedTable.Get(navigationState),
            this.entitySchema
          ),
          displayedColumns,
          entitySchema: this.entitySchema,
          filters: this.filters,
          dataModel: this.dataModel,
          navigationState,
          filterTree: {
            multiSelect: true,
            filterMethode: async (parentKey) => this.selectedTable.GetFilterTree(parentKey)
          },
          viewConfig: this.data.viewConfig   **// ccc-change**
        };

The new parameter gives me the possibilty to inject a viewConfig to the fk-selector.
In my case I used this code to change the fk-selector's view in the new-request.component.ts

public async openSidesheet(): Promise<void> {
  const idList = MultiValue.FromString(this.orchestration.recipients.Column.GetValue()).GetValues();
  const response: FKAdvancedPickerResponse = await this.sidesheetService.open(FkAdvancedPickerComponent, {
    title: await this.translateService.get('#LDS#Heading Select Recipients').toPromise(),
    icon: 'user',
    width: 'max(600px, 50%)',
    padding: '0px',
    disableClose: true,
    testId: 'new-requests-recipients-sidesheet',
    data: {
      displayValue: '',
      isRequired: true,
      fkRelations: this.recipientsApi.getFKRelations(),
      isMultiValue: true,
      idList,
      **// ccc-change begin**
      viewConfig:  {
        viewId: 'ccc-view',
          viewConfigs: [{
          ViewId: 'ccc-view',
          IsReadOnly: false,
          UseAsDefault: true,
          AdditionalTableColumns: ['UID_Department',  'CCC_ContractType', 'IdentityType']
        }]
     }
     **// ccc-change-end**
    },
  }).afterClosed().toPromise();`

By the way an example how to use the viewConfig and to control the columns, add optional columns per default, modify the DataModel in the API for a new/given API-Endpoint would be very helpful.
My impression is that with the PersonConfig-Settings in the QER-API-Code like e.g. '.VI_MyData_WhitePages_ResultAttributes' which contains a fixed set of colums. it is very hard and complex to modify these given sets of result columns in the ui-result output

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions