Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing viewConfig in ForeignKeyPickerData #183

Open
gitpm opened this issue Sep 18, 2024 · 0 comments
Open

Missing viewConfig in ForeignKeyPickerData #183

gitpm opened this issue Sep 18, 2024 · 0 comments

Comments

@gitpm
Copy link

gitpm commented Sep 18, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant