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

[4.0] RFC Quickicons Joomla and Extensions updates #23095

Merged
merged 9 commits into from Nov 28, 2018
Expand Up @@ -10,6 +10,6 @@ PLG_QUICKICON_EXTENSIONUPDATE_GROUP_DESC="The group of this plugin (this value i
PLG_QUICKICON_EXTENSIONUPDATE_GROUP_LABEL="Group"
PLG_QUICKICON_EXTENSIONUPDATE_UPDATEFOUND="Updates are available! %s"
PLG_QUICKICON_EXTENSIONUPDATE_UPDATEFOUND_BUTTON="View Updates"
PLG_QUICKICON_EXTENSIONUPDATE_UPDATEFOUND_MESSAGE="%s Extension Update(s) are available:"
PLG_QUICKICON_EXTENSIONUPDATE_UPDATEFOUND_MESSAGE="%s Extension Update(s) are available."
PLG_QUICKICON_EXTENSIONUPDATE_UPTODATE="Extensions are up to date."
PLG_QUICKICON_EXTENSIONUPDATE_XML_DESCRIPTION="Checks for updates of your installed third-party extensions and notifies you when you visit the Control Panel page."
Expand Up @@ -8,8 +8,8 @@ PLG_QUICKICON_JOOMLAUPDATE_CHECKING="Checking Joomla ..."
PLG_QUICKICON_JOOMLAUPDATE_ERROR="Unknown Joomla ..."
PLG_QUICKICON_JOOMLAUPDATE_GROUP_DESC="The group of this plugin (this value is compared with the group value used in <strong>Quick Icons</strong> modules to inject icons)."
PLG_QUICKICON_JOOMLAUPDATE_GROUP_LABEL="Group"
PLG_QUICKICON_JOOMLAUPDATE_UPDATEFOUND="Joomla %s, Update now!"
PLG_QUICKICON_JOOMLAUPDATE_UPDATEFOUND="Joomla %s Update now!"
PLG_QUICKICON_JOOMLAUPDATE_UPDATEFOUND_BUTTON="Update Now"
PLG_QUICKICON_JOOMLAUPDATE_UPDATEFOUND_MESSAGE="Joomla %s is available:"
PLG_QUICKICON_JOOMLAUPDATE_UPDATEFOUND_MESSAGE="Joomla %s is available."
PLG_QUICKICON_JOOMLAUPDATE_UPTODATE="Joomla is up to date."
PLG_QUICKICON_JOOMLAUPDATE_XML_DESCRIPTION="Checks for Joomla updates and notifies you when you visit the Control Panel page."
1 change: 1 addition & 0 deletions administrator/templates/atum/scss/_variables.scss
Expand Up @@ -182,6 +182,7 @@ $quickicon-box-shadow: $atum-box-shadow;
$quickicon-box-shadow-hover: 0 0 8px 0 rgba($black, .3);
$quickicon-box-shadow-success: 0 0 3px 0 var(--success);
$quickicon-box-shadow-danger: 0 0 3px 0 var(--danger);
$quickicon-box-shadow-warning: 0 0 3px 0 var(--warning);

// Gutter
$grid-gutter-width: 15px;
Expand Down
5 changes: 5 additions & 0 deletions administrator/templates/atum/scss/blocks/_quickicons.scss
Expand Up @@ -47,6 +47,11 @@
font-size: 2.5rem;
}

&.warning {
color: var(--warning);
box-shadow: $quickicon-box-shadow-warning;
}

