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

WEBUI-1625 : Merge latest changes from 3.1.x to lts-2025 #2402

Merged
merged 12 commits into from
Jan 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .env.sample
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
NUXEO_WEB_UI_VERSION=3.1.14-SNAPSHOT
NUXEO_WEB_UI_VERSION=3.1.16-SNAPSHOT
NUXEO_VERSION=master
NUXEO_PACKAGES=nuxeo-drive nuxeo-liveconnect nuxeo-template-rendering
NUXEO_DEV_MODE=true
Expand Down
5 changes: 3 additions & 2 deletions addons/nuxeo-csv/elements/nuxeo-document-import-csv.js
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ Polymer({
<template is="dom-if" if="[[!hasFile]]">
<div class="vertical layout center center-justified flex">
<div class="dropzone-label horizontal layout center center-justified">
<a href="javascript:undefined" on-tap="_showUploadDialog"> [[i18n('csv.import.clickOrDrop')]]</a>
<a href="#" on-tap="_showUploadDialog"> [[i18n('csv.import.clickOrDrop')]]</a>
</div>
</div>
</template>
Expand Down Expand Up @@ -581,7 +581,8 @@ Polymer({
}
},

_showUploadDialog() {
_showUploadDialog(e) {
e.preventDefault();
this.$.uploadFiles.click();
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ Polymer({
is-available="{{isProviderAvailable}}"
></nuxeo-liveconnect-box-provider>
<template is="dom-if" if="[[isProviderAvailable]]">
<a href="javascript:undefined" on-tap="_openPicker">
<a href="#" on-tap="_openPicker">
<iron-icon src="[[importPath]]images/box.png"></iron-icon>
[[i18n('liveconnectImportActions.box', 'Box')]]
</a>
Expand All @@ -78,7 +78,8 @@ Polymer({
this.$.provider.updateProviderInfo();
},

_openPicker() {
_openPicker(e) {
e.preventDefault();
this.$.provider.openPicker();
},
});
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ Polymer({
is-available="{{isProviderAvailable}}"
></nuxeo-liveconnect-google-drive-provider>
<template is="dom-if" if="[[isProviderAvailable]]">
<a href="javascript:undefined" on-tap="_openPicker">
<a href="#" on-tap="_openPicker">
<iron-icon src="[[importPath]]images/google_drive.png"></iron-icon>
[[i18n('liveconnectImportActions.googledrive', 'Google Drive')]]
</a>
Expand All @@ -78,7 +78,8 @@ Polymer({
this.$.provider.updateProviderInfo();
},

_openPicker() {
_openPicker(e) {
e.preventDefault();
this.$.provider.openPicker();
},
});
2 changes: 1 addition & 1 deletion charts/preview/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ apiVersion: v1
description: A Helm chart for Web UI preview
icon: https://media.licdn.com/dms/image/C4D0BAQFPXiXFrp4LBA/company-logo_200_200/0?e=2159024400&v=beta&t=RW9EU0QUciUVuPSpLySd9FtJ2yG-O37_hAAvc32f6ro
name: preview
version: 3.1.14-SNAPSHOT
version: 3.1.16-SNAPSHOT
11 changes: 8 additions & 3 deletions elements/nuxeo-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,10 @@ Polymer({
value: '52px',
},

sidebarWidth: {
type: String,
},

drawerOpened: {
type: Boolean,
value: false,
Expand Down Expand Up @@ -638,7 +642,7 @@ Polymer({

ready() {
this.$.drawerPanel.closeDrawer();

this.drawerWidth = this.sidebarWidth = getComputedStyle(this).getPropertyValue('--nuxeo-sidebar-width');
this.$.drawerPanel.$.drawer.addEventListener('transitionend', () => {
this.$.drawerPanel.notifyResize();
});
Expand Down Expand Up @@ -1001,7 +1005,8 @@ Polymer({
},

_openDrawer() {
this.drawerWidth = '350px';
const pixelsSuffix = 'px';
this.drawerWidth = 298 + Math.round(this.sidebarWidth.substring(0, this.sidebarWidth.length - 2)) + pixelsSuffix;
this.drawerOpened = true;
const { drawerPanel } = this.$;
if (drawerPanel.narrow) {
Expand All @@ -1017,7 +1022,7 @@ Polymer({
},

_closeDrawer() {
this.drawerWidth = '52px';
this.drawerWidth = this.sidebarWidth;
this.drawerOpened = false;
this.$.drawerPanel.closeDrawer();
this.selectedTab = '';
Expand Down
14 changes: 11 additions & 3 deletions elements/nuxeo-results/nuxeo-results.js
Original file line number Diff line number Diff line change
Expand Up @@ -455,9 +455,17 @@ Polymer({
},

_computeCountLabel() {
return this.resultsCount < 0
? this.i18n('results.heading.count.unknown')
: this.i18n('results.heading.count', this.resultsCount);
// Fetch the property value from web-ui-properties.xml
const isNumberFormattingEnabled =
(Nuxeo && Nuxeo.UI && Nuxeo.UI.config && Nuxeo.UI.config.numberFormattingEnabled) || false;
if (this.resultsCount < 0) {
return this.i18n('results.heading.count.unknown');
}
if (isNumberFormattingEnabled) {
const formattedCount = new Intl.NumberFormat().format(this.resultsCount);
return this.i18n('results.heading.count', formattedCount);
}
return this.i18n('results.heading.count', this.resultsCount);
},

_sortOptions() {
Expand Down
10 changes: 6 additions & 4 deletions elements/nuxeo-selection/nuxeo-selection-toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ Polymer({
<span class="count" aria-live="polite">
[[i18n('selectionToolbar.selected.items', selectedItems.length)]]
</span>
<a class="selectionLink" on-tap="toogleSelectedItemsPopup" href="javascript:void(0)">
<a class="selectionLink" on-tap="toogleSelectedItemsPopup" href="#">
<span>[[i18n('selectionToolbar.display.selection')]]</span>
</a>
</template>
Expand All @@ -121,7 +121,7 @@ Polymer({
<template is="dom-if" if="[[selectAllActive]]">
<span class="count" aria-live="polite">[[i18n('selectionToolbar.selected.all', _resultsCount)]]</span>
</template>
<a class="selectionLink" on-tap="clearSelection" href="javascript:void(0)">
<a class="selectionLink" on-tap="clearSelection" href="#">
<span>[[i18n('command.clear')]]</span>
</a>
</div>
Expand Down Expand Up @@ -188,11 +188,13 @@ Polymer({
this.hidden = !this.selectedItems || this.selectedItems.length === 0;
},

toogleSelectedItemsPopup() {
toogleSelectedItemsPopup(e) {
e.preventDefault();
this.$$('#selectedItemsPopup').toggle();
},

clearSelection() {
clearSelection(e) {
e.preventDefault();
this.fire('clear-selected-items');
},
});
5 changes: 3 additions & 2 deletions elements/workflow/nuxeo-document-task.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ Polymer({
</div>
</template>
</div>
<a href="javascript:undefined" on-tap="_toggleGraphDialog" class="view-graph">[[i18n('tasks.viewGraph')]]</a>
<a href="#" on-tap="_toggleGraphDialog" class="view-graph">[[i18n('tasks.viewGraph')]]</a>
<div class="horizontal spaced">
<span>[[i18n(tasks.directive)]]</span>
</div>
Expand Down Expand Up @@ -314,7 +314,8 @@ Polymer({
.finally(() => this._setProcessing(false));
},

_toggleGraphDialog() {
_toggleGraphDialog(e) {
e.preventDefault();
this.$.graph.show();
},

Expand Down
2 changes: 1 addition & 1 deletion ftest/features/publication.feature
Original file line number Diff line number Diff line change
Expand Up @@ -156,4 +156,4 @@ Feature: Internal Publication
Then I can see the document is a publication
And I cannot see to publication pill
And I can unpublish the document
And I can see the document has 2 children
And I can see the document has 2 children
2 changes: 1 addition & 1 deletion ftest/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.nuxeo.web.ui</groupId>
<artifactId>nuxeo-web-ui-parent</artifactId>
<version>3.1.14-SNAPSHOT</version>
<version>3.1.16-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
5 changes: 5 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@
<script src="vendor/web-animations/web-animations-next-lite.min.js"></script>

<script nonce="dummy">

function generateNonce(){
return window.crypto.randomUUID().toString('base64')
}
/* eslint-disable no-var, no-unused-vars */
var Nuxeo = {
UI: {
Expand Down Expand Up @@ -128,6 +132,7 @@
hrefBase: 'elements/search/',
},
},
nonce: generateNonce()
/* analytics: {
documentDistribution: {
disableThreshold: 100, // uncomment to set the threshold value that disables the distribution analytics
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"repository": "nuxeo/nuxeo-web-ui.git",
"homepage": "http://www.nuxeo.com",
"name": "@nuxeo/nuxeo-web-ui",
"version": "3.1.14-SNAPSHOT",
"version": "3.1.16-SNAPSHOT",
"license": "Apache-2.0",
"vendor": "Nuxeo",
"engines": {
Expand All @@ -14,7 +14,7 @@
},
"devDependencies": {
"@nuxeo/nuxeo-web-ui-ftest": "file:./packages/nuxeo-web-ui-ftest",
"@nuxeo/testing-helpers": "~3.1.14-rc",
"@nuxeo/testing-helpers": "~3.1.16-rc",
"@open-wc/eslint-config": "^0.3.0",
"@open-wc/karma-esm": "^2.13.21",
"@open-wc/prettier-config": "^0.1.0",
Expand Down Expand Up @@ -109,9 +109,9 @@
"@material/mwc-snackbar": "^0.26.1",
"@nuxeo/chart-elements": "^4.0.0-nx.1",
"@nuxeo/moment": "^2.24.0-nx.0",
"@nuxeo/nuxeo-dataviz-elements": "~3.1.14-rc",
"@nuxeo/nuxeo-elements": "~3.1.14-rc",
"@nuxeo/nuxeo-ui-elements": "~3.1.14-rc",
"@nuxeo/nuxeo-dataviz-elements": "~3.1.16-rc",
"@nuxeo/nuxeo-elements": "~3.1.16-rc",
"@nuxeo/nuxeo-ui-elements": "~3.1.16-rc",
"@nuxeo/page": "^1.11.4-nx.0",
"@polymer/app-layout": "^3.1.0",
"@polymer/iron-a11y-announcer": "^3.2.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ Then(/^I can perform the following publications$/, async function(table) {
check = override ? newCount === 1 : newCount > pubCount;
}
if (check) {
pubCount = page.publicationsCount;
pubCount = await page.publicationsCount;
}
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,11 +199,14 @@ Then('I edit the results columns to show {string}', async function(heading) {
});

Then(/^I save my search as "(.+)"$/, async function(searchName) {
const saveAsButton = await this.ui.searchResults.saveSearchAsButton;
const searchResults = await this.ui.searchResults;
const saveAsButton = await searchResults.saveSearchAsButton;
await saveAsButton.waitForVisible();
await saveAsButton.click();
await this.ui.searchResults.enterInput(searchName);
const confirmSaveButton = await this.ui.searchResults.confirmSaveSearchButton;
await driver.pause(2000);
await searchResults.enterInput(searchName);
await driver.pause(2000);
const confirmSaveButton = await searchResults.confirmSaveSearchButton;
await confirmSaveButton.click();
});

Expand Down
2 changes: 1 addition & 1 deletion packages/nuxeo-web-ui-ftest/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nuxeo/nuxeo-web-ui-ftest",
"version": "3.1.14-SNAPSHOT",
"version": "3.1.16-SNAPSHOT",
"bin": {
"nuxeo-web-ui-ftest": "./bin/nuxeo-web-ui-ftest.js"
},
Expand Down
2 changes: 2 additions & 0 deletions packages/nuxeo-web-ui-ftest/pages/ui/admin/cloudServices.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@ export default class CloudServices extends BasePage {
}

async deleteClient(clientId) {
const dataTable = await driver.$('nuxeo-data-table nuxeo-data-table-row [name="id"]');
await dataTable.waitForVisible();
const rows = await browser.$$('nuxeo-data-table[name="table"] nuxeo-data-table-row:not([header])');
const deleted = await browser
.$$('nuxeo-data-table[name="table"] nuxeo-data-table-row:not([header])')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,8 @@ export default class DocumentPage extends BasePage {
}
}
if (pub) {
return parseInt(
pub
.$('div')
.getText()
.trim(),
10,
);
const pubText = await pub.$('div').getText();
return parseInt(pubText.trim(), 10);
}
}
return 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ export default class DocumentPublications extends BasePage {
let index;
for (let i = 0; i < rows.length; i++) {
const row = rows[i];
if (row.isVisible('nuxeo-data-table-cell a.path')) {
const isRowVisible = await row.isVisible('nuxeo-data-table-cell a.path');
if (isRowVisible) {
const foundPathEle = await row.$('nuxeo-data-table-cell a.path');
const foundPath = await foundPathEle.getText();
const foundPathLowerCase = await foundPath.trim().toLowerCase();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ export default class DocumentVersions extends BasePage {
return true;
}
const listItems = await this.listItems;
await listItems.$('div[name="version-item"] .title').waitForVisible();
const versionItem = await listItems.$('div[name="version-item"] .title');
await versionItem.waitForVisible();
const listItems1 = await this.listItems.$$('div[name="version-item"]');
const itemsTitle = await browser.$$('div[name="version-item"]').map((img) => img.$('.title').getText());
const index = itemsTitle.findIndex((currenTitle) => currenTitle === label);
Expand Down
5 changes: 3 additions & 2 deletions packages/nuxeo-web-ui-ftest/pages/ui/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,9 @@ export default class Search extends Results {
return dropdownElenent;
}

enterInput(text) {
return driver.keys(text);
async enterInput(text) {
const isInputEntered = await driver.keys(text);
return isInputEntered;
}

async getField(field) {
Expand Down
2 changes: 1 addition & 1 deletion packages/nuxeo-web-ui-ftest/wdio.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const capability = {
maxInstances: 1,
browserName: process.env.BROWSER,
acceptInsecureCerts: true,
browserVersion: 'stable',
browserVersion: '130.0.6723.116',
};

const options = {};
Expand Down
2 changes: 1 addition & 1 deletion plugin/a11y/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.nuxeo.web.ui</groupId>
<artifactId>nuxeo-web-ui-parent</artifactId>
<version>3.1.14-SNAPSHOT</version>
<version>3.1.16-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

Expand Down
1 change: 0 additions & 1 deletion plugin/a11y/wdio.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ const capability = {
};
const options = {
args: ['--no-sandbox'],
w3c: false,
};
if (process.env.HEADLESS) {
options.args.push('--window-size=1920,1080');
Expand Down
2 changes: 1 addition & 1 deletion plugin/itests/addon/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.nuxeo.web.ui</groupId>
<artifactId>nuxeo-web-ui-parent</artifactId>
<version>3.1.14-SNAPSHOT</version>
<version>3.1.16-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion plugin/itests/marketplace/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>org.nuxeo.web.ui</groupId>
<artifactId>nuxeo-web-ui-parent</artifactId>
<version>3.1.14-SNAPSHOT</version>
<version>3.1.16-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion plugin/metrics/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.nuxeo.web.ui</groupId>
<artifactId>nuxeo-web-ui-parent</artifactId>
<version>3.1.14-SNAPSHOT</version>
<version>3.1.16-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

Expand Down
Loading
Loading