Skip to content

Commit

Permalink
Merge pull request #15537 from craftcms/bugfix/sidebar-queue-indicato…
Browse files Browse the repository at this point in the history
…r-styling

Queue jobs styling cleanup
  • Loading branch information
brandonkelly authored Aug 25, 2024
2 parents 48a50dc + 4bbaed2 commit a71106e
Show file tree
Hide file tree
Showing 12 changed files with 36 additions and 27 deletions.
1 change: 1 addition & 0 deletions CHANGELOG-WIP.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,4 @@

### System
- MySQL mutex locks and PHP session names are now namespaced using the application ID combined with the environment name. ([#15313](https://github.com/craftcms/cms/issues/15313))
- Fixed styling issues. ([#15537](https://github.com/craftcms/cms/pull/15537))
2 changes: 1 addition & 1 deletion src/web/assets/cp/dist/cp.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/web/assets/cp/dist/cp.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/web/assets/cp/dist/css/cp.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/web/assets/cp/dist/css/cp.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/web/assets/cp/src/css/_cp.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1766,7 +1766,7 @@ li.breadcrumb-toggle-wrapper {
.error-summary {
border: 1px solid var(--error-color);
box-shadow: none;
background-color: rgb(var(--error-color-rgb) 0.03);
background-color: rgb(var(--error-color-rgb) / 3%);
padding: var(--m);
}

Expand Down
7 changes: 5 additions & 2 deletions src/web/assets/cp/src/css/_craft-tooltip.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@
transition:
opacity 100ms ease-in-out,
transform 150ms ease-in-out;
inset-block-start: 0;
inset-inline-start: 0;
/* stylelint-disable */
/* We need to keep these non-logical so floating-ui can override them */
top: 0;
left: 0;
/* stylelint-enable */
z-index: 99;
}

Expand Down
7 changes: 3 additions & 4 deletions src/web/assets/cp/src/css/_global-sidebar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -248,13 +248,12 @@
}

.sidebar-action--job {
grid-column: 2/4 !important;
align-items: flex-start;
align-items: start;

.sidebar-action__label {
flex-wrap: wrap;
padding-block: var(--xs);
gap: var(--xs);
padding-block: var(--2xs);
gap: var(--2xs);
}

.label {
Expand Down
4 changes: 2 additions & 2 deletions src/web/assets/cp/src/css/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
--dark-sel-color: var(--gray-500);

// alert/notice colors
--error-color-rgb: 216, 31, 35;
--error-color: rgb(var(--error-color-rgb) 1);
--error-color-rgb: 216 31 35;
--error-color: rgb(var(--error-color-rgb));
--warning-color: var(--amber-700);
--success-color: var(--teal-700);
--notice-color: var(--sky-700);
Expand Down
27 changes: 15 additions & 12 deletions src/web/assets/cp/src/js/CP.js
Original file line number Diff line number Diff line change
Expand Up @@ -1917,6 +1917,7 @@ var JobProgressIcon = Garnish.Base.extend({
$a: null,
$label: null,
$progressLabel: null,
$tooltip: $(),

progress: null,
failMode: false,
Expand Down Expand Up @@ -1967,24 +1968,25 @@ var JobProgressIcon = Garnish.Base.extend({
.appendTo($labelContainer)
.hide();

this.$tooltip = $('<craft-tooltip/>', {
placement: 'right',
'self-managed': true,
'aria-label': this.$label.text(),
}).appendTo(this.$a);
// If the sidebar is collapsed, make sure to add a tooltip.
// CraftGlobalSidebar.js will handle removing it and adding it back on expand/contract
if (Garnish.$bod.data('sidebar') === 'collapsed') {
this.$tooltip = $('<craft-tooltip/>', {
placement: 'right',
'self-managed': true,
'aria-label': this.$label.text(),
}).appendTo(this.$a);
}

let m = window.devicePixelRatio > 1 ? 2 : 1;
this._canvasSize = 18 * m;
this._arcPos = this._canvasSize / 2;
this._arcRadius = 7 * m;
this._lineWidth = 3 * m;

this._$bgCanvas = this._createCanvas(
'bg',
this.$li.css('background-color')
);
this._$bgCanvas = this._createCanvas('bg', '#a3afbb');
this._$staticCanvas = this._createCanvas('static', this.$li.css('color'));
this._$hoverCanvas = this._createCanvas('hover', '#fff');
this._$hoverCanvas = this._createCanvas('hover', this.$li.css('color'));
this._$failCanvas = this._createCanvas('fail', '#da5a47').hide();

this._staticCtx = this._$staticCanvas[0].getContext('2d');
Expand All @@ -1995,15 +1997,16 @@ var JobProgressIcon = Garnish.Base.extend({
},

setDescription: function (description, progressLabel) {
this.$a.attr('title', description);
this.$label.text(description);
if (progressLabel) {
this.$progressLabel.text(progressLabel).show();
} else {
this.$progressLabel.hide();
}

this.$tooltip.attr('aria-label', description);
if (this.$tooltip.length) {
this.$tooltip.attr('aria-label', description);
}
},

setProgress: function (progress) {
Expand Down
6 changes: 4 additions & 2 deletions src/web/assets/cp/src/js/CraftGlobalSidebar.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
class CraftGlobalSidebar extends HTMLElement {
get items() {
return this.querySelectorAll('.sidebar-action');
}

connectedCallback() {
this.trigger = this.querySelector('#sidebar-trigger');

if (this.trigger) {
this.trigger.addEventListener('open', this.expand.bind(this));
this.trigger.addEventListener('close', this.collapse.bind(this));
}

this.items = this.querySelectorAll('.sidebar-action');
}

disconnectedCallback() {
Expand Down
1 change: 1 addition & 0 deletions src/web/assets/cp/src/js/CraftTooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ class CraftTooltip extends HTMLElement {
// innerText will remove the arrow, so we have to put it back if we need it.
if (this.arrow) {
this.renderArrow();
this.update();
}
}
}
Expand Down

0 comments on commit a71106e

Please sign in to comment.