&.danger {
color: var(--danger);
box-shadow: $quickicon-box-shadow-danger;
Expand Down
15 changes: 14 additions & 1 deletion administrator/templates/atum/scss/template-rtl.scss
Expand Up @@ -249,7 +249,20 @@ body {
float: right;
}


.field-media-input {
margin-right: 220px;
}

// Quickicon specific
.message-alert {
text-align: left !important;
Copy link
Contributor

Choose a reason for hiding this comment

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

surely there is a way to do this without using !important

Copy link
Member Author

Choose a reason for hiding this comment

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

This is what is used in node_modules and vendor:

@each $breakpoint in map-keys($grid-breakpoints) {
  @include media-breakpoint-up($breakpoint) {
    $infix: breakpoint-infix($breakpoint, $grid-breakpoints);

    .text#{$infix}-left   { text-align: left !important; }
    .text#{$infix}-right  { text-align: right !important; }
    .text#{$infix}-center { text-align: center !important; }
  }
}

and ported to /administrator/templates/atum/css/bootstrap.css once npm ci has run:

.text-left {
  text-align: left !important; }

.text-right {
  text-align: right !important; }

.text-center {
  text-align: center !important; }

}

// Message specific
joomla-alert .joomla-alert--close, joomla-alert .joomla-alert-button--close {
Copy link
Member

Choose a reason for hiding this comment

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

Alerts are not part of the template. please put RTL CSS in the custom element file

Copy link
Member Author

Choose a reason for hiding this comment

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

@C-Lodder
This is an override for RTL.
The scss for alert is in /node_modules/joomla-ui-custom-elements/src/scss/alert/alert.scss

There is no provisions done for RTL in custom-elements which means we would have to use html[dir=rtl] (which is not a problem I guess).

Also it means that until someone merges a possible pull request in https://github.com/joomla-projects/custom-elements/blob/master/dist/css/joomla-alert.css and possibly https://github.com/joomla-projects/custom-elements/blob/master/dist/css/joomla-alert.min.css, this PR would not correct by itself the RTL display issue with alerts.

EDIT: Maybe it is only in https://github.com/joomla-projects/custom-elements/blob/master/src/scss/alert/alert.scss

The other solution I see is to add these (with html[dir=rtl] ), in the atum/scss/blocks/_alert.scss and also in Cassiopea equivalent file —which means that every 3rd party template will necessarily have to do that to be rtl compatible.

Just let me know what is the way to go.
calling @wilsonge as he has the hand on merging stuff in https://github.com/joomla-projects/custom-elements

Copy link
Member Author

Choose a reason for hiding this comment

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

@C-Lodder
ping 😄

Copy link
Member Author

Choose a reason for hiding this comment

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

After discussion with @wilsonge will make PR towards https://github.com/joomla-projects/custom-elements/blob/master/src/scss/alert/alert.scss
and delete the same in template-rtl.scss>

We will have to wait the PR is merged and compile is done to see the rtl results here.

right: 0;
infograf768 marked this conversation as resolved.
Show resolved Hide resolved
left: -1.25rem;
}
joomla-alert .joomla-alert--close, joomla-alert .joomla-alert-button--close {
float: left;
}
5 changes: 5 additions & 0 deletions administrator/templates/atum/scss/template.scss
Expand Up @@ -109,3 +109,8 @@
display: inline-block;
list-style: none;
}

