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

XWIKI-21597: Make the rights UI use icon themes #2649

Merged
merged 5 commits into from
Feb 29, 2024

Conversation

Sereza7
Copy link
Contributor

@Sereza7 Sereza7 commented Nov 23, 2023

Jira

https://jira.xwiki.org/browse/XWIKI-21597

PR Changes

  • Updated icons in the rights UI

View

After the PR
21597-afterPR
We can see that this PR updates the icons both in the right assignment field and the fields under. UInder, this is just a two state checkbox, which can be handled by the default HTML, so I did not use the icon theme. However in the right assignment fields, I changed the icon for the three states. For the none state, which was previously shown with an empty box, I decided to leave the button visuals empty.

* Updated icons in the rights UI
* Removed the logic to update the source for the checkbox image
this.icons = [
"",
"$escapetool.javascript($services.icon.renderHTML('check'))",
"$escapetool.javascript($services.icon.renderHTML('cross'))"
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Addressed in 78ca48e 👍
I tested this change manually and as far as I could see it did not break anything (at least I fixed mistakes until I could notice it working again :) ).

@Sereza7 Sereza7 marked this pull request as draft January 11, 2024 16:11
* Removed velocity calls from inside the javascript
@Sereza7 Sereza7 marked this pull request as ready for review January 11, 2024 17:00
@Sereza7
Copy link
Contributor Author

Sereza7 commented Jan 16, 2024

Fails webstandard tests, Bad value “checkbox” for attribute “type” on element “input”.. I think this is because I left an alt on it.

@Sereza7 Sereza7 marked this pull request as draft January 16, 2024 11:28
Sereza7 and others added 2 commits January 22, 2024 10:29
* Removed the alt - didn't add an alternative because what it used to be is already supported by the default checkbox behaviour
* Updated the javascript to fit this change in marking even when checking/unchecking the boxes.
@Sereza7
Copy link
Contributor Author

Sereza7 commented Jan 22, 2024

With the changes from b2f2a7a, testing
mvn clean install -amd -f xwiki-platform-distribution/xwiki-platform-distribution-flavor/xwiki-platform-distribution-flavor-test/xwiki-platform-distribution-flavor-test-webstandards -Pquality,integration-tests,docker -Dxwiki.test.startXWiki=false on a live distribution didn't fail for the Rights section. Other fails were found, but expected in the context of this one week old distribution (e.g. without fixes for #2796 but the test suite itself was updated).

Everything good, opening this PR back for reviews 👍

@Sereza7 Sereza7 marked this pull request as ready for review January 22, 2024 10:33
border-color: transparent;
background: transparent;
#usersandgroupstable button.rights-edit.yes {
color: $theme.notificationSuccessColor;
Copy link
Member

Choose a reason for hiding this comment

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

Feels a bit weird here to use notification(Success|Error)Color, now maybe that's the best practice in themes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's some of the old colortheme variables. I'm not sure we have a best practice for this. I think I did use those old variables since others are used all throughout the file and I'd rather keep consistent inside one file.

To be honest this whole file looks quite old and breaks current CSS codestyles in multiple places.
I opened a topic on the forum about introducing a new type of label for codestyle, this file could really use a ticket :)

I just checked our HTML and CSS best practices and the entry don't hard code colors in properties - use [ColorTheme variables](https://extensions.xwiki.org/xwiki/bin/view/Extension/Color%20Theme%20Application#HUsingColorThemesvariables) points to a doc that uses the old colortheme variables. We might want to update the link or the doc.

I'll look a bit more into the state of deprecation of this old colortheme, it's not clear to me what it is yet. Using the old colortheme everywhere does not look like something we should recommend...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I updated the doc to include a link to how to use the new variables.

Copy link
Member

@surli surli left a comment

Choose a reason for hiding this comment

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

LGTM

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