diff --git a/.env.sample b/.env.sample index 56b685211f..fd4f795504 100644 --- a/.env.sample +++ b/.env.sample @@ -1,4 +1,4 @@ -NUXEO_WEB_UI_VERSION=3.1.10-SNAPSHOT +NUXEO_WEB_UI_VERSION=3.1.11-SNAPSHOT NUXEO_VERSION=master NUXEO_PACKAGES=nuxeo-drive nuxeo-liveconnect nuxeo-template-rendering NUXEO_DEV_MODE=true diff --git a/charts/preview/Chart.yaml b/charts/preview/Chart.yaml index dda35ad3a7..1780632f37 100644 --- a/charts/preview/Chart.yaml +++ b/charts/preview/Chart.yaml @@ -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.10-SNAPSHOT +version: 3.1.11-SNAPSHOT diff --git a/elements/nuxeo-document-actions/nuxeo-document-form-button.js b/elements/nuxeo-document-actions/nuxeo-document-form-button.js index 2f5e1743ce..6163dec416 100644 --- a/elements/nuxeo-document-actions/nuxeo-document-form-button.js +++ b/elements/nuxeo-document-actions/nuxeo-document-form-button.js @@ -142,6 +142,7 @@ Polymer({ _openDialog() { this.dialog.open(); + this.fire('dialog-opened'); }, _closeDialog() { diff --git a/elements/routing.js b/elements/routing.js index 1c3037cce8..6585010dea 100644 --- a/elements/routing.js +++ b/elements/routing.js @@ -27,36 +27,6 @@ function scrollToTop(ctx, next) { next(); } -function createUrlFromString(str) { - const httpRegex = /^https?:\/\//; - const wwwRegex = /www\./; - str = httpRegex.test(str) ? str : `http://${str}`; - str = wwwRegex.test(str) ? str : str.replace(/^(https?:\/\/)?/, '$1www.'); - return str; -} - -function isTrustedDomain(path) { - const trustedDomains = Nuxeo && Nuxeo.UI && Nuxeo.UI.config && Nuxeo.UI.config.trustedDomains; - if (!trustedDomains) return true; - const modifiedPathUrl = createUrlFromString(path); - const pathUrl = new URL(modifiedPathUrl); - const { hostname: userHostName } = pathUrl; - const trustedDomainList = trustedDomains.split(','); - const isValidUrl = trustedDomainList.some((url) => { - const updatedUrl = createUrlFromString(url); - const { hostname: currentUrlHostName } = new URL(updatedUrl); - return currentUrlHostName?.toLowerCase() === userHostName?.toLowerCase(); - }); - return isValidUrl; -} - -function encodeQueryParams(path) { - const pathUrl = new URL(path); - const queryParams = pathUrl.search.split('?')[1]; - const encodepath = queryParams ? `${pathUrl.origin}?${encodeURIComponent(queryParams)}` : path; - return encodepath; -} - function _routeAdmin(selectedAdminTab, errorPath, routeData) { const hasPermission = app.currentUser.isAdministrator || app.currentUser.extendedGroups.find((grp) => grp.name === 'powerusers'); @@ -226,13 +196,7 @@ app.router = { } const isFullpath = /^http(s)?:\/\//.test(path); if (isFullpath) { - const isValidUrl = isTrustedDomain(path); - if (isValidUrl) { - const encodepath = encodeQueryParams(path); - const link = document.createElement('a'); - link.setAttribute('href', encodepath); - link.click(); - } + window.location = path; } else { page(path); } diff --git a/elements/search/nuxeo-search-form.js b/elements/search/nuxeo-search-form.js index f0b3058310..dee36f56d0 100644 --- a/elements/search/nuxeo-search-form.js +++ b/elements/search/nuxeo-search-form.js @@ -43,6 +43,7 @@ import { Polymer } from '@polymer/polymer/lib/legacy/polymer-fn.js'; import { html } from '@polymer/polymer/lib/utils/html-tag.js'; import { Debouncer } from '@polymer/polymer/lib/utils/debounce.js'; import { timeOut } from '@polymer/polymer/lib/utils/async.js'; +import { FormatBehavior } from '@nuxeo/nuxeo-ui-elements/nuxeo-format-behavior.js'; /** `nuxeo-search-form` @@ -431,7 +432,7 @@ Polymer({ `, is: 'nuxeo-search-form', - behaviors: [NotifyBehavior, I18nBehavior, RoutingBehavior, IronResizableBehavior], + behaviors: [NotifyBehavior, I18nBehavior, RoutingBehavior, IronResizableBehavior, FormatBehavior], importMeta: import.meta, properties: { @@ -489,7 +490,7 @@ Polymer({ */ headers: { type: Object, - value: { 'fetch-document': 'properties', 'translate-directoryEntry': 'label' }, + value: { 'fetch-document': 'properties', 'fetch-directoryEntry': 'parent', 'translate-directoryEntry': 'label' }, }, /** * The schemas passed on to `provider` (like `dublincore`, `uid`, `file`...). @@ -554,9 +555,14 @@ Polymer({ const value = params[param]; if (value !== null && param !== 'dc:title') { if (modifyPayload && Array.isArray(value)) { - result[param] = value.map((item) => - item && item['entity-type'] ? item.uid || `${item.properties.parent}/${item.id}` : item, - ); + result[param] = value.map((item) => { + let output = item.id ? item.id : item; + while (item && item.properties && item.properties.parent) { + output = `${item.properties.parent.id}`.concat('/', `${output}`); + item = item.properties.parent; + } + return output; + }); } else { result[param] = typeof value === 'boolean' ? value.toString() : value; } @@ -814,6 +820,17 @@ Polymer({ }, _search() { + if (this.form && this.form.searchTerm) { + this.set('params.ecm_fulltext', this.formatFulltext(this.form.searchTerm)); + this.set( + 'params.highlight', + 'dc:title.fulltext,ecm:binarytext,dc:description.fulltext,ecm:tag,note:note.fulltext,file:content.name', + ); + } else if (this.params && this.params.ecm_fulltext) { + this.set('params.ecm_fulltext', ''); + delete this.params.ecm_fulltext; + delete this.params.highlight; + } if (this.results && this._validate()) { this.results.reset(); return this._fetch(this.results).then(this._navigateToResults.bind(this)); diff --git a/ftest/pom.xml b/ftest/pom.xml index c281056684..674a0dfb56 100644 --- a/ftest/pom.xml +++ b/ftest/pom.xml @@ -4,7 +4,7 @@ org.nuxeo.web.ui nuxeo-web-ui-parent - 3.1.10-SNAPSHOT + 3.1.11-SNAPSHOT ../pom.xml diff --git a/package.json b/package.json index 9494e04180..8ff69e2449 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "repository": "nuxeo/nuxeo-web-ui.git", "homepage": "http://www.nuxeo.com", "name": "@nuxeo/nuxeo-web-ui", - "version": "3.1.10-SNAPSHOT", + "version": "3.1.11-SNAPSHOT", "license": "Apache-2.0", "vendor": "Nuxeo", "engines": { @@ -14,7 +14,7 @@ }, "devDependencies": { "@nuxeo/nuxeo-web-ui-ftest": "file:./packages/nuxeo-web-ui-ftest", - "@nuxeo/testing-helpers": "~3.1.10-rc", + "@nuxeo/testing-helpers": "~3.1.11-rc", "@open-wc/eslint-config": "^0.3.0", "@open-wc/karma-esm": "^2.13.21", "@open-wc/prettier-config": "^0.1.0", @@ -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.10-rc", - "@nuxeo/nuxeo-elements": "~3.1.10-rc", - "@nuxeo/nuxeo-ui-elements": "~3.1.10-rc", + "@nuxeo/nuxeo-dataviz-elements": "~3.1.11-rc", + "@nuxeo/nuxeo-elements": "~3.1.11-rc", + "@nuxeo/nuxeo-ui-elements": "~3.1.11-rc", "@nuxeo/page": "^1.11.4-nx.0", "@polymer/app-layout": "^3.1.0", "@polymer/iron-a11y-announcer": "^3.2.0", diff --git a/packages/nuxeo-web-ui-ftest/package.json b/packages/nuxeo-web-ui-ftest/package.json index 5976d575e0..72b9ad506c 100644 --- a/packages/nuxeo-web-ui-ftest/package.json +++ b/packages/nuxeo-web-ui-ftest/package.json @@ -1,6 +1,6 @@ { "name": "@nuxeo/nuxeo-web-ui-ftest", - "version": "3.1.10-SNAPSHOT", + "version": "3.1.11-SNAPSHOT", "bin": { "nuxeo-web-ui-ftest": "./bin/nuxeo-web-ui-ftest.js" }, diff --git a/plugin/a11y/pom.xml b/plugin/a11y/pom.xml index b8cdd510df..ddad35d2a9 100644 --- a/plugin/a11y/pom.xml +++ b/plugin/a11y/pom.xml @@ -4,7 +4,7 @@ org.nuxeo.web.ui nuxeo-web-ui-parent - 3.1.10-SNAPSHOT + 3.1.11-SNAPSHOT ../../pom.xml diff --git a/plugin/itests/addon/pom.xml b/plugin/itests/addon/pom.xml index 523daeebb3..10b4eb6ae4 100644 --- a/plugin/itests/addon/pom.xml +++ b/plugin/itests/addon/pom.xml @@ -4,7 +4,7 @@ org.nuxeo.web.ui nuxeo-web-ui-parent - 3.1.10-SNAPSHOT + 3.1.11-SNAPSHOT ../../../pom.xml diff --git a/plugin/itests/marketplace/pom.xml b/plugin/itests/marketplace/pom.xml index 3f9d6fb330..900b2c0d20 100644 --- a/plugin/itests/marketplace/pom.xml +++ b/plugin/itests/marketplace/pom.xml @@ -3,7 +3,7 @@ org.nuxeo.web.ui nuxeo-web-ui-parent - 3.1.10-SNAPSHOT + 3.1.11-SNAPSHOT ../../../pom.xml diff --git a/plugin/metrics/pom.xml b/plugin/metrics/pom.xml index b08673916b..a664ab68a6 100644 --- a/plugin/metrics/pom.xml +++ b/plugin/metrics/pom.xml @@ -4,7 +4,7 @@ org.nuxeo.web.ui nuxeo-web-ui-parent - 3.1.10-SNAPSHOT + 3.1.11-SNAPSHOT ../../pom.xml diff --git a/plugin/web-ui/addon/pom.xml b/plugin/web-ui/addon/pom.xml index dd39d1bbdf..06d8558dea 100644 --- a/plugin/web-ui/addon/pom.xml +++ b/plugin/web-ui/addon/pom.xml @@ -3,7 +3,7 @@ org.nuxeo.web.ui nuxeo-web-ui-parent - 3.1.10-SNAPSHOT + 3.1.11-SNAPSHOT ../../../pom.xml diff --git a/plugin/web-ui/addon/src/main/resources/OSGI-INF/web-ui-properties.xml b/plugin/web-ui/addon/src/main/resources/OSGI-INF/web-ui-properties.xml index 8c14b3ed55..cf0b597912 100644 --- a/plugin/web-ui/addon/src/main/resources/OSGI-INF/web-ui-properties.xml +++ b/plugin/web-ui/addon/src/main/resources/OSGI-INF/web-ui-properties.xml @@ -51,8 +51,5 @@ - - ${org.nuxeo.web.ui.trustedDomains:=''} - \ No newline at end of file diff --git a/plugin/web-ui/marketplace/pom.xml b/plugin/web-ui/marketplace/pom.xml index 96e57a42c8..cdaa108ece 100644 --- a/plugin/web-ui/marketplace/pom.xml +++ b/plugin/web-ui/marketplace/pom.xml @@ -3,7 +3,7 @@ org.nuxeo.web.ui nuxeo-web-ui-parent - 3.1.10-SNAPSHOT + 3.1.11-SNAPSHOT ../../../pom.xml diff --git a/pom.xml b/pom.xml index ef40ec9dd4..cb63faad96 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ pom Nuxeo Web UI - Parent Nuxeo Web UI - Parent - 3.1.10-SNAPSHOT + 3.1.11-SNAPSHOT 2023.*