From 06051b787a41c750732559d91cc59874f0b21c12 Mon Sep 17 00:00:00 2001 From: LucasC Date: Thu, 30 May 2024 14:02:50 +0200 Subject: [PATCH 1/4] XWIKI-22191: Account disabling and password changing action links should be buttons * Updated the account disabling buttons Note: There doesn't seem to be a test about this. AFAICS, the selectors for this element rely on the id, and not the anchor nature of them. https://github.com/xwiki/xwiki-platform/blob/d11ca5d781f8a42a85bc98eb82306c1431e764d4/xwiki-platform-core/xwiki-platform-user/xwiki-platform-user-profile/xwiki-platform-user-profile-ui/src/test/java/org/xwiki/user/profile/UserProfilePageTest.java#L65 https://github.com/xwiki/xwiki-platform/blob/7461bac6bbba52befecac6d2c03cc9869b6cef35/xwiki-platform-core/xwiki-platform-user/xwiki-platform-user-profile/xwiki-platform-user-profile-ui/src/main/resources/XWiki/XWikiUserProfileSheet.xml#L224-L225 --- .../src/main/resources/XWiki/XWikiUserProfileSheet.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xwiki-platform-core/xwiki-platform-user/xwiki-platform-user-profile/xwiki-platform-user-profile-ui/src/main/resources/XWiki/XWikiUserProfileSheet.xml b/xwiki-platform-core/xwiki-platform-user/xwiki-platform-user-profile/xwiki-platform-user-profile-ui/src/main/resources/XWiki/XWikiUserProfileSheet.xml index 370b9754a7ff..8870b310d4c8 100644 --- a/xwiki-platform-core/xwiki-platform-user/xwiki-platform-user-profile/xwiki-platform-user-profile-ui/src/main/resources/XWiki/XWikiUserProfileSheet.xml +++ b/xwiki-platform-core/xwiki-platform-user/xwiki-platform-user-profile/xwiki-platform-user-profile-ui/src/main/resources/XWiki/XWikiUserProfileSheet.xml @@ -602,8 +602,8 @@ $services.localization.render('platform.core.profile.category.profile.disabled') #set ($enableClass = "hidden") #set ($disableClass = "") #end - <a href="#" id="enable" class="btn btn-success $enableClass">$services.icon.renderHTML('unlock') $services.localization.render('platform.core.profile.category.profile.enableAccount')</a> - <a href="#" id="disable" class="btn btn-warning $disableClass">$services.icon.renderHTML('lock') $services.localization.render('platform.core.profile.category.profile.disableAccount')</a> + <button id="enable" class="btn btn-success $enableClass">$services.icon.renderHTML('unlock') $services.localization.render('platform.core.profile.category.profile.enableAccount')</button> + <button id="disable" class="btn btn-warning $disableClass">$services.icon.renderHTML('lock') $services.localization.render('platform.core.profile.category.profile.disableAccount')</button> #end <div class='userInfo'> #if($xcontext.action == 'view' && $hasEdit) From 7dcb59e67b27e15ea168ec821b0ca5be11f6adbb Mon Sep 17 00:00:00 2001 From: LucasC Date: Thu, 30 May 2024 14:23:07 +0200 Subject: [PATCH 2/4] XWIKI-22191: Account disabling and password changing action links should be buttons * Improved teh consistency of the inline-link-only selector to also match `.button` links Note: There doesn't seem to be a test about this. AFAICS, the selectors for this element rely on the id, and not the anchor nature of them. https://github.com/xwiki/xwiki-platform/blob/d11ca5d781f8a42a85bc98eb82306c1431e764d4/xwiki-platform-core/xwiki-platform-user/xwiki-platform-user-profile/xwiki-platform-user-profile-ui/src/test/java/org/xwiki/user/profile/UserProfilePageTest.java#L65 https://github.com/xwiki/xwiki-platform/blob/7461bac6bbba52befecac6d2c03cc9869b6cef35/xwiki-platform-core/xwiki-platform-user/xwiki-platform-user-profile/xwiki-platform-user-profile-ui/src/main/resources/XWiki/XWikiUserProfileSheet.xml#L224-L225 --- .../src/main/resources/flamingo/less/general.less | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xwiki-platform-core/xwiki-platform-flamingo/xwiki-platform-flamingo-skin/xwiki-platform-flamingo-skin-resources/src/main/resources/flamingo/less/general.less b/xwiki-platform-core/xwiki-platform-flamingo/xwiki-platform-flamingo-skin/xwiki-platform-flamingo-skin-resources/src/main/resources/flamingo/less/general.less index 7303ddd0c6e0..baa195833c2b 100644 --- a/xwiki-platform-core/xwiki-platform-flamingo/xwiki-platform-flamingo-skin/xwiki-platform-flamingo-skin-resources/src/main/resources/flamingo/less/general.less +++ b/xwiki-platform-core/xwiki-platform-flamingo/xwiki-platform-flamingo-skin/xwiki-platform-flamingo-skin-resources/src/main/resources/flamingo/less/general.less @@ -183,7 +183,8 @@ body { /* Remove the underlining from links with the btn class. Those are already styled differently from their neighboring text. */ - & a.btn { + & a.btn, + & a.button { .not-inline-link(); } From 617518deec859066651c31e27ac75f596ad44690 Mon Sep 17 00:00:00 2001 From: LucasC Date: Thu, 30 May 2024 15:47:50 +0200 Subject: [PATCH 3/4] XWIKI-22191: Account disabling and password changing action links should be buttons * Updated the `Change password` button to be a button instead of an anchor styled like a button --- .../src/main/resources/XWiki/XWikiUserPreferencesSheet.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xwiki-platform-core/xwiki-platform-user/xwiki-platform-user-profile/xwiki-platform-user-profile-ui/src/main/resources/XWiki/XWikiUserPreferencesSheet.xml b/xwiki-platform-core/xwiki-platform-user/xwiki-platform-user-profile/xwiki-platform-user-profile-ui/src/main/resources/XWiki/XWikiUserPreferencesSheet.xml index abaaee554b49..bfadb14ee280 100644 --- a/xwiki-platform-core/xwiki-platform-user/xwiki-platform-user-profile/xwiki-platform-user-profile-ui/src/main/resources/XWiki/XWikiUserPreferencesSheet.xml +++ b/xwiki-platform-core/xwiki-platform-user/xwiki-platform-user-profile/xwiki-platform-user-profile-ui/src/main/resources/XWiki/XWikiUserPreferencesSheet.xml @@ -340,8 +340,8 @@ <div class="passwordManagement"> <h2>$escapetool.xml($services.localization.render('platform.core.profile.section.security'))</h2> <span class="buttonwrapper"> - <a id="changePassword" href="$doc.getURL('view', 'xpage=passwd')">$escapetool.xml( - $services.localization.render('platform.core.profile.changePassword'))</a> + <button id="changePassword" onclick="location='$doc.getURL('view', 'xpage=passwd')'">$escapetool.xml( + $services.localization.render('platform.core.profile.changePassword'))</button> </span> </div> </div> From d0434709df1df8a87fd8a6d55cc0cdd6b94886d7 Mon Sep 17 00:00:00 2001 From: Sereza7 Date: Wed, 27 Nov 2024 15:07:36 +0100 Subject: [PATCH 4/4] XWIKI-22191: Account disabling and password changing action links should be buttons * Set the changePassword element back to an anchor * Updated the underlining rules to count this one as a `link styled like a button` category --- .../src/main/resources/flamingo/less/general.less | 7 ++++--- .../src/main/resources/XWiki/XWikiUserPreferencesSheet.xml | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/xwiki-platform-core/xwiki-platform-flamingo/xwiki-platform-flamingo-skin/xwiki-platform-flamingo-skin-resources/src/main/resources/flamingo/less/general.less b/xwiki-platform-core/xwiki-platform-flamingo/xwiki-platform-flamingo-skin/xwiki-platform-flamingo-skin-resources/src/main/resources/flamingo/less/general.less index baa195833c2b..eeda35cf129a 100644 --- a/xwiki-platform-core/xwiki-platform-flamingo/xwiki-platform-flamingo-skin/xwiki-platform-flamingo-skin-resources/src/main/resources/flamingo/less/general.less +++ b/xwiki-platform-core/xwiki-platform-flamingo/xwiki-platform-flamingo-skin/xwiki-platform-flamingo-skin-resources/src/main/resources/flamingo/less/general.less @@ -181,10 +181,11 @@ body { } } - /* Remove the underlining from links with the btn class. - Those are already styled differently from their neighboring text. */ + /* Remove the underlining from links styled like buttons. + Those are already different enough from their neighboring text. */ & a.btn, - & a.button { + & a.button, + & .buttonwrapper a { .not-inline-link(); } diff --git a/xwiki-platform-core/xwiki-platform-user/xwiki-platform-user-profile/xwiki-platform-user-profile-ui/src/main/resources/XWiki/XWikiUserPreferencesSheet.xml b/xwiki-platform-core/xwiki-platform-user/xwiki-platform-user-profile/xwiki-platform-user-profile-ui/src/main/resources/XWiki/XWikiUserPreferencesSheet.xml index bfadb14ee280..abaaee554b49 100644 --- a/xwiki-platform-core/xwiki-platform-user/xwiki-platform-user-profile/xwiki-platform-user-profile-ui/src/main/resources/XWiki/XWikiUserPreferencesSheet.xml +++ b/xwiki-platform-core/xwiki-platform-user/xwiki-platform-user-profile/xwiki-platform-user-profile-ui/src/main/resources/XWiki/XWikiUserPreferencesSheet.xml @@ -340,8 +340,8 @@ <div class="passwordManagement"> <h2>$escapetool.xml($services.localization.render('platform.core.profile.section.security'))</h2> <span class="buttonwrapper"> - <button id="changePassword" onclick="location='$doc.getURL('view', 'xpage=passwd')'">$escapetool.xml( - $services.localization.render('platform.core.profile.changePassword'))</button> + <a id="changePassword" href="$doc.getURL('view', 'xpage=passwd')">$escapetool.xml( + $services.localization.render('platform.core.profile.changePassword'))</a> </span> </div> </div>