From f7ba68bd0861421f0a0e71817181d15c4b7fe240 Mon Sep 17 00:00:00 2001 From: Dan Garner Date: Wed, 20 Sep 2023 08:24:56 +0100 Subject: [PATCH 01/28] Missing API docs --- lib/Controller/Module.php | 12 ++++-- lib/routes.php | 28 +++----------- web/swagger.json | 80 +++++++++++++++++++++++++++++++++------ 3 files changed, 82 insertions(+), 38 deletions(-) diff --git a/lib/Controller/Module.php b/lib/Controller/Module.php index a707a830ed..4ac72fa68b 100644 --- a/lib/Controller/Module.php +++ b/lib/Controller/Module.php @@ -21,12 +21,14 @@ */ namespace Xibo\Controller; +use Psr\Http\Message\ResponseInterface; use Slim\Http\Response as Response; use Slim\Http\ServerRequest as Request; use Xibo\Factory\ModuleFactory; use Xibo\Factory\ModuleTemplateFactory; use Xibo\Storage\StorageServiceInterface; use Xibo\Support\Exception\AccessDeniedException; +use Xibo\Support\Exception\ControllerNotImplemented; use Xibo\Support\Exception\GeneralException; use Xibo\Support\Exception\InvalidArgumentException; use Xibo\Support\Exception\NotFoundException; @@ -154,6 +156,7 @@ public function grid(Request $request, Response $response) * description="successful operation", * @SWG\Schema(ref="#/definitions/Module") * ) + * ) * @param Request $request * @param Response $response * @param $id @@ -353,14 +356,15 @@ public function templateGrid(Request $request, Response $response, string $dataT * additionalProperties={"id":"string", "type":"string", "title":"string", "helpText":"string", "options":"array"} * ) * ) + * ) * @param Request $request * @param Response $response - * @param $id - * @return \Psr\Http\Message\ResponseInterface|Response - * @throws AccessDeniedException + * @param string $dataType + * @param string $id + * @return ResponseInterface|Response * @throws GeneralException * @throws NotFoundException - * @throws \Xibo\Support\Exception\ControllerNotImplemented + * @throws ControllerNotImplemented */ // phpcs:enable public function getTemplateProperties(Request $request, Response $response, string $dataType, string $id) diff --git a/lib/routes.php b/lib/routes.php index a4e7737b37..7725a375b2 100644 --- a/lib/routes.php +++ b/lib/routes.php @@ -719,13 +719,8 @@ $group->delete('/daypart/{id}', ['\Xibo\Controller\DayPart','delete'])->setName('daypart.delete'); })->addMiddleware(new \Xibo\Middleware\FeatureAuth($app->getContainer(), ['daypart.modify'])); -/** - * Tasks - * @SWG\Tag( - * name="task", - * description="Tasks" - * ) - */ +// Tasks (no APIs) +// ---- $app->group('', function (RouteCollectorProxy $group) { $group->get('/task', ['\Xibo\Controller\Task', 'grid'])->setName('task.search'); $group->post('/task', ['\Xibo\Controller\Task', 'add'])->setName('task.add'); @@ -734,14 +729,8 @@ $group->post('/task/{id}/run', ['\Xibo\Controller\Task', 'runNow'])->setName('task.runNow'); })->addMiddleware(new \Xibo\Middleware\FeatureAuth($app->getContainer(), ['task.view'])); -/** - * Report schedule - * @SWG\Tag( - * name="report", - * description="Report schedule" - * ) - */ - +// Report schedule (no APIs) +// ------------------------- $app->get('/report/reportschedule', ['\Xibo\Controller\ScheduleReport','reportScheduleGrid'])->setName('reportschedule.search'); $app->group('', function (RouteCollectorProxy $group) { $group->post('/report/reportschedule', ['\Xibo\Controller\ScheduleReport','reportScheduleAdd'])->setName('reportschedule.add'); @@ -799,13 +788,8 @@ $group->get('/tag/usage/{id}', ['\Xibo\Controller\Tag', 'usage'])->setName('tag.usage'); })->addMiddleware(new \Xibo\Middleware\FeatureAuth($app->getContainer(), ['tag.view'])); -/** - * Actions - * @SWG\Tag( - * name="actions", - * description="Actions" - * ) - */ +// Actions (no APIs) +// ----------------- $app->get('/action', ['\Xibo\Controller\Action', 'grid'])->setName('action.search'); $app->group('', function (RouteCollectorProxy $group) { $group->post('/action', ['\Xibo\Controller\Action', 'add'])->setName('action.add'); diff --git a/web/swagger.json b/web/swagger.json index 3ba19833ad..a5ec8398b1 100644 --- a/web/swagger.json +++ b/web/swagger.json @@ -6912,6 +6912,74 @@ } } }, + "/module/properties/{id}": { + "get": { + "tags": [ + "module" + ], + "summary": "Get Module Properties", + "description": "Get a module properties which are needed to for the editWidget call", + "operationId": "getModuleProperties", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The ModuleId", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "successful operation", + "schema": { + "$ref": "#/definitions/Module" + } + } + } + } + }, + "/module/template/{dataType}/properties/{id}": { + "get": { + "tags": [ + "module" + ], + "summary": "Get Module Template Properties", + "description": "Get a module template properties which are needed to for the editWidget call", + "operationId": "getModuleProperties", + "parameters": [ + { + "name": "dataType", + "in": "path", + "description": "The Template DataType", + "required": true, + "type": "string" + }, + { + "name": "id", + "in": "path", + "description": "The Template Id", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "successful operation", + "schema": { + "type": "object", + "additionalProperties": { + "id": "string", + "type": "string", + "title": "string", + "helpText": "string", + "options": "array" + } + } + } + } + } + }, "/notification": { "get": { "tags": [ @@ -14522,14 +14590,6 @@ "name": "dayPart", "description": "Dayparting" }, - { - "name": "task", - "description": "Tasks" - }, - { - "name": "report", - "description": "Report schedule" - }, { "name": "Player Software" }, @@ -14537,10 +14597,6 @@ "name": "tags", "description": "Tags" }, - { - "name": "actions", - "description": "Actions" - }, { "name": "menuBoard", "description": "Menu Boards - feature preview, please do not use in production." From ecbe86e4f317af2dc3a51eaaf3387e3ddf2c8915 Mon Sep 17 00:00:00 2001 From: Dan Garner Date: Wed, 20 Sep 2023 08:26:37 +0100 Subject: [PATCH 02/28] Missing API docs --- lib/routes.php | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/lib/routes.php b/lib/routes.php index 7725a375b2..dbf3337453 100644 --- a/lib/routes.php +++ b/lib/routes.php @@ -531,13 +531,8 @@ ->addMiddleware(new \Xibo\Middleware\FeatureAuth($app->getContainer(), ['proof-of-play'])) ->setName('stats.export'); -/** - * Log - * @SWG\Tag( - * name="log", - * description="Logs" - * ) - */ +// Log (no APIs) +// ------------- $app->group('', function (RouteCollectorProxy $group) { $group->get('/log', ['\Xibo\Controller\Logging', 'grid'])->setName('log.search'); $group->delete('/log', ['\Xibo\Controller\Logging', 'truncate'])->setName('log.truncate'); From 654d60a6f453e3666d7b41d86229642a3fc5ada6 Mon Sep 17 00:00:00 2001 From: Dan Garner Date: Wed, 20 Sep 2023 08:26:46 +0100 Subject: [PATCH 03/28] Missing API docs --- web/swagger.json | 4 ---- 1 file changed, 4 deletions(-) diff --git a/web/swagger.json b/web/swagger.json index a5ec8398b1..1562a5d84b 100644 --- a/web/swagger.json +++ b/web/swagger.json @@ -14566,10 +14566,6 @@ "name": "statistics", "description": "Statistics" }, - { - "name": "log", - "description": "Logs" - }, { "name": "user", "description": "Users" From a97e139804c0b2f0b6219785831d4d7117b3567d Mon Sep 17 00:00:00 2001 From: Ruben Pingol <128448242+rubenpingol-xibo@users.noreply.github.com> Date: Thu, 21 Sep 2023 18:26:21 +0800 Subject: [PATCH 04/28] Select2: Fix search focus (#2111) --- ui/src/core/forms.js | 17 +++++++++++++++++ ui/src/core/xibo-cms.js | 12 ++++++++++++ ui/src/editor-core/topbar.js | 5 +++++ 3 files changed, 34 insertions(+) diff --git a/ui/src/core/forms.js b/ui/src/core/forms.js index 4d1c296b94..d9c8cef3bb 100644 --- a/ui/src/core/forms.js +++ b/ui/src/core/forms.js @@ -1936,6 +1936,23 @@ window.forms = { } }); + // Select2 dropdown + findElements( + '.select2-hidden-accessible', + target, + ).each(function(_k, el) { + const $el = $(el); + + $el.on('select2:open', function(event) { + const $search = $(event.target).data('select2').dropdown?.$search; + setTimeout(function() { + if ($search) { + $search.get(0).focus(); + } + }, 10); + }); + }); + // Handle field dependencies for the container // only if we don't have a target if (!target) { diff --git a/ui/src/core/xibo-cms.js b/ui/src/core/xibo-cms.js index 321b9d69df..6e9b6c303d 100644 --- a/ui/src/core/xibo-cms.js +++ b/ui/src/core/xibo-cms.js @@ -3292,6 +3292,12 @@ function makePagedSelect(element, parent) { } }); + element.on('select2:open', function(event) { + setTimeout(function() { + $(event.target).data('select2').dropdown?.$search.get(0).focus(); + }, 10); + }); + // Set initial value if exists if( [undefined, ''].indexOf(element.data("initialValue")) == -1 && @@ -3419,6 +3425,12 @@ function makeLocalSelect(element, parent) { return state.text; } }); + + element.on('select2:open', function(event) { + setTimeout(function() { + $(event.target).data('select2').dropdown?.$search.get(0).focus(); + }, 10); + }); } // Custom submit for user preferences diff --git a/ui/src/editor-core/topbar.js b/ui/src/editor-core/topbar.js index 92eb2790d9..827df136c9 100644 --- a/ui/src/editor-core/topbar.js +++ b/ui/src/editor-core/topbar.js @@ -300,6 +300,11 @@ Topbar.prototype.setupJumpList = function(jumpListContainer) { $search.trigger('input'); }, 100); }); + + // Force search field focus + setTimeout(function() { + $search.get(0).focus(); + }, 10); }); }; From e501204ced077979d4f54a732620fba32b26cebb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mauro=20Ferr=C3=A3o?= Date: Thu, 21 Sep 2023 17:29:52 +0100 Subject: [PATCH 05/28] Widget: text flickers after upgrade (rich text) (#2112) relates to xibosignage/xibo#3157 --- modules/text.xml | 2 +- ui/src/core/forms.js | 19 ++++++++++++++++--- ui/src/editor-core/properties-panel.js | 4 ++-- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/modules/text.xml b/modules/text.xml index df4bd70025..85726b27e9 100755 --- a/modules/text.xml +++ b/modules/text.xml @@ -55,7 +55,7 @@ Effect Please select the effect that will be used to transition between items. - noTransition + none Speed diff --git a/ui/src/core/forms.js b/ui/src/core/forms.js index d9c8cef3bb..5617a50a4d 100644 --- a/ui/src/core/forms.js +++ b/ui/src/core/forms.js @@ -1858,7 +1858,7 @@ window.forms = { ).each(function(_k, el) { // Populate the effect list with options const $el = $(el).find('select'); - const effectsType = $el.data('effects-type'); + const effectsType = $el.data('effects-type').split(' '); // Effects const effects = [ @@ -1881,10 +1881,23 @@ window.forms = { // Add the options $.each(effects, function(_index, element) { - if ((effectsType !== 'all' && element.group !== effectsType) || - element.effect === 'none') { + // Don't add effect if it's none and + // the target is a element or element-group + if ( + effectsType.indexOf('noNone') != -1 && + element.effect === 'none' + ) { + return; + } + + // Don't add effect if the target effect type isn't all or a valid type + if ( + effectsType.indexOf('all') === -1 && + effectsType.indexOf(element.group) === -1 + ) { return; } + $el.append( $('