Skip to content

Commit

Permalink
Differentiates between approver badge style and non-approver
Browse files Browse the repository at this point in the history
  • Loading branch information
waximabbax authored and JeroenDeDauw committed Aug 17, 2024
1 parent feb1baf commit 5e85171
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 4 deletions.
1 change: 1 addition & 0 deletions resources/ApprovePage.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const handleApprovalResponse = ( approve, data ) => {

$badgeElement.toggleClass( 'approved-badge' );
$badgeElement.toggleClass( 'unapproved-badge' );
$( '.dropdown-icon' ).toggleClass( 'approved' );

elements.forEach( ( selector ) => $( selector ).toggleClass( 'display-none' ) );

Expand Down
6 changes: 6 additions & 0 deletions resources/Icons/approved-arrow-down.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions resources/Icons/arrow-down.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 18 additions & 3 deletions resources/PageApprovals.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
border-radius: 20px;
font-weight: bold;
font-size: 12px;
cursor: pointer;
position: relative;
}

Expand All @@ -33,7 +32,8 @@

.status-icon,
.checkmark-icon,
.unapprove-icon {
.unapprove-icon,
.dropdown-icon {
background-size: contain;
background-repeat: no-repeat;
background-position: center;
Expand All @@ -60,6 +60,17 @@
background-image: url( Icons/checkmark.svg );
}

.dropdown-icon {
width: 13px;
height: 13px;
background-image: url( Icons/arrow-down.svg );
margin-left: 5px;
}

.dropdown-icon.approved {
background-image: url( Icons/approved-arrow-down.svg );
}

#unapproveButton .unapprove-icon {
width: 20px;
height: 20px;
Expand Down Expand Up @@ -138,7 +149,7 @@
.dropdown-item {
display: flex;
align-items: center;
padding: 10px 15px;
padding: 10px 23px;
width: 100%;
border: 0;
background: none;
Expand All @@ -163,3 +174,7 @@
#unapproveButton {
color: #dc3545;
}

.cursor-pointer {
cursor: pointer;
}
7 changes: 6 additions & 1 deletion templates/PageApprovalStatus.mustache
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<div class="page-approval-container">
<div class="approval-status-badge {{#isPageApproved}}approved-badge{{/isPageApproved}}{{^isPageApproved}}unapproved-badge{{/isPageApproved}}">
<div class="approval-status-badge
{{#isPageApproved}}approved-badge{{/isPageApproved}}
{{^isPageApproved}}unapproved-badge{{/isPageApproved}}
{{#canApprove}}cursor-pointer{{/canApprove}}">
<div class="status-icon"></div>
<div class="approved-status-text {{^isPageApproved}}display-none{{/isPageApproved}}">{{statusApproved}}</div>
<div class="approved-status-text {{#isPageApproved}}display-none{{/isPageApproved}}">{{statusNotApproved}}</div>
Expand All @@ -14,6 +17,8 @@
{{approveButtonText}}
</button>
</div>
<span class="dropdown-icon {{#isPageApproved}}approved{{/isPageApproved}}">
</span>
{{/canApprove}}
<div class="approval-status-tooltip {{^isPageApproved}}display-none{{/isPageApproved}}">
<small class="approver-details {{^isPageApproved}}display-none{{/isPageApproved}}">
Expand Down

0 comments on commit 5e85171

Please sign in to comment.