ApiServer: Configure service categories and products to display

I need a way to configure the displaying of service categories and products based on a customized query.
In the old WebDesigner you had these great configurable options for this:

VI_ITShop_Filter_AccProductGroup (Products to display for a given recipient)
VI_ITShop_Filter_AccProductGroupMultiUser (Products to display for a given list of recipients)
VI_ITShop_Filter_AccProduct (Displayed service categories)
VI_ITShop_Filter_AccProductMultiUser (Displayed service categories for a group of users)

In the new ApiServer I cannot find these configuration options externally (via the admin portal)
The queries for displaying service items and categories seem to be hard coded in the standard API plugins.

Why are these configuration options missing on the API server?
Are they planned for a future release, if so 9.3?
What would be a work-around strategy to accomplish this given the current 9.2 version?

Regards,
Niels


06-06-2024 Update on this
for version 9.2.1 see release notes (this feature is also included in 9.1.3 released on April 2024 so after the 9.2 release)

In the Administration Portal, you can now define a filter using the
VI_ITShop_Filter_AccProduct configuration key. This filter determines
which service items are displayed in the Web Portal depending on the
selected request recipients.

You can now define a filter in the Administration Portal using the
VI_ITShop_Filter_AccProductGroup configuration key. This filter
determines which service categories are displayed in the Web Portal
depending on the selected request recipients.


Thank you for this!

Parents
  • I guess we'll need to code it, although it does not seem to be hardcoded. Let's take the case of the service categories. This is implemented as a GET portal/shop/categories (see new-request-product.component.ts) that returns a list of service categories for a given, comma separated, uid_Person list. It would also take a filter .

    Now, and in that I agree, the filter configuration is far from being a normal string with an sql expression such as those we used in the configurable options for the old web designer, like VI_ITShop_Filter_AccProduct . I would appreciate if one of the experts could give us a hint on how we could set up a filter and how the Expression and FilterType.Expression elements work , so we can create our own config keys in the admin portal and use them in our code.

  • Thanks for pointing out the 'Filter' option of the serviceitems end-point.
    I discarded it too hastily as a proper solution for my use case.

    New plan...

    Create custom column CCC_IsToHideFromEmployee@AccProduct
    Set 'Show in wizards' option on the new column in Designer (IsFilterDesignerEnabled = 1)

    Check end-point with filter:
    https://itshop.groot.net/apiserverdev/portal/shop/serviceitems?PageSize=20&UID_Person=d941eb12-57c6-4362-8045-846300a54421&
    filter=[{"Expression":{"Expressions":[{"PropertyId":"CCC_IsToHideFromEmployee","Operator":"=","LogOperator":0,"Value":1}],"LogOperator":0}}]

    Use existing or create new 'program function/feature' (Table: DialogFeature) to have a conditional lever in the angular project
    In this case only managers can see the AccProducts where CCC_IsToHideFromEmployee = 1
    Managers have the 'Portal_UI_PersonManager' feature per default

    In the Angular project something like...

    if (!this.isManagerForPersons) {
     this.navigationState = {
          ...{ PageSize: settingsService.DefaultPageSize, StartIndex: 0 },
          ...{
            filter: [
              { ColumnName: 'CCC_IsToHideFromEmployee',
                Type: FilterType.Compare,
                CompareOp: CompareOperator.Equal,
                Value1: 0,
              },
            ],
          },
        };


Reply
  • Thanks for pointing out the 'Filter' option of the serviceitems end-point.
    I discarded it too hastily as a proper solution for my use case.

    New plan...

    Create custom column CCC_IsToHideFromEmployee@AccProduct
    Set 'Show in wizards' option on the new column in Designer (IsFilterDesignerEnabled = 1)

    Check end-point with filter:
    https://itshop.groot.net/apiserverdev/portal/shop/serviceitems?PageSize=20&UID_Person=d941eb12-57c6-4362-8045-846300a54421&
    filter=[{"Expression":{"Expressions":[{"PropertyId":"CCC_IsToHideFromEmployee","Operator":"=","LogOperator":0,"Value":1}],"LogOperator":0}}]

    Use existing or create new 'program function/feature' (Table: DialogFeature) to have a conditional lever in the angular project
    In this case only managers can see the AccProducts where CCC_IsToHideFromEmployee = 1
    Managers have the 'Portal_UI_PersonManager' feature per default

    In the Angular project something like...

    if (!this.isManagerForPersons) {
     this.navigationState = {
          ...{ PageSize: settingsService.DefaultPageSize, StartIndex: 0 },
          ...{
            filter: [
              { ColumnName: 'CCC_IsToHideFromEmployee',
                Type: FilterType.Compare,
                CompareOp: CompareOperator.Equal,
                Value1: 0,
              },
            ],
          },
        };


Children
No Data