// Quickicon specific
.message-alert {
text-align: right !important;
}
Expand Up @@ -31,7 +31,7 @@
} else {
const messages = {
warning: [
`${Joomla.JText._('PLG_QUICKICON_EXTENSIONUPDATE_UPDATEFOUND_MESSAGE').replace('%s', `<span class="badge badge-pill badge-danger">${updateInfoList.length}</span>`)}<button class="btn btn-sm btn-primary" onclick="document.location='${options.url}'">${Joomla.JText._('PLG_QUICKICON_EXTENSIONUPDATE_UPDATEFOUND_BUTTON')}</button>`,
`<div class="message-alert">` + `${Joomla.JText._('PLG_QUICKICON_EXTENSIONUPDATE_UPDATEFOUND_MESSAGE').replace('%s', `<span class="badge badge-pill badge-danger">${updateInfoList.length}</span>`)}<button class="btn btn-sm btn-primary" onclick="document.location='${options.url}'">${Joomla.JText._('PLG_QUICKICON_EXTENSIONUPDATE_UPDATEFOUND_BUTTON')}</button>`,
],
};

Expand All @@ -41,7 +41,7 @@
// Scroll to page top
window.scrollTo(0, 0);

link.classList.add('danger');
link.classList.add('warning');
for (let i = 0, len = linkSpan.length; i < len; i += 1) {
linkSpan[i].innerHTML = Joomla.JText._('PLG_QUICKICON_EXTENSIONUPDATE_UPDATEFOUND').replace('%s', `<span class="badge badge-light">${updateInfoList.length}</span>`);
}
Expand Down
Expand Up @@ -34,8 +34,8 @@
if (updateInfo.version !== options.version) {
const messages = {
warning: [
`${Joomla.JText._('PLG_QUICKICON_JOOMLAUPDATE_UPDATEFOUND_MESSAGE').replace('%s', `<span class="badge badge-danger">${updateInfoList.length}</span>`)}`
+ `<button class="btn btn-primary" onclick="document.location='${options.url}'">`
`<div class="message-alert">` + `${Joomla.JText._('PLG_QUICKICON_JOOMLAUPDATE_UPDATEFOUND_MESSAGE').replace('%s', `<span class="badge badge-danger">${updateInfo.version}</span>`)}`
+ `<button class="btn btn-sm btn-primary" onclick="document.location='${options.url}'">`
+ `${Joomla.JText._('PLG_QUICKICON_JOOMLAUPDATE_UPDATEFOUND_BUTTON')}</button>`,
],
};
Expand All @@ -46,9 +46,9 @@
// Scroll to page top
window.scrollTo(0, 0);

link.classList.add('danger');
link.classList.add('warning');
linkSpans.forEach((span) => {
span.innerHTML = Joomla.JText._('PLG_QUICKICON_JOOMLAUPDATE_UPDATEFOUND').replace('%s', `<span class="badge badge-light">${updateInfoList.length}</span>`);
span.innerHTML = Joomla.JText._('PLG_QUICKICON_JOOMLAUPDATE_UPDATEFOUND').replace('%s', `<span class="badge badge-light">${updateInfo.version}</span>`);
});
} else {
linkSpans.forEach((span) => {
Expand Down
18 changes: 9 additions & 9 deletions plugins/quickicon/extensionupdate/extensionupdate.php
Expand Up @@ -65,15 +65,15 @@ public function onGetIcons($context)

$this->app->getDocument()->addScriptOptions('js-extensions-update', $options);

Text::script('PLG_QUICKICON_EXTENSIONUPDATE_UPTODATE', true);
Text::script('PLG_QUICKICON_EXTENSIONUPDATE_UPDATEFOUND', true);
Text::script('PLG_QUICKICON_EXTENSIONUPDATE_UPDATEFOUND_MESSAGE', true);
Text::script('PLG_QUICKICON_EXTENSIONUPDATE_UPDATEFOUND_BUTTON', true);
Text::script('PLG_QUICKICON_EXTENSIONUPDATE_ERROR', true);
Text::script('MESSAGE', true);
Text::script('ERROR', true);
Text::script('INFO', true);
Text::script('WARNING', true);
Text::script('PLG_QUICKICON_EXTENSIONUPDATE_UPTODATE');
Text::script('PLG_QUICKICON_EXTENSIONUPDATE_UPDATEFOUND');
Text::script('PLG_QUICKICON_EXTENSIONUPDATE_UPDATEFOUND_MESSAGE');
Text::script('PLG_QUICKICON_EXTENSIONUPDATE_UPDATEFOUND_BUTTON');
Text::script('PLG_QUICKICON_EXTENSIONUPDATE_ERROR');
Text::script('MESSAGE');
Text::script('ERROR');
Text::script('INFO');
Text::script('WARNING');

HTMLHelper::_('behavior.core');
HTMLHelper::_('script', 'plg_quickicon_extensionupdate/extensionupdatecheck.min.js', array('version' => 'auto', 'relative' => true));
Expand Down
18 changes: 9 additions & 9 deletions plugins/quickicon/joomlaupdate/joomlaupdate.php
Expand Up @@ -75,15 +75,15 @@ public function getCoreUpdateNotification(QuickIconsEvent $event)
return;
}

Text::script('PLG_QUICKICON_JOOMLAUPDATE_ERROR', true);
Text::script('PLG_QUICKICON_JOOMLAUPDATE_UPDATEFOUND_BUTTON', true);
Text::script('PLG_QUICKICON_JOOMLAUPDATE_UPDATEFOUND_MESSAGE', true);
Text::script('PLG_QUICKICON_JOOMLAUPDATE_UPDATEFOUND', true);
Text::script('PLG_QUICKICON_JOOMLAUPDATE_UPTODATE', true);
Text::script('MESSAGE', true);
Text::script('ERROR', true);
Text::script('INFO', true);
Text::script('WARNING', true);
Text::script('PLG_QUICKICON_JOOMLAUPDATE_ERROR');
Text::script('PLG_QUICKICON_JOOMLAUPDATE_UPDATEFOUND_BUTTON');
Text::script('PLG_QUICKICON_JOOMLAUPDATE_UPDATEFOUND_MESSAGE');
Text::script('PLG_QUICKICON_JOOMLAUPDATE_UPDATEFOUND');
Text::script('PLG_QUICKICON_JOOMLAUPDATE_UPTODATE');
Text::script('MESSAGE');
Text::script('ERROR');
Text::script('INFO');
Text::script('WARNING');

$this->app->getDocument()->addScriptOptions(
'js-joomla-update',
Expand Down