Skip to content

Commit

Permalink
Merge pull request #2134 from xibosignage/develop
Browse files Browse the repository at this point in the history
* Missing API docs
* Missing API docs

* Missing API docs

* Select2: Fix search focus (#2111)

* Widget: text flickers after upgrade (rich text) (#2112)

relates to xibosignage/xibo#3157

* Swagger: build out for modules/module templates.

* Update readme with new branch versions.

* Swagger: Property default.

* Misc fixes for 4.0.4 (#2113)

* Bump version.
* Modules: BE mapping for the escapeHtml attribute on extends, needs FE completion. xibosignageltd/xibo-private#494
* Modules: Improve module not enabled message xibosignageltd/xibo-private#472
* Upgrade: handle duplicate modules on upgrade. xibosignage/xibo#3137
* RSS: date parsing broken in php 8.2 (in picofeed) xibosignage/xibo#3148
* Embedded: default should be off for transparency, scale content and pre navigate xibosignage/xibo#3146

* Cypress - saving artifacts and misc fixes (#2114)

* API: extend class missing escape attribute used for elements FE (#2115)

relates to xibosignageltd/xibo-private#494

* Show error message on Elements with bad configured widget (#2116)

relates to xibosignageltd/xibo-private#499

* v3 module import fixes (#2118)

relates to xibosignageltd/xibo-private#495

* Embedded: CSS with special chars
* Weather: name="text-color" field not being applied
* Weather: xibo-legacy-template-render match fix
* Weather: Background image being forced on override
* Module preview: wrong icon

* Player: use reportFault second param object for setting targetId (#2117)

* Player: use reportFault second param object for setting targetId
relates to xibosignageltd/xibo-private#264

* Player: call xiboIC.expireNow when data is not found after XHR request
relates to xibosignageltd/xibo-private#264

* Widget Elements: Fix date formatting with onTemplateRender (#2119)

relates to xibosignage/xibo#3138

* Editors: Review all messages, labels and help text content (#2121)

relates to xibosignageltd/xibo-private#504

* Editor automatic layers refactor (#2120)

relates to xibosignageltd/xibo-private#503

 - Added layer to element groups
 - Context menu controls for layers in element groups
 - Element groups added to layer manager
 - Refactor layer manager
 - Layer manager keep scroll position

* Bugfixes 4.0.4 issues (#2124)

* Video Upload : Fix thumbnail capture without manual adjustments in the preview window. xibosignage/xibo#3153
* Schedule Calendar : Fix moment js issues with custom date formats. xibosignage/xibo#3149
* DataSets : Fix issues with replacements for displayId and displayGeoLocation xibosignage/xibo#3144
* Stocks : Fix AlphaVantage API endpoint for free and paid keys. xibosignage/xibo#3168
* Status Dashboard : Fix ordering by Faults column. xibosignage/xibo#3170
* Folders page : Fix Folder details xibosignage/xibo#3171
* Fonts : use regex on fileName to avoid issues downloading on the Players xibosignage/xibo#3152
* Schedule : Sync form layouts search should use url_for. xibosignage/xibo#3158

* Add delete button to drawer widget select (#2126)

relates to xibosignageltd/xibo-private#483

 - Removed delete button from PPanel

* Widget fixes for Dashboard and DataSet (#2128)

* Dashboard: add a template so the widget can be added. fixes xibosignage/xibo#3176
* Widget: dataset no data message doesn't work fixes xibosignage/xibo#3177
* Widget: dataset include a string template on playlists (also image slideshow should be playlist only). 
 * Fix playlist only, fix template icon.

* Misc issues for 4.0.4 (#2125)

* Widget: embedded to have a head option xibosignage/xibo#3141
* Widget: embedded javascript should allow library references. xibosignage/xibo#3134
* Regular Maintenance: linked files shouldn't be removed. xibosignage/xibo#3143

* Elements: Final fix for scrollHorz effect (#2127)

* Bugifxes 4.0.4 issues part2 (#2129)

* Schedule : Throw specific error when not all Displays in Sync Group were given a Layout. xibosignage/xibo#3150
* Maintenance : Remove weather-humidity-percent asset, as it is no longer needed. xibosignage/xibo#3155
* Custom Install : Make sure we create fonts sub-folder under selected Library directory during install process. xibosignage/xibo#3156
* Layout : Make sure we only show enabled Resolutions in the dropdown in Layout Editor - while also always including currently selected resolution. xibosignage/xibo#3173
* Library Upload : Protect against empty default resize limit CMS setting. xibosignage/xibo#3159

* Bugfix/4.0.4 fixes (#2131)

* Show error message only on element group
relates to xibosignageltd/xibo-private#499

* Playlists: cannot scroll, the scroll bars are not displayed
relates to xibosignage/xibo#3161

* Layout Editor: Add upload card to playlist crashes
relates to xibosignageltd/xibo-private#498

* Layer manager fixes (#2130)

relates to xibosignageltd/xibo-private#503

 - Select item on layer manager to put on top fix
- Canvas layer is also calculated
 - Element group layer defaults to 0 for empty canvas
 - Prevent multi refreshes when deleting element group

* Widget: Weather background choose from library (#2132)

* Playlists scroll inline fix (#2133)

relates to xibosignage/xibo#3161

* Release 4.0.4 final prep (#2139)
* Status dashboard: Remove log
* Update translations, build swagger docs.

---------

Co-authored-by: Ruben Pingol <[email protected]>
Co-authored-by: Mauro Ferrão <[email protected]>
Co-authored-by: Israt Jahan Farzana <[email protected]>
Co-authored-by: Peter <[email protected]>
  • Loading branch information
5 people authored Oct 9, 2023
2 parents 0419cb8 + af8c511 commit 1c56b38
Show file tree
Hide file tree
Showing 125 changed files with 4,086 additions and 2,754 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/test-suite.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,15 @@ jobs:
run: |
docker exec --user www-data -t cms-web /bin/bash -c "cd /var/www/cms; php vendor/bin/phpunit --log-junit results.xml"
- name: Run Cypress
continue-on-error: true
run: |
docker exec cms-db mysql -ucms -pjenkins cms -e "INSERT INTO oauth_clients (id, secret, name, userId, authCode, clientCredentials) VALUES ('MrGPc7e3IL1hA6w13l7Ru5giygxmNiafGNhFv89d', 'Pk6DdDgu2HzSoepcMHRabY60lDEvQ9ucTejYvc5dOgNVSNaOJirCUM83oAzlwe0KBiGR2Nhi6ltclyNC1rmcq0CiJZXzE42KfeatQ4j9npr6nMIQAzMal8O8RiYrIoono306CfyvSSJRfVfKExIjj0ZyE4TUrtPezJbKmvkVDzh8aj3kbanDKatirhwpfqfVdfgsqVNjzIM9ZgKHnbrTX7nNULL3BtxxNGgDMuCuvKiJFrLSyIIz1F4SNrHwHz', 'cypress', 1, 0, 1)"
docker exec cms-db mysql -ucms -pjenkins cms -e "INSERT INTO oauth_client_scopes (clientId, scopeId) VALUES ('MrGPc7e3IL1hA6w13l7Ru5giygxmNiafGNhFv89d', 'all') ON DUPLICATE KEY UPDATE scopeId = scopeId"
docker run --ipc=host --name cms-cypress --link=cms-web:web -v $(pwd)/cypress.config.js:/app/cypress.config.js -v $(pwd)/cypress:/app/cypress ghcr.io/xibosignage/xibo-cms:cypress bash -c "CYPRESS_baseUrl=http://web /app/node_modules/.bin/cypress run --config screenshotsFolder=/app/results,video=false --reporter junit --reporter-options 'mochaFile=/app/results/results_cypress_[hash].xml,toConsole=true'"
docker run --ipc=host --name cms-cypress --link=cms-web:web -v $(pwd)/cypress.config.js:/app/cypress.config.js -v $(pwd)/cypress:/app/cypress ghcr.io/xibosignage/xibo-cms:cypress bash -c "CYPRESS_baseUrl=http://web /app/node_modules/.bin/cypress run --config screenshotsFolder=/app/cypress/results,video=false --reporter junit --reporter-options 'mochaFile=/app/cypress/results/results_cypress_[hash].xml,toConsole=true'; chown -R 1001:1001 /app/cypress/results"
- name: Save Cypress test results as an artifact
if: failure()
uses: actions/upload-artifact@v3
with:
name: cypress-test-results
path: cypress/results
run: exit 1
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,9 @@ git clone [email protected]:<your_id>/xibo-cms.git xibo-cms

We maintain the following branches. To contribute to Xibo please also use the `develop` branch as your base.

- develop: Work in progress toward 4.0
- master: Currently 3.3
- release32: Bug fixes for 3.2
- release31: Bug fixes for 3.1
- release30: Bug fixes 3.0
- develop: Work in progress toward 4.0.x
- master: Currently 4.0
- release33: Bug fixes for 3.3
- release23: Bug fixes for 2.3
- release18: Archive of 1.8
- release17: Archive of 1.7
Expand Down
8 changes: 4 additions & 4 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions cypress/e2e/report_summary.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ describe('Summary by Layout, Media or Event', function() {
});

it('Range: Today, Checks duration and count of a layout stat', () => {
// Create and alias for load layout
// Create alias
cy.intercept({
url: '/display?start=*',
query: {display: display1},
Expand Down Expand Up @@ -57,13 +57,14 @@ describe('Summary by Layout, Media or Event', function() {

// Click on the Apply button
cy.contains('Apply').should('be.visible').click();
// Wait for report data
cy.wait('@reportData');

cy.get('.chart-container').should('be.visible');

// Click on Tabular
cy.contains('Tabular').should('be.visible').click();
cy.contains('Next').should('be.visible').click();
cy.wait('@reportData');

// Should have media stats
cy.get('#summaryTbl tbody tr:nth-child(3) td:nth-child(1)').contains('12:00 PM'); // Period
Expand All @@ -75,6 +76,7 @@ describe('Summary by Layout, Media or Event', function() {
const reportschedule = 'Daily Summary by Layout 1 and Display 1';

// Create and alias for load layout
cy.intercept('/report/reportschedule/form/add*').as('reportScheduleAddForm');
cy.intercept({
url: '/display?start=*',
query: {display: display1},
Expand Down Expand Up @@ -102,6 +104,7 @@ describe('Summary by Layout, Media or Event', function() {
// ------
// Create a Daily Summary Report Schedule
cy.get('#reportAddBtn').click();
cy.wait('@reportScheduleAddForm');
cy.get('#reportScheduleAddForm #name ').type(reportschedule);

// Click on the select2 selection
Expand Down
50 changes: 42 additions & 8 deletions cypress/e2e/schedule.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ describe('Campaigns', function() {
});
});

it.skip('should schedule an event campaign that has no priority, no recurrence', function() {
it('should schedule an event campaign that has no priority, no recurrence', function() {
cy.intercept('GET', '/schedule?draw=2*').as('scheduleLoad');
cy.intercept('GET', '/schedule/form/add?*').as('scheduleAddForm');

// Set up intercepts with aliases
cy.intercept({
url: '/display?start=*',
Expand All @@ -64,8 +67,13 @@ describe('Campaigns', function() {

// Visit the page and click on the Add Event button
cy.visit('/schedule/view');
// Wait for schedule draw 2
cy.wait('@scheduleLoad');
cy.contains('Clear Filters').should('be.visible').click();
cy.contains('Add Event').click();
cy.wait('@scheduleAddForm');

// Fill in Add form
cy.get(':nth-child(3) > .col-sm-10 > .select2 > .selection > .select2-selection > .select2-selection__rendered')
.type(display1);
cy.wait('@loadDisplaygroupAfterSearch');
Expand Down Expand Up @@ -93,6 +101,10 @@ describe('Campaigns', function() {

// Validate - schedule creation should be successful
cy.visit('/schedule/view');
//cy.get('.select2-selection__clear').click();
cy.contains('Clear Filters').should('be.visible').click();


cy.get('#DisplayList + span .select2-selection').click();
// Type the display name
cy.get('.select2-container--open input[type="search"]').type(display1);
Expand All @@ -106,7 +118,9 @@ describe('Campaigns', function() {
cy.get('#schedule-grid').contains(campaignSchedule1);
});

it.skip('should schedule an event layout that has no priority, no recurrence', function() {
it('should schedule an event layout that has no priority, no recurrence', function() {
cy.intercept('GET', '/schedule?draw=2*').as('scheduleLoad');
cy.intercept('GET', '/schedule/form/add?*').as('scheduleAddForm');
cy.intercept({
url: '/displaygroup?*',
query: {displayGroup: display1},
Expand All @@ -123,7 +137,11 @@ describe('Campaigns', function() {

// Click on the Add Event button
cy.visit('/schedule/view');
// Wait for schedule draw 2
cy.wait('@scheduleLoad');
cy.contains('Clear Filters').should('be.visible').click();
cy.contains('Add Event').click();
cy.wait('@scheduleAddForm');

// display
cy.get(':nth-child(3) > .col-sm-10 > .select2 > .selection > .select2-selection > .select2-selection__rendered')
Expand Down Expand Up @@ -154,7 +172,9 @@ describe('Campaigns', function() {
cy.contains('Added Event');
});

it.skip('should schedule an event command/overlay layout that has no priority, no recurrence', function() {
it('should schedule an event command/overlay layout that has no priority, no recurrence', function() {
cy.intercept('GET', '/schedule?draw=2*').as('scheduleLoad');
cy.intercept('GET', '/schedule/form/add?*').as('scheduleAddForm');
cy.intercept({
url: '/displaygroup?*',
query: {displayGroup: display1},
Expand All @@ -167,7 +187,11 @@ describe('Campaigns', function() {

// Click on the Add Event button
cy.visit('/schedule/view');
// Wait for schedule draw 2
cy.wait('@scheduleLoad');
cy.contains('Clear Filters').should('be.visible').click();
cy.contains('Add Event').click();
cy.wait('@scheduleAddForm');

// display
cy.get(':nth-child(3) > .col-sm-10 > .select2 > .selection > .select2-selection > .select2-selection__rendered')
Expand Down Expand Up @@ -209,7 +233,11 @@ describe('Campaigns', function() {
cy.get('.modal .modal-footer').contains('Save').click();
});

it.skip('should edit a scheduled event', function() {
it('should edit a scheduled event', function() {
cy.intercept('GET', '/schedule/data/events?*').as('scheduleDataEvent');
cy.intercept('GET', '/schedule?draw=2*').as('scheduleLoad2');
cy.intercept('GET', '/schedule?draw=3*').as('scheduleLoad3');
cy.intercept('GET', '/schedule/form/add?*').as('scheduleAddForm');
cy.intercept({
url: '/displaygroup?*',
query: {displayGroup: display2},
Expand All @@ -221,6 +249,9 @@ describe('Campaigns', function() {
}).as('loadLayoutSpecificCampaign');

cy.visit('/schedule/view');
// Wait for schedule draw 2
cy.wait('@scheduleLoad2');
cy.contains('Clear Filters').should('be.visible').click();

// ---------
// Edit a schedule - add another display
Expand All @@ -245,11 +276,14 @@ describe('Campaigns', function() {
.click();

cy.get('.modal .modal-footer').contains('Save').click();

cy.get('#schedule-grid tbody').contains('2');

// cy.get('#schedule-grid tbody tr').should('have.length', 2);
// cy.get('#schedule-grid tr:first-child .dropdown-toggle').invoke('show').click();
// cy.get('#schedule-grid tr:first-child .schedule_button_delete').click();
// cy.get('.bootbox .save-button').click();
cy.get('#schedule-grid tbody tr').should('have.length', 2);
cy.wait('@scheduleLoad3');
cy.wait('@scheduleDataEvent');
cy.get('#schedule-grid tr:first-child .dropdown-toggle').click();
cy.get('#schedule-grid tr:first-child .schedule_button_delete').click();
cy.get('.bootbox .save-button').click();
});
});
21 changes: 11 additions & 10 deletions db/migrations/20220330111440_modules_table_ver_four_migration.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,18 @@ public function change()

// Pull through old modules, having a guess at their names.
try {
//phpcs:disable
$this->execute('
INSERT INTO `module` (`moduleId`, `enabled`, `previewEnabled`, `defaultDuration`, `settings`)
SELECT DISTINCT LOWER(CASE WHEN `class` LIKE \'%Custom%\'
THEN IFNULL(installname, module)
ELSE CONCAT(\'core-\', `module`)
END),
`enabled`,
`previewEnabled`,
`defaultDuration`,
`settings`
FROM `module_old`');
INSERT INTO `module` (`moduleId`, `enabled`, `previewEnabled`, `defaultDuration`, `settings`)
SELECT LOWER(CASE WHEN `class` LIKE \'%Custom%\' THEN IFNULL(installname, module) ELSE CONCAT(\'core-\', `module`) END),
MAX(`enabled`),
MAX(`previewEnabled`),
MAX(`defaultDuration`),
MAX(`settings`)
FROM `module_old`
GROUP BY LOWER(CASE WHEN `class` LIKE \'%Custom%\' THEN IFNULL(installname, module) ELSE CONCAT(\'core-\', `module`) END)
');
//phpcs:enable

// Handle any specific renames
$this->execute('UPDATE `module` SET moduleId = \'core-rss-ticker\' WHERE moduleId = \'core-ticker\'');
Expand Down
9 changes: 6 additions & 3 deletions lib/Connector/AlphaVantageConnector.php
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ protected function getStockQuote(string $symbol, ?int $isPaidPlan): array

$request = $this->getClient()->request('GET', 'https://www.alphavantage.co/query', [
'query' => [
'function' => $isPaidPlan === 1 ? 'TIME_SERIES_DAILY' : 'TIME_SERIES_DAILY_ADJUSTED',
'function' => $isPaidPlan === 1 ? 'TIME_SERIES_DAILY_ADJUSTED' : 'TIME_SERIES_DAILY',
'symbol' => $symbol,
'apikey' => $this->getSetting('apiKey')
]
Expand Down Expand Up @@ -360,7 +360,7 @@ private function decorateWithReplacements(array $item): array
if ($item['Change'] > 0) {
$item['ChangeIcon'] = 'up-arrow';
$item['ChangeStyle'] = 'value-up';
} else if ($item['Change'] < 0){
} else if ($item['Change'] < 0) {
$item['ChangeIcon'] = 'down-arrow';
$item['ChangeStyle'] = 'value-down';
}
Expand Down Expand Up @@ -390,7 +390,10 @@ private function getCurrenciesResults(DataProviderInterface $dataProvider): void
'Missing Items for Currencies Module with WidgetId ' .
$dataProvider->getWidgetId()
);
throw new InvalidArgumentException(__('Missing Items for Currencies Module. Please provide items in order to proceed.'), 'items');
throw new InvalidArgumentException(
__('Missing Items for Currencies Module. Please provide items in order to proceed.'),
'items'
);
}

// Does this require a reversed conversion?
Expand Down
17 changes: 12 additions & 5 deletions lib/Controller/Layout.php
Original file line number Diff line number Diff line change
Expand Up @@ -1473,7 +1473,7 @@ public function grid(Request $request, Response $response)
$module = $this->moduleFactory->getByType($widget->type);
} catch (NotFoundException $notFoundException) {
// This module isn't available, mark it as invalid.
$widget->isValid = 0;
$widget->isValid = false;
$widget->setUnmatchedProperty('moduleName', __('Invalid Module'));
$widget->setUnmatchedProperty('name', __('Invalid Module'));
$widget->setUnmatchedProperty('tags', []);
Expand Down Expand Up @@ -1504,7 +1504,7 @@ public function grid(Request $request, Response $response)
if (in_array('widget_validity', $embed)) {
$status = 0;
$layout->assessWidgetStatus($module, $widget, $status);
$widget->isValid = $status;
$widget->isValid = $status === 1;
}

// apply default transitions to a dynamic parameters on widget object.
Expand Down Expand Up @@ -1943,9 +1943,10 @@ function editBackgroundForm(Request $request, Response $response, $id)
$sanitizedParams = $this->getSanitizer($request->getParams());

// Check Permissions
if (!$this->getUser()->checkEditable($layout))
if (!$this->getUser()->checkEditable($layout)) {
throw new AccessDeniedException();

}

// Edits always happen on Drafts, get the draft Layout using the Parent Layout ID
if ($layout->schemaVersion < 2) {
$resolution = $this->resolutionFactory->getByDesignerDimensions($layout->width, $layout->height);
Expand All @@ -1961,7 +1962,13 @@ function editBackgroundForm(Request $request, Response $response, $id)
$this->getState()->setData([
'layout' => $layout,
'resolution' => $resolution,
'resolutions' => $this->resolutionFactory->query(['resolution'], ['withCurrent' => $resolution->resolutionId]),
'resolutions' => $this->resolutionFactory->query(
['resolution'],
[
'withCurrent' => $resolution->resolutionId,
'enabled' => 1
]
),
'backgroundId' => $backgroundId,
'backgrounds' => $backgrounds,
]);
Expand Down
Loading

0 comments on commit 1c56b38

Please sign in to comment.