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

🐛 Update archetype model, form and detail drawer to current hub spec #1438

Merged
merged 3 commits into from
Oct 6, 2023

Conversation

sjd78
Copy link
Member

@sjd78 sjd78 commented Oct 5, 2023

Summary

Resolves: #1436

With hub updates to tag handling and api field name changes related to archetypes, adjustments needed to be made to the UI.

Archetype model

  • Update models.ts to the current state of TagRef and Archetype in terms of field names and data types.

  • MSW stub data updated to use api model changes.

Archetype Table

  • Note: The tags column on the archetype table is currently displaying ALL tags returned with no source differentiation.

Archetype Add/EditForm

  • Update ArchetypeForm to use criteria instead of criteriaTags as per the api model changes.

  • With hub changes to combine the archetype and non-archetype tags into a single field, the form processing now ignored non-archetype fields but still sends them on an update.

  • Note: This change mirrors the behavior of manual / non-manual tags on applications and the application form.

  • Stakeholder and stakeholder groups handling is updated to use the *ToRef() helper function style introduced in the application form change 🐛 Applications form: Fix contributors and tags field handling #1408.

Archetype Detail Drawer

  • Since all tags for an archetype are provided in the same field tags, filter them into "archetype tags" (i.e. an empty source) and "assessment tags" (i.e. have a non-empty source) to display them separately.

  • Note: The "archetype tags" are the tags manually attached to the archetype in the new/edit form.

sjd78 added 3 commits October 5, 2023 16:57
Summary of changes:

  - Update `models.ts` to the current state of `TagRef` and `Archetype`
    in terms of field names and data types.

  - Update `ArchetypeForm` to use `criteria` instead of `criteriaTags`
    as per the api model changes.

  - The tags column on the archetype table is currently displaying ALL
    tags returned with no source differentiation.

  - MSW stub data updated to use api model changes.

  - Drop a `console.log` from `Autocomplete`

Todo:

  - Check `Archetype.tags` contents so virtual / assessment tags are
    not editable in the `ArchetypeForm`.  This should be similar behavior
    as the Application edit form.  Only the "manual" tags should be
    editable.

  - Check archetype detail drawer so the "manual" tags and the tags
    from other sources are displayed properly.  The application detail
    drawer shows manual, assessment and analysis tags.

  - The assessment wizard is also broken for application and archetype
    assessments.

Signed-off-by: Scott J Dickerson <[email protected]>
Since all tags for an archetype are provided in the same field `tags`,
filter them into "archetype tags" (i.e. an empty source) and "assessment
tags" (i.e. have a non-empty source) to display them separately.

Note: The "archetype tags" are the tags manually attached to the
archetype in the new/edit form.

Signed-off-by: Scott J Dickerson <[email protected]>
With hub changes to combine the archetype and non-archetype tags into
a single field, change the form processing such that the non-archetype
fields are ignored but still sent on an update.

This change mirrors the behavior of manual / non-manual tags on
applications and the application form.

Stakeholder and stakeholder groups handling is updated to use the
`*ToRef()` helper function style introduced in the application form
change konveyor#1408.

Signed-off-by: Scott J Dickerson <[email protected]>
@sjd78 sjd78 force-pushed the archetype_model_change branch from 2b4aeed to 26b5123 Compare October 5, 2023 20:57

const assessmentTags =
archetype?.tags
?.filter((t) => t?.source ?? "" !== "")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we looking to filter by assessment source here?

Copy link
Member Author

@sjd78 sjd78 Oct 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like the filters in the tags tab of the application drawer? ... No. That is not in the enhancement doc.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. It just wasn't clear to me exactly what the empty source was meaning in this context.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was looking for the actual "assessment" source type like we see here
Screenshot 2023-10-05 at 5 09 19 PM
Screenshot 2023-10-05 at 5 10 48 PM

With this logic, it looks like the assessment tags are going to be categorized as archetype tags && assessment tags.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah... once I can run an assessment on an archetype I'll be able to verify that's what it would look like.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The logic is...

  • if the tag source is undefined or empty, it is an archetype tag
  • if the tag source is not empty, it is an assessment tag

@codecov
Copy link

codecov bot commented Oct 5, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (c93d891) 41.07% compared to head (26b5123) 41.08%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1438   +/-   ##
=======================================
  Coverage   41.07%   41.08%           
=======================================
  Files         139      139           
  Lines        4404     4403    -1     
  Branches     1010     1010           
=======================================
  Hits         1809     1809           
+ Misses       2583     2582    -1     
  Partials       12       12           
Flag Coverage Δ
client 41.08% <ø> (+<0.01%) ⬆️
server ∅ <ø> (∅)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
client/src/app/api/models.ts 100.00% <ø> (ø)
client/src/app/components/Autocomplete.tsx 31.34% <ø> (+0.23%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@ibolton336 ibolton336 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - Can follow up with assessmentTag issue in a later PR.

@ibolton336 ibolton336 merged commit 73f375f into konveyor:main Oct 6, 2023
sjd78 added a commit to sjd78/tackle2-ui that referenced this pull request Oct 6, 2023
Follow up: konveyor#1438

Api changed and if a tag's source is empty, the field is not sent.
Change the tag filtering test to consider `source === undefined` and
`source === ""` as manual tags.

Signed-off-by: Scott J Dickerson <[email protected]>
ibolton336 added a commit that referenced this pull request Oct 9, 2023
Follow up: #1438

Api changed and if a tag's source is empty, the field is not sent.
Change the tag filtering test to consider `source === undefined` and
`source === ""` as manual tags.

Signed-off-by: Scott J Dickerson <[email protected]>
Co-authored-by: Ian Bolton <[email protected]>
@sjd78 sjd78 deleted the archetype_model_change branch November 16, 2023 17:57
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

Successfully merging this pull request may close these issues.

A recent change to tackle2-hub breaks archetype functionality in UI
2 participants