Skip to content

LXL-4716 - Validation on field category, show warning when identify or find (or both) is missing #1403

Open
marigonahaxha wants to merge 13 commits intodevelopfrom
lxl-4716-validation-onidentify--category-field
Open

LXL-4716 - Validation on field category, show warning when identify or find (or both) is missing #1403
marigonahaxha wants to merge 13 commits intodevelopfrom
lxl-4716-validation-onidentify--category-field

Conversation

@marigonahaxha
Copy link
Contributor

@marigonahaxha marigonahaxha commented Oct 30, 2025

Checklist:

  • I have run the unit tests. yarn test:unit
  • I have run the linter. yarn lint

Description

Tickets involved

LXL-4716

Solves

Shows an error warning if the field find or identify or both are missing in the category field. Shows the warning in different places if it's a Work or an Instance.

Summary of changes

  • Added warning icon
  • Check if the fields are missing
  • Added i18n translations
  • Added text outside the content box to say which field is missing

Tested on these items:

Screenshots

Skärmavbild 2025-11-05 kl  18 47 56 Skärmavbild 2025-11-05 kl  18 48 12

@marigonahaxha marigonahaxha marked this pull request as ready for review November 5, 2025 13:07
@marigonahaxha marigonahaxha requested review from lrosenstrom and olovy and removed request for lrosenstrom and olovy November 5, 2025 13:07
Copy link
Contributor

@lrosenstrom lrosenstrom left a comment

Choose a reason for hiding this comment

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

This is a start but it needs more work! See comments in the code.

:parent-path="editingObject"
:bulk-context="bulkContext"
:show-key="!hideTopLevelFieldNames"
:itemData="inspector.data.mainEntity"
Copy link
Contributor

@lrosenstrom lrosenstrom Nov 10, 2025

Choose a reason for hiding this comment

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

This would pass the whole record as a property to each field instance, so not a good idea!

itemData: {
type: Object,
default: null,
},
Copy link
Contributor

Choose a reason for hiding this comment

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

This is not needed.


if(this.archType === 'Instance') {
find = this.itemData?.instanceOf?._categoryByCollection?.find;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of getting _categoryByCollection from the record, you can check if this.fieldKey === _categoryByCollection. Find, identify and @none can be obtained from this.fieldValue. You can check this.parentPath to tell if this is category in the local work on the instance or on the instance level.

let identify = null

if(this.archType === 'Instance') {
identify = this.itemData?.instanceOf?._categoryByCollection?.identify;
Copy link
Contributor

Choose a reason for hiding this comment

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

Same as above!

);

const customMessages = {
Find: StringUtil.getUiPhraseByLang(
Copy link
Contributor

Choose a reason for hiding this comment

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

Prefer the shorter translatePhrase method.

@lrosenstrom
Copy link
Contributor

There's a couple of bugs in the rendering of the warning.

The whole field gets a hand cursor although most of it is not clickable.
Screenshot from 2025-11-10 20-31-13


Item entities overlap the warning.
Screenshot from 2025-11-10 20-31-50


It seems the z-index has changed so that the field covers the toolbar menu, if open.
Screenshot from 2025-11-10 20-18-29

@lrosenstrom lrosenstrom force-pushed the lxl-4716-validation-onidentify--category-field branch from deaefbe to 31936b8 Compare November 24, 2025 10:09
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.

2 participants