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

feat: Info Center for different type of messages #2909

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

Conversation

IvoSG
Copy link
Contributor

@IvoSG IvoSG commented Feb 12, 2025

Feat for #2511

  • add the InfoCenter message component to the RigthPanel.
  • Enhances in UIMessageBar component
  • Introduce new icon for clearAll
  • Log message in info center from preview-middleware-client in adaptation-project

@IvoSG IvoSG added feature New feature or request ui-components @sap-ux/ui-components preview-middleware-client control-property-editor @sap-ux/control-property-editor control-property-editor-common @sap-ux-private/control-property-editor-common labels Feb 12, 2025
@IvoSG IvoSG requested review from a team as code owners February 12, 2025 07:27
Copy link

changeset-bot bot commented Feb 12, 2025

🦋 Changeset detected

Latest commit: 4c9a8c3

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

This PR includes changesets to release 8 packages
Name Type
@sap-ux/ui-components Patch
@sap-ux-private/control-property-editor-common Minor
@sap-ux/preview-middleware Patch
@sap-ux-private/preview-middleware-client Minor
@sap-ux/control-property-editor Minor
@sap-ux/ui-prompting Patch
@sap-ux-private/ui-prompting-examples Patch
@sap-ux/create Patch

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 self-requested a review February 12, 2025 13:27
Comment on lines 293 to 296
expandable?: boolean;
expanded?: boolean;
read?: boolean;
modal?: boolean;
Copy link
Contributor

Choose a reason for hiding this comment

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

We only need to define the data types that are required for communication between the client and the editor. All the UI state should be defined in control-property-editor.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved

Comment on lines 490 to 496
export const clearInfoCenterMessage = createExternalAction<number>('clear-info-center-message');
export const clearAllInfoCenterMessages = createExternalAction<void>('clear-all-info-center-message');
export const externalFileChange = createExternalAction<string>('external-file-change');
export const toggleExpandMessage = createExternalAction<number>('toggle-expand-message');
export const readMessage = createExternalAction<number>('read-message');
export const expandableMessage = createExternalAction<number>('expandable-message');
export const toggleModalMessage = createExternalAction<number>('toggle-modal-message');
Copy link
Contributor

Choose a reason for hiding this comment

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

All of these look like UI actions, so they should also be only defined in the control-property-editor.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

shouldHideIframe: false
showInfoCenterMessage({
message: {
title: 'Reuse components detected',
Copy link
Contributor

Choose a reason for hiding this comment

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

Title should also use texts from message bundle.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done for all texts

@@ -19,6 +19,7 @@ $splitter-focus-border: 1px solid var(--vscode-focusBorder);
background-color: var(--vscode-panelSection-border);
position: absolute;
outline: none;
z-index: 2;
Copy link
Contributor

Choose a reason for hiding this comment

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

Why was this needed? It seems that info center panel overlaps a bit the splitter, but that seems like an issue with info center panels styling not the splitter, because other components are not affected.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Reverted and fixed in the info center styles

</Text>
{isExpandable && (
<Text className="more-less" onClick={() => dispatch(toggleExpandMessage(index))}>
{isExpanded ? 'Less' : 'More'}
Copy link
Contributor

Choose a reason for hiding this comment

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

All the UI texts should use i18n.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

<UIDialog
hidden={!isOpenedModal}
dialogContentProps={{
title: 'Error Details'
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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@IvoSG IvoSG requested a review from voicis February 21, 2025 13:00
815are
815are previously approved these changes Feb 21, 2025
Copy link
Contributor

@815are 815are left a comment

Choose a reason for hiding this comment

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

checked ui-components:

  1. code changes are easy to understand - I did not notice issue
  2. tests are added for additional message types

}

.message-description {
display: -webkit-box;
Copy link
Contributor

Choose a reason for hiding this comment

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

Having a short comment why browser prefixes are needed here would be good as we generally try to avoid them and that this is required for the line-clamp is not obvious.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added comment description

background-color: var(--vscode-actionBar-toggledBackground) !important;
}

.message-title {
Copy link
Contributor

Choose a reason for hiding this comment

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

Each component should have a dedicated style file. Message related styles should be in InfoMessageItem.scss file

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Divided into separate files

@@ -35,7 +35,7 @@ ADP_ADD_FRAGMENT_NOTIFICATION = Note: The "{0}.fragment.xml" fragment will be cr
ADP_ADD_FRAGMENT_WITH_TEMPLATE_NOTIFICATION = Note: The "{0}.fragment.xml" fragment will be created once you save the changes.
ADP_ADD_TWO_FRAGMENTS_WITH_TEMPLATE_NOTIFICATION = Note: The "{0}.fragment.xml" and "{1}.fragment.xml" fragments will be created once you save the changes.
ADP_SYNC_VIEWS_MESSAGE = Synchronous views are detected for this application. Controller extensions are not supported for such views and will be disabled.
ADP_REUSE_COMPONENTS_MESSAGE = Reuse components are detected for some views in this application. Controller extensions, adding fragments and manifest changes are not supported for such views and will be disabled.
ADP_REUSE_COMPONENTS_MESSAGE = Reuse components detected | Reuse components are detected for some views in this application. Controller extensions, adding fragments and manifest changes are not supported for such views and will be disabled.
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 rather confusing, looking at this text it is not clear that it is actually used for two different things.

Please add a new entry for the title instead of combining two and then splitting.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

A new entry for the title was added

shouldHideIframe: false
showInfoCenterMessage({
type: MessageBarType.warning,
title: title.trim(),
Copy link
Contributor

Choose a reason for hiding this comment

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

We shouldn't need to perform any operations on the texts. Changes should be done in .properties files.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed

@@ -35,6 +40,7 @@ export class OutlineService extends EventTarget {
const resourceBundle = await getTextBundle();
const key = 'ADP_REUSE_COMPONENTS_MESSAGE';
const message = resourceBundle.getText(key) ?? key;
Copy link
Contributor

Choose a reason for hiding this comment

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

This probably can be converted into one liner passing the key without variable, getText should already return the value of key if the text is not found.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@IvoSG IvoSG requested review from nikmace and voicis February 25, 2025 14:26
Co-authored-by: Nikita B. <[email protected]>
@nikmace nikmace self-requested a review February 26, 2025 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
control-property-editor @sap-ux/control-property-editor control-property-editor-common @sap-ux-private/control-property-editor-common feature New feature or request preview-middleware-client ui-components @sap-ux/ui-components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants