Skip to content

Commit

Permalink
[5.0] Select Schedule Task css (#41871)
Browse files Browse the repository at this point in the history
* [5.0] Select Schedule Task css

The select task view is the same as the select module view except it uses its own css file with invalid css.

This PR changes that so that it uses an scss file in exactly the same way as com_modules. This removes the invalid css and makes it more maintainable.

* section

* Merge remote-tracking branch 'origin/5.0-dev' into 6_com_scheduler

* Revert "Merge remote-tracking branch 'origin/5.0-dev' into 6_com_scheduler"

This reverts commit 3bb1df2.

* Revert "Auxiliary commit to revert individual files from df98bc9"

This reverts commit a9e3bedc2cc97deb806be1138fe0402e30c2e932.

* assets - thanks @wilsonge

* sync with #41920

* js fix

* js

---------

Co-authored-by: Richard Fath <richard.fath@t-online.de>
Co-authored-by: Richard Fath <richard67@users.noreply.github.com>
  • Loading branch information
3 people committed Sep 30, 2023
1 parent 3454262 commit debb587
Show file tree
Hide file tree
Showing 11 changed files with 122 additions and 69 deletions.
3 changes: 3 additions & 0 deletions administrator/components/com_admin/script.php
Original file line number Diff line number Diff line change
Expand Up @@ -2173,6 +2173,9 @@ public function deleteUnexistingFiles($dryRun = false, $suppressOutput = false)
'/libraries/vendor/fgrosse/phpasn1/LICENSE',
'/libraries/vendor/stella-maris/clock/LICENSE.md',
'/libraries/vendor/stella-maris/clock/src/ClockInterface.php',
'/media/com_scheduler/css/admin-view-select-task.css',
'/media/com_scheduler/css/admin-view-select-task.min.css',
'/media/com_scheduler/css/admin-view-select-task.min.css.gz',
'/media/system/css/calendar-jos.css',
'/media/system/css/calendar-jos.min.css',
'/media/system/css/calendar-jos.min.css.gz',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
$app = $this->app;

$wa = $this->document->getWebAssetManager();
$wa->useStyle('com_scheduler.admin-view-select-task-css');
$wa->useScript('com_scheduler.admin-view-select-task-search');

?>
Expand Down Expand Up @@ -75,7 +74,7 @@ class="visually-hidden"><?php echo Text::_('INFO'); ?></span>
aria-label="<?php echo Text::sprintf('COM_SCHEDULER_SELECT_TASK_TYPE', $name); ?>">
<div class="new-task-details">
<h3 class="new-task-title"><?php echo $name; ?></h3>
<p class="card-body new-task-caption p-0">
<p class="new-task-caption p-0">
<?php echo $desc; ?>
</p>
</div>
Expand Down
4 changes: 3 additions & 1 deletion administrator/language/en-GB/plg_behaviour_compat.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
PLG_BEHAVIOUR_COMPAT="Behaviour - Backward Compatibility"
PLG_COMPAT_FIELD_CLASSES_ALIASES_LABEL="Classes Aliases"
PLG_COMPAT_FIELD_CLASSES_ALIASES_DESCRIPTION="Add class aliases for classes which have been renamed or moved to a namespace."
PLG_COMPAT_FIELD_ES5_ASSETS_LABEL="ES5 Assets"
PLG_COMPAT_FIELD_ES5_ASSETS_DESCRIPTION="Activate this option if your extension requires *.es5 assets which has resulted in an exception. The assets provided are empty but prevent the exception."
PLG_COMPAT_FIELD_ES5_ASSETS_LABEL="ES5 Assets"
PLG_COMPAT_FIELD_REMOVED_ASSETS_DESCRIPTION="Activate this option if your extension requires removed assets which has resulted in an exception. The assets provided are empty but prevent the exception."
PLG_COMPAT_FIELD_REMOVED_ASSETS_LABEL="Removed Assets"
PLG_COMPAT_XML_DESCRIPTION="If you use extensions which are not using the current Joomla Coding standards then this plugin, when enabled, will provide backward compatibility to the prior major version."
60 changes: 0 additions & 60 deletions build/media_source/com_scheduler/css/admin-view-select-task.css

This file was deleted.

5 changes: 0 additions & 5 deletions build/media_source/com_scheduler/joomla.asset.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,6 @@
"type": "module"
}
},
{
"name": "com_scheduler.admin-view-select-task-css",
"type": "style",
"uri": "com_scheduler/admin-view-select-task.css"
},
{
"name": "com_scheduler.admin-view-task-css",
"type": "style",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ if (elSearch && elSearchContainer) {
}

const cardHeader = card.querySelector('.new-task-title');
const cardBody = card.querySelector('.card-body');
const cardBody = card.querySelector('.new-task-caption');
const title = cardHeader ? cardHeader.textContent : '';
const description = cardBody ? cardBody.textContent : '';

Expand Down
15 changes: 15 additions & 0 deletions build/media_source/plg_behaviour_compat/removed.asset.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"$schema": "https://developer.joomla.org/schemas/json-schema/web_assets.json",
"name": "plg_behaviour_compat",
"version": "5.0.0",
"description": "Joomla CMS Removed Assets b/c entries, the entries are only placeholders without functionality.",
"license": "GPL-2.0-or-later",
"assets": [
{
"name": "com_scheduler.admin-view-select-task-css",
"type": "style",
"deprecated": true,
"uri": ""
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
.new-tasks {
// We use the same colours for the new task section as we do for the quickicons.
--text-color: var(--template-quickicon-color);
--bg-color: hsl(var(--hue), 60%, 97%);
--bg-color-hvr: var(--template-bg-dark);
--icon-color: var(--template-quickicon-color);
--icon-color-hvr: hsl(var(--hue), 50%, 93%);

.card-columns {
grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
}

@if $enable-dark-mode {
@include color-mode(dark) {
.new-tasks {
--bg-color: var(--template-bg-dark-80);
--bg-color-hvr: var(--template-bg-dark-65);
--icon-color: var(--template-bg-dark-80);
--icon-color-hvr: var(--template-quickicon-color);
}
}
}

.new-task {
display: flex;
overflow: hidden;
color: var(--text-color);
background-color: var(--bg-color);
border: 1px solid hsl(var(--hue), 50%, 93%);
border-radius: $border-radius;

* {
transition: all .25s ease;
}

&-details {
flex: 1 0;
padding: 1rem;
}

&-title {
margin-bottom: .25rem;
font-size: 1rem;
font-weight: 700;
}

&-caption {
display: flex;
margin: 0;
font-size: .875rem;
}

&-link {
display: flex;
align-items: flex-end;
justify-content: center;
width: 2.5rem;
font-size: 1.2rem;
background: hsl(var(--hue), 50%, 93%);

span {
margin-bottom: 10px;
color: var(--icon-color);
}

.new-task:hover & {
background: var(--bg-color-hvr);

span {
color: var(--icon-color-hvr);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
@import "pages/com_modules";
@import "pages/com_tags";
@import "pages/com_privacy";
@import "pages/com_scheduler";
@import "pages/com_templates";
@import "pages/com_users";

Expand Down
12 changes: 12 additions & 0 deletions plugins/behaviour/compat/compat.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,18 @@
<option value="0">JNO</option>
<option value="1">JYES</option>
</field>
<field
name="removed_asset"
type="radio"
label="PLG_COMPAT_FIELD_REMOVED_ASSETS_LABEL"
description="PLG_COMPAT_FIELD_REMOVED_ASSETS_DESCRIPTION"
layout="joomla.form.field.radio.switcher"
default="1"
filter="integer"
>
<option value="0">JNO</option>
<option value="1">JYES</option>
</field>
</fieldset>
</fields>
</config>
Expand Down
11 changes: 11 additions & 0 deletions plugins/behaviour/compat/src/Extension/Compat.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,5 +98,16 @@ public function onAfterInitialiseDocument(AfterInitialiseDocumentEvent $event)
->getRegistry()
->addRegistryFile('media/plg_behaviour_compat/es5.asset.json');
}
/**
* Load the removed assets stubs, they are needed if an extension
* directly uses a core asset from Joomla 4 which is not present in Joomla 5+
* and only provides an empty asset to not throw an exception
*/
if ($this->params->get('removed_asset', '1')) {
$event->getDocument()
->getWebAssetManager()
->getRegistry()
->addRegistryFile('media/plg_behaviour_compat/removed.asset.json');
}
}
}

0 comments on commit debb587

Please sign in to comment.