Skip to content

Commit

Permalink
Merge pull request #568 from xibosignage/release20
Browse files Browse the repository at this point in the history
Release 2.0.2
  • Loading branch information
dasgarner authored May 17, 2019
2 parents bd6f298 + 0ddb041 commit 420d70f
Show file tree
Hide file tree
Showing 190 changed files with 13,902 additions and 12,000 deletions.
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Installing an official release is [described in the manual](http://xibo.org.uk/m

**Please only install a Development environment if you intend make code changes to Xibo. Installing from the repository is not suitable for a production installation.**

Xibo uses Docker to ensure all contributers have a repeatable development environment which is easy to get up and running.
Xibo uses Docker to ensure all contributors have a repeatable development environment which is easy to get up and running.

The very same Docker containers are used in our recommended end user installation to promote consistency from development to deployment.

Expand Down Expand Up @@ -127,6 +127,20 @@ docker-compose exec web sh -c "cd /var/www/cms; php bin/locale.php"
find ./locale ./cache ./lib ./web -iname "*.php" -print0 | xargs -0 xgettext --from-code=UTF-8 -k_e -k_x -k__ -o locale/default.pot
```

To import translations:

```bash
bzr pull lp:~dangarner/xibo/swift-translations
```

Convert to `mo` format:

```bash
for i in *.po; do msgfmt "$i" -o $(echo $i | sed s/po/mo/); done
```

Move the resulting `mo` files into your `locale` folder.

## Swagger API Docs
To generate a `swagger.json` file, with the dev containers running:

Expand Down
54 changes: 31 additions & 23 deletions cypress/integration/layout_designer_populated_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,11 @@ describe('Layout Designer (Populated)', function() {

it('should prevent a layout edit action, and show a toast message', function() {

// Choose the first region in the navigator and select it
cy.get('#layout-navigator .designer-region:first-child').click({force: true});
// Choose the first widget in the timeline and select it
cy.get('#layout-timeline .designer-region:first-child .designer-widget:first-child').click({force: true});

// Should contain region options form
cy.get('#properties-panel-container').contains('Region Options');
// Should contain widget options form
cy.get('#properties-panel-container').contains('Edit Image');

// The save button should not be visible
cy.get('#properties-panel-container [data-action="save"]').should('not.exist');
Expand Down Expand Up @@ -114,13 +114,6 @@ describe('Layout Designer (Populated)', function() {
});

// Properties Panel
it('shows region properties in the properties panel when clicking on a region in the navigator ', function() {
cy.get('#layout-navigator [data-type="region"]:first-child').click();

// Check if the properties panel title is Region Options
cy.get('#properties-panel').contains('Region Options');
});

it('shows widget properties in the properties panel when clicking on a widget in the timeline', function() {
// Select the first widget from the first region on timeline ( image )
cy.get('#timeline-container [data-type="region"]:first-child [data-type="widget"]:first-child').click();
Expand Down Expand Up @@ -208,21 +201,27 @@ describe('Layout Designer (Populated)', function() {
cy.server();
cy.route('/region/form/edit/*').as('reloadRegion');

// Open navigator edit
cy.get('#layout-navigator #edit-btn').click();

// Select the first region on navigator
cy.get('#layout-navigator [data-type="region"]:first-child').click();
cy.get('#layout-navigator-edit [data-type="region"]:first-child').click();

// Type the new name in the input
cy.get('#properties-panel input[name="name"]').clear().type('newName');
cy.get('#layout-navigator-properties-panel input[name="name"]').clear().type('newName');

// Save form
cy.get('#properties-panel button[data-action="save"]').click();
cy.get('#layout-navigator-edit-navbar button#save-btn').click();

// Should show a notification for the name change
cy.get('.toast-success').contains('newName');

// Check if the values are the same entered after reload
cy.wait('@reloadRegion').then(() => {
cy.get('#properties-panel input[name="name"]').should('have.attr', 'value').and('equal', 'newName');
// Select the first region on navigator
cy.get('#layout-navigator-edit [data-type="region"]:first-child').click();

cy.get('#layout-navigator-properties-panel input[name="name"]').should('have.attr', 'value').and('equal', 'newName');
});
});

Expand Down Expand Up @@ -387,15 +386,18 @@ describe('Layout Designer (Populated)', function() {

// Create and alias for position save and reload layout
cy.server();
cy.route('PUT', '/region/position/all/*').as('savePosition');
cy.route('/layout?layoutId=*').as('reloadLayout');
cy.route('/region/form/edit/*').as('reloadRegion');

cy.get('#layout-navigator [data-type="region"]').then(($originalRegion) => {
const regionId = $originalRegion.attr('id');

// Open navigator edit
cy.get('#layout-navigator #edit-btn').click();

// Select region
cy.get('#layout-navigator-edit-content #' + regionId).click();

// Move region 50px for each dimension
cy.get('#layout-navigator-edit-content #' + regionId).then(($movedRegion) => {

Expand All @@ -419,10 +421,10 @@ describe('Layout Designer (Populated)', function() {
.trigger('mouseup');

// Close the navigator edit
cy.get('#layout-navigator-edit #close-btn').click();
cy.get('#layout-navigator-edit #save-btn').click();

// Wait for the layout to reload
cy.wait('@savePosition');
cy.wait('@reloadRegion');
cy.reload();
cy.wait('@reloadLayout');

Expand All @@ -443,23 +445,29 @@ describe('Layout Designer (Populated)', function() {
cy.server();
cy.route('/layout?layoutId=*').as('reloadLayout');

// Open navigator edit
cy.get('#layout-navigator #edit-btn').click();

// Select a region from the navigator
cy.get('#layout-navigator [data-type="region"]:first-child').click().then(($el) => {
cy.get('#layout-navigator-edit-content [data-type="region"]:first-child').click().then(($el) => {

const regionId = $el.attr('id');

// Click trash container
cy.get('#layout-editor-toolbar a#trashContainer').click();
cy.get('#layout-navigator-edit-navbar button#delete-btn').click();

// Confirm delete on modal
cy.get('[data-test="deleteObjectModal"] button[data-bb-handler="confirm"]').click();
cy.get('[data-test="deleteRegionModal"] button[data-bb-handler="confirm"]').click();

// Check toast message
cy.get('.toast-success').contains('Deleted');

// Wait for the layout to reload
cy.wait('@reloadLayout');

// Close navigator edit
cy.get('#layout-navigator-edit #close-btn').click();

// Check that region is not on timeline
cy.get('#layout-timeline [data-type="region"]#' + regionId).should('not.exist');
});
Expand Down Expand Up @@ -585,11 +593,11 @@ describe('Layout Designer (Populated)', function() {
cy.get('#layout-viewer #fs-btn').click();

// Viewer should have a fullscreen class, and click play
cy.get('#layout-viewer.fullscreen #play-btn').click();
cy.get('#layout-viewer-container.fullscreen #layout-viewer #play-btn').click();


// Check if the fullscreen iframe has a scr for preview layout
cy.get('#layout-viewer.fullscreen iframe').should('have.attr', 'src').and('include', '/layout/preview/');
cy.get('#layout-viewer-container.fullscreen #layout-viewer iframe').should('have.attr', 'src').and('include', '/layout/preview/');
});

it('loops through widgets in the viewer', () => {
Expand Down
6 changes: 5 additions & 1 deletion cypress/integration/layout_designer_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -290,12 +290,16 @@ describe('Layout Designer (Empty)', function() {

// Close the navigator edit
cy.get('#layout-navigator-edit #close-btn').click({force: true});


// Check if there are 2 regions in the timeline ( there was 1 by default )
cy.get('#layout-timeline [data-type="region"]').should('be.visible').should('have.length', 2);

// Wait for the layout to reload
cy.wait('@reloadLayout');

// Click the revert button
cy.get('#layout-editor-toolbar #undoContainer').click();
cy.get('#layout-editor-toolbar #undoContainer').click({force: true});

// Wait for the layout to reload
cy.wait('@reloadLayout').then(() => {
Expand Down
43 changes: 25 additions & 18 deletions cypress/integration/layout_view_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ describe('Layout View', function() {
cy.visit('/layout/view');
});

it('create a new layout', function() {
it('should create a new layout and be redirected to the layout designer', function() {

cy.get('a[href="/layout/form/add"]').click();

Expand All @@ -21,35 +21,42 @@ describe('Layout View', function() {
cy.get('.modal-dialog').contains('Save').click();

cy.get('#layout-editor');

});

it('search and delete existing layout', function() {
it('searches and delete existing layout', function() {

cy.server();
cy.route('/layout?draw=*').as('layoutGridLoad');
cy.route('DELETE', '/layout/*').as('deleteLayout');

// Filter for the created layout
cy.get('#Filter input[name="layout"]')
.type(this.layout_view_test_layout);
// Create random name
const uuid = Cypress._.random(0, 1e9);

// Create a new layout and go to the layout's designer page, then load toolbar prefs
cy.createLayout(uuid).as('testLayoutId').then((res) => {

// Filter for the created layout
cy.get('#Filter input[name="layout"]')
.type(uuid);

// Wait for the filter to make effect
cy.wait(2000);
cy.wait('@layoutGridLoad');

// Wait for the filter to make effect
cy.wait(2000);
cy.wait('@layoutGridLoad');
// Click on the first row element to open the designer
cy.get('#layouts tr:first-child .dropdown-toggle').click();

// Click on the first row element to open the designer
cy.get('#layouts tr:first-child .dropdown-toggle').click();
cy.get('#layouts tr:first-child .layout_button_delete').click();

cy.get('#layouts tr:first-child .layout_button_delete').click();
// Delete test layout
cy.get('.bootbox .save-button').click();

// Delete test layout
cy.get('.bootbox .save-button').click();
// Wait for the widget to save
cy.wait('@deleteLayout');

// Wait for the widget to save
cy.wait('@deleteLayout');
// Check if layout is deleted in toast message
cy.get('.toast').contains('Deleted ' + uuid);
});

// Check if layout is deleted in toast message
cy.get('.toast').contains('Deleted ' + this.layout_view_test_layout);
});
});
2 changes: 1 addition & 1 deletion cypress/integration/unauthed_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ describe('Unauthenticated CMS access', function () {

cy.url().should('include', '/login');

cy.contains('Version 2.0.1');
cy.contains('Version 2.0.2');
});

it('should redirect to login when an authenticated page is requested', function() {
Expand Down
11 changes: 3 additions & 8 deletions db/migrations/20180130073838_install_migration.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ private function addStructure()
$settings
->addColumn('setting', 'string', ['limit' => 50])
->addColumn('type', 'string', ['limit' => 50])
->addColumn('title', 'string', ['limit' => 50])
->addColumn('title', 'string', ['limit' => 254])
->addColumn('value', 'string', ['limit' => 1000])
->addColumn('default', 'string', ['limit' => 1000])
->addColumn('fieldType', 'string', ['limit' => 24])
Expand Down Expand Up @@ -282,7 +282,7 @@ private function addStructure()
->addColumn('viewPath', 'string', ['limit' => 254, 'default' => '../modules'])
->addColumn('class', 'string', ['limit' => 254])
->addColumn('defaultDuration', 'integer')
->addColumn('installName', 'string', ['limit' => 254])
->addColumn('installName', 'string', ['limit' => 254, 'default' => null, 'null' => true])
->save();

// Media Table
Expand Down Expand Up @@ -486,11 +486,6 @@ private function addStructure()
->addColumn('endTime', 'string', ['limit' => 8, 'default' => '00:00:00'])
->addColumn('exceptions', 'text', ['default' => null, 'null' => true])
->addForeignKey('userId', 'user', 'userId')
// Get 1 and 2 ID's reserved for Always and Custom
->insert([
['dayPartId' => 1, 'name' => 'Always', 'userId' => 1],
['dayPartId' => 2, 'name' => 'Custom', 'userId' => 1]
])
->save();

// Schedule
Expand Down Expand Up @@ -653,7 +648,7 @@ private function addStructure()
$pages = $this->table('pages', ['id' => 'pageId']);
$pages
->addColumn('name', 'string', ['limit' => 50])
->addColumn('title', 'string', ['limit' => 50])
->addColumn('title', 'string', ['limit' => 100])
->addColumn('asHome', 'integer', ['limit' => \Phinx\Db\Adapter\MysqlAdapter::INT_TINY, 'default' => 0])
->insert([
['pageId' => 1, 'name' => 'dashboard', 'title' => 'Dashboard', 'asHome' => 1],
Expand Down
33 changes: 33 additions & 0 deletions docker-compose-mysql-5.7.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
version: "3"

services:
db:
image: mysql:5.7
ports:
- 3315:3306
volumes:
- ./containers/db57:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: "root"
MYSQL_DATABASE: "cms"

xmr:
image: xibosignage/xibo-xmr:release-0.7
ports:
- "9505:9505"
environment:
XMR_DEBUG: "true"
IPV6RESPSUPPORT: "false"
IPV6PUBSUPPORT: "false"

web:
build:
context: .
dockerfile: Dockerfile.dev
volumes:
- ./:/var/www/cms
ports:
- "80:80"
environment:
CMS_DEV_MODE: "true"
MYSQL_DATABASE: "cms"
2 changes: 1 addition & 1 deletion lib/Controller/DataSet.php
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,7 @@ public function copyForm($dataSetId)
* name="copyRows",
* in="formData",
* description="Flag whether to copy all the row data from the original dataSet",
* type="int",
* type="integer",
* required=false
* ),
* @SWG\Response(
Expand Down
2 changes: 1 addition & 1 deletion lib/Controller/DataSetRss.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public function displayPage($dataSetId)
* description="successful operation",
* @SWG\Schema(
* type="array",
* @SWG\Items(ref="#/definitions/DataSetFeed")
* @SWG\Items(ref="#/definitions/DataSetRss")
* )
* )
* )
Expand Down
5 changes: 0 additions & 5 deletions lib/Controller/Display.php
Original file line number Diff line number Diff line change
Expand Up @@ -1430,11 +1430,6 @@ public function validateDisplays($displays)
$display->loggedIn = 0;
$display->save(\Xibo\Entity\Display::$saveOptionsMinimum);

// We put it back again (in memory only)
// this is then used to indicate whether or not this is the first time this display has gone
// offline (for anything that uses the timedOutDisplays return
$display->loggedIn = 1;

// Log the down event
$event = $this->displayEventFactory->createEmpty();
$event->displayId = $display->displayId;
Expand Down
Loading

0 comments on commit 420d70f

Please sign in to comment.