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

Include the 'default' profile in the options for the profile to be edited #578

Closed
3 tasks done
Tracked by #576
jamesrwelch opened this issue Jun 30, 2022 · 3 comments
Closed
3 tasks done
Tracked by #576
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@jamesrwelch
Copy link
Contributor

jamesrwelch commented Jun 30, 2022

Overview

The current bulk-editor only supports profiles defined by a profile service - it would be nice if we could also include the 'default profile' as an option. This may need to be hand-coded, but bulk-editing descriptions will be an important use-case.

Screenshot 2022-06-30 at 14 42 31

Tasks

@pjmonks pjmonks added this to MDM State Jul 4, 2022
@pjmonks pjmonks moved this to Backlog in MDM State Jul 4, 2022
@pjmonks pjmonks added for discussion More discussion required to decide how to resolve an issue enhancement New feature or request labels Jul 4, 2022
@pjmonks
Copy link
Contributor

pjmonks commented Jul 4, 2022

A "default profile" does not exist as such, but there may be ways to pretend or intercept that idea using profiles, but treated differently.

  • If handled in the back-end, it may require extensive implementation to intercept a special profile and map the properties to their hardcoded catalogue item properties.
  • Alternatively, the front-end could treat this as a profile in it's own right for display/editing, but would have to handle the read/write operations manually by mapping the catalogue item properties to/from the profile.

However, if it could be treated like any other profile, then the bulk editor should just work by adding additional tabs to the existing edit interface.

Things to consider though:

  1. The "default profile" will differ slightly between domain types e.g. a Data Class and Data Element may have slightly different core metadata properties.
  2. A plan will need to be made as to how to implement the profile interception (most likely in the front-end).

@pjmonks
Copy link
Contributor

pjmonks commented Jul 5, 2022

After some architecture review of the current bulk editor, here is my proposal to support "default" profiles.

Profile Object

When using the /api/{domain}/{id}/profiles/... endpoints, they always return one or more Profile objects, structured something like:

{
  "id": "1234",
  "domainType": "DataModel",
  "label": "Profile name",
  "sections": [
    {
      "name": "Section 1",
      "fields": [
        {
          "metadataPropertyName": "keyName",
          "fieldName": "Display name",
          "dataType": "string",
          "currentValue": "Hello"
        }
      ]
    }
  ]
}

The issue with a "default" profile is that such a profile would actually map to concrete data fields in a catalogue item:

{
  "description": "Some text",
  "author": "A. User",
}

So my thinking is to create a a fake profile object to represent the "default" profile:

{
  "id": "1234",
  "domainType": "DataModel",
  "label": "Default profile",
  "sections": [
    {
      "name": "Default",
      "fields": [
        {
          "metadataPropertyName": "description",
          "fieldName": "Description",
          "dataType": "string",
          "currentValue": "Some text"
        },
        {
          "metadataPropertyName": "author",
          "fieldName": "Author",
          "dataType": "string",
          "currentValue": "A. User"
        }
      ]
    }
  ]
}

This would be a special Profile object though:

  1. It would not be retrieved from Mauro - since no plugin or profile service would provide this. Instead, the UI would manually create this Profile object and map a catalogue item to each currentValue
  2. Saving this default profile would also have to be intercepted, as the /api/.../profile endpoints would not accept it. Instead, the UI would grab this and map all currentValue properties back to the original catalogue item, then save the item via a POST request.

Bulk edit abstraction layer

Bulk edit UI ideas-Code architecture drawio

To intercept this special profile object, first the bulk editor components need to have an abstraction layer added between the UI components and the Mauro API. This will allow the UI to continue functioning when the abstraction layer can then be refactored without affecting other components/services.

Profile services

Two Angular services can then be created that map to a common function interface:

  1. MauroProfileService - handles profile operations using only the Mauro REST API, namely the /api/.../profile endpoints.
  2. DefaultProfileService - handles the interception of the special "default" Profile object, wrapping fetch/save operations around other endpoints instead.

These two services combined can then combine to handle the same operations required for the bulk editor to work, namely:

  1. Fetch all profile objects
  2. Validate all profile objects
  3. Save all profile objects

By treating the "default" profile as just another Profile to use, this will allow the UI components to continue to function as before.

Next steps

  1. Confirm with @jamesrwelch if this approach is acceptable. Or identify ways for the backend to do a similar job.
  2. Break down into further sub-tasks for implementation.

@pjmonks pjmonks removed the for discussion More discussion required to decide how to resolve an issue label Jul 6, 2022
@pjmonks pjmonks moved this from Backlog to Fix for next release in MDM State Jul 6, 2022
@pjmonks pjmonks self-assigned this Jul 8, 2022
@pjmonks pjmonks moved this from Fix for next release to In Progress in MDM State Jul 8, 2022
@pjmonks
Copy link
Contributor

pjmonks commented Jul 25, 2022

All issues (sub-tasks) under this main task have now been completed/merged, this issue can also be closed now.

@pjmonks pjmonks closed this as completed Jul 25, 2022
Repository owner moved this from In Progress to Merged to Develop / Waiting to release in MDM State Jul 25, 2022
@pjmonks pjmonks added this to the 7.2.0 milestone Jul 25, 2022
@joe-crawford joe-crawford moved this from Merged to Develop / Waiting to release to Released in MDM State Sep 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Released
Development

No branches or pull requests

2 participants