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

fix: Modified indicators incorrectly displayed for some UI5 controls in Adaptation Project #2264

Open
wants to merge 35 commits into
base: main
Choose a base branch
from

Conversation

mmilko01
Copy link
Contributor

Copy link

changeset-bot bot commented Aug 21, 2024

🦋 Changeset detected

Latest commit: 65d7d2f

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@nikmace nikmace requested a review from a team August 27, 2024 07:33
@nikmace nikmace added bug Something isn't working preview-middleware-client control-property-editor @sap-ux/control-property-editor control-property-editor-common @sap-ux-private/control-property-editor-common labels Aug 27, 2024
@mmilko01 mmilko01 marked this pull request as ready for review September 11, 2024 13:02
@mmilko01 mmilko01 requested review from a team as code owners September 11, 2024 13:02
@voicis voicis self-requested a review September 11, 2024 13:55
@edingerk
Copy link
Member

the usage of the fl library looks fine. I will document in openui5 that they are used here

Copy link
Member

@edingerk edingerk left a comment

Choose a reason for hiding this comment

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

looks good to me

@voicis voicis self-requested a review September 16, 2024 10:58
voicis
voicis previously approved these changes Sep 16, 2024
Copy link
Contributor

@voicis voicis left a comment

Choose a reason for hiding this comment

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

  • Changeset present
  • Code changes looks good
  • Review comments addressed
  • Tested locally

nikmace
nikmace previously approved these changes Sep 16, 2024
Copy link
Contributor

@nikmace nikmace left a comment

Choose a reason for hiding this comment

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

Change looks good
Coverage is good
Did not test manually

@mmilko01 mmilko01 dismissed stale reviews from nikmace and voicis via 64b1527 October 15, 2024 11:09
@mmilko01 mmilko01 requested a review from a team as a code owner October 15, 2024 11:09
Copy link

sonarcloud bot commented Oct 15, 2024

{text}
</Link>
</Stack.Item>
{text && (
Copy link
Contributor

Choose a reason for hiding this comment

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

text should always be defined and not an empty string.

Copy link
Contributor

Choose a reason for hiding this comment

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

Since we use a control group for the new 'control' kind, we do not have the controlName. And controlName is taken from change.selector.type, which for 'renameLabel' and 'addXML' unfortunately does not exist. Therefore, the only way to use the ControlGroup.tsx for kind: 'control' is to hide the text stack item (group header) because we do not have one for this change kind.

Screenshot 2024-10-18 at 14 42 34

Maybe, it does not make sense to process this change in the ControlGroup; maybe we need a third group like ControlChange, then the ChangeStack.tsx will have three options for rendering the change.

Screenshot 2024-10-18 at 14 49 35

const controlChange: ControlSavedChange = {
...unknownChange,
kind: 'control',
controlId: selectorId ?? ''
Copy link
Contributor

Choose a reason for hiding this comment

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

?? operator seems unnecessary here as we already check for selectorId before.

Copy link
Contributor

Choose a reason for hiding this comment

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

Removed in: 65d7d2f

@@ -117,6 +117,7 @@ describe('SelectionService', () => {
timestamp: 1640106817301
},
{
changeType: 'propertyChange',
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks wrong. unknown change should not have change type propertyChange. It seems that the unknown also need to be change to property.

@@ -274,6 +275,7 @@ describe('SelectionService', () => {
timestamp: 1640106817301
},
{
changeType: 'propertyChange',
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.

timestamp?: number;
}

export interface ControlSavedChange {
Copy link
Contributor

Choose a reason for hiding this comment

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

This word order sounds quite strange. It would be better if it matched other change type names e.g PendingControlChange and SavedPropertyChange.

Suggested change
export interface ControlSavedChange {
export interface SavedControlChange {

Copy link
Contributor

Choose a reason for hiding this comment

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

Renamed in: 65d7d2f

private async handleCommand(command: FlexCommand, inactiveCommandCount: number, index: number): Promise<void> {
const pendingChange = await this.prepareChangeType(command, inactiveCommandCount, index);
if (pendingChange) {
this.pendingChanges.push(pendingChange);
Copy link
Contributor

Choose a reason for hiding this comment

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

There seems to be an issue with pending changes duplicating on each event. It is probably because pendingChanges field is not reset and we always process all the changes in the stack.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working control-property-editor @sap-ux/control-property-editor control-property-editor-common @sap-ux-private/control-property-editor-common preview-middleware-client
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants