Skip to content

Commit

Permalink
Merge branch 'maintenance-3.1.x' into 2023-snapshot-gnerate
Browse files Browse the repository at this point in the history
  • Loading branch information
alokhyland authored Jun 10, 2024
2 parents e1b78ff + 0f5c438 commit 38b0fc8
Show file tree
Hide file tree
Showing 20 changed files with 87 additions and 43 deletions.
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.8-SNAPSHOT
NUXEO_WEB_UI_VERSION=3.1.10-SNAPSHOT
NUXEO_VERSION=master
NUXEO_PACKAGES=nuxeo-drive nuxeo-liveconnect nuxeo-template-rendering
NUXEO_DEV_MODE=true
Expand Down
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.8-SNAPSHOT
version: 3.1.10-SNAPSHOT
19 changes: 16 additions & 3 deletions elements/nuxeo-data-grid/nuxeo-document-grid-thumbnail.js
Original file line number Diff line number Diff line change
Expand Up @@ -271,13 +271,26 @@ Polymer({
observers: ['_selectedItemsChanged(selectedItems.splices)'],

_thumbnail(doc) {
return doc &&
if (
doc &&
doc.uid &&
doc.contextParameters &&
doc.contextParameters.thumbnail &&
doc.contextParameters.thumbnail.url
? doc.contextParameters.thumbnail.url
: '';
) {
if (!this.isFollowRedirectEnabled()) {
const splitter = doc.contextParameters.thumbnail.url.indexOf('?') > -1 ? '&' : '?';
doc.contextParameters.thumbnail.url = `${doc.contextParameters.thumbnail.url}${splitter}clientReason=view`;
}
return doc.contextParameters.thumbnail.url;
}
return '';
},

isFollowRedirectEnabled() {
const followRedirect =
Nuxeo && Nuxeo.UI && Nuxeo.UI.config && Nuxeo.UI.config.url && Nuxeo.UI.config.url.followRedirect;
return followRedirect ? String(followRedirect).toLowerCase() === 'true' : false;
},

handleClick(e) {
Expand Down
19 changes: 16 additions & 3 deletions elements/nuxeo-data-list/nuxeo-document-list-item.js
Original file line number Diff line number Diff line change
Expand Up @@ -256,13 +256,26 @@ Polymer({
observers: ['_selectedItemsChanged(selectedItems.splices)'],

_thumbnail(doc) {
return doc &&
if (
doc &&
doc.uid &&
doc.contextParameters &&
doc.contextParameters.thumbnail &&
doc.contextParameters.thumbnail.url
? doc.contextParameters.thumbnail.url
: '';
) {
if (!this.isFollowRedirectEnabled()) {
const splitter = doc.contextParameters.thumbnail.url.indexOf('?') > -1 ? '&' : '?';
doc.contextParameters.thumbnail.url = `${doc.contextParameters.thumbnail.url}${splitter}clientReason=view`;
}
return doc.contextParameters.thumbnail.url;
}
return '';
},

isFollowRedirectEnabled() {
const followRedirect =
Nuxeo && Nuxeo.UI && Nuxeo.UI.config && Nuxeo.UI.config.url && Nuxeo.UI.config.url.followRedirect;
return followRedirect ? String(followRedirect).toLowerCase() === 'true' : false;
},

handleClick(e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ import { config } from '@nuxeo/nuxeo-elements';
import { FormatBehavior } from '@nuxeo/nuxeo-ui-elements/nuxeo-format-behavior.js';
import { RoutingBehavior } from '@nuxeo/nuxeo-ui-elements/nuxeo-routing-behavior.js';

let schemaFetcher = null;

/**
* `Nuxeo.DocumentCreationBehavior`
*
Expand Down Expand Up @@ -78,24 +76,34 @@ export const DocumentCreationBehavior = [
subtypes: {
type: Array,
},

_resource: {
type: Object,
readOnly: true,
},
},

get resource() {
if (!this._resource) {
this._set_resource(document.createElement('nuxeo-resource'));
this.shadowRoot.appendChild(this._resource);
}
return this._resource;
},

observers: ['_validateLocation(isValidTargetPath,suggesterChildren)', '_updateDocument(selectedDocType, parent)'],

newDocument(type, properties) {
if (!schemaFetcher) {
schemaFetcher = document.createElement('nuxeo-resource');
this.shadowRoot.appendChild(schemaFetcher);
}
schemaFetcher.path = `path/${this.targetPath}/@emptyWithDefault`;
schemaFetcher.params = { type: this.selectedDocType.type };
schemaFetcher.headers = {
const { resource } = this;
resource.path = `path/${this.targetPath}/@emptyWithDefault`;
resource.params = { type: this.selectedDocType.type };
resource.headers = {
properties: '*',
'fetch-document': 'properties',
'translate-directoryEntry': 'label',
};
schemaFetcher.enrichers = config.get('enrichers', {});
return schemaFetcher.get().then((doc) => {
resource.enrichers = config.get('enrichers', {});
return resource.get().then((doc) => {
if (properties) {
Object.keys(properties).forEach((prop) => {
doc.properties[prop] = properties[prop];
Expand Down
1 change: 0 additions & 1 deletion elements/routing.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ function _routeAdmin(selectedAdminTab, errorPath, routeData) {
app.showError(404, '', errorPath);
}
}

// Routes
page('*', scrollToTop, (ctx, next) => {
next();
Expand Down
4 changes: 2 additions & 2 deletions ftest/features/preview.feature
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,5 @@ Feature: Content Preview
| sample.mp4 | nuxeo-video-viewer |
| sample.mp3 | audio |
| sample.pdf | nuxeo-pdf-viewer |
| sample.odt | object |
| sample.txt | object |
| sample.odt | nuxeo-pdf-viewer |
| sample.txt | nuxeo-pdf-viewer |
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.8-SNAPSHOT</version>
<version>3.1.10-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

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.8-SNAPSHOT",
"version": "3.1.10-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.8-rc",
"@nuxeo/testing-helpers": "~3.1.10-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.8-rc",
"@nuxeo/nuxeo-elements": "~3.1.8-rc",
"@nuxeo/nuxeo-ui-elements": "~3.1.8-rc",
"@nuxeo/nuxeo-dataviz-elements": "~3.1.10-rc",
"@nuxeo/nuxeo-elements": "~3.1.10-rc",
"@nuxeo/nuxeo-ui-elements": "~3.1.10-rc",
"@nuxeo/page": "^1.11.4-nx.0",
"@polymer/app-layout": "^3.1.0",
"@polymer/iron-a11y-announcer": "^3.2.0",
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.8-SNAPSHOT",
"version": "3.1.10-SNAPSHOT",
"bin": {
"nuxeo-web-ui-ftest": "./bin/nuxeo-web-ui-ftest.js"
},
Expand Down
17 changes: 12 additions & 5 deletions packages/nuxeo-web-ui-ftest/pages/ui/group.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,17 @@ export default class Group extends BasePage {
}

async searchResult(searchTerm) {
const ele = await this.el;
await driver.pause(1000);
const results = await ele.elements('nuxeo-card[name="groups"] .table [name="id"]');
const match = await results.find(async (e) => (await e.getText()) === searchTerm);
return match;
let matchedElements;
const match = async (e) => {
const currentText = await e.getText();
return currentText === searchTerm;
};
await driver.waitUntil(async () => {
matchedElements = await this.el.elements('nuxeo-card[name="groups"] .table [name="id"]');
const results = await matchedElements.some(match);
return results;
});

return matchedElements.find(match);
}
}
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.8-SNAPSHOT</version>
<version>3.1.10-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

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.8-SNAPSHOT</version>
<version>3.1.10-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.8-SNAPSHOT</version>
<version>3.1.10-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.8-SNAPSHOT</version>
<version>3.1.10-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion plugin/web-ui/addon/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.8-SNAPSHOT</version>
<version>3.1.10-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,13 @@
to="nuxeo.war/ui/i18n/messages-es.json" />
<copy from="nuxeo.war/ui/i18n/messages-pt-PT.json"
to="nuxeo.war/ui/i18n/messages-pt.json" />
<copy from="nuxeo.war/ui/i18n/messages-sv-SE.json"
to="nuxeo.war/ui/i18n/messages-sv.json" />
<!-- Add fallback to four-letter locales -->
<copy from="nuxeo.war/ui/i18n/messages-fr.json"
to="nuxeo.war/ui/i18n/messages-fr-FR.json" />
<copy from="nuxeo.war/ui/i18n/messages-fr.json"
to="nuxeo.war/ui/i18n/messages-fr-CA.json" />
</install>

<extension target="web#STD-AUTH-FILTER">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
<!-- S3 Direct upload -->
<property name="org.nuxeo.web.ui.s3.useDirectUpload">${nuxeo.s3storage.useDirectUpload:=false}</property>


<!-- Redirect to final download url -->
<property name="org.nuxeo.web.ui.url.followRedirect">${org.nuxeo.download.url.follow.redirect:=false}</property>

Expand All @@ -51,5 +50,6 @@

<!-- Properties to be fetched when loading the user object in user management, default is empty -->
<property name="org.nuxeo.web.ui.user.management.fetch.document" list="true"></property>

</extension>
</component>
</component>
2 changes: 1 addition & 1 deletion plugin/web-ui/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.8-SNAPSHOT</version>
<version>3.1.10-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<packaging>pom</packaging>
<name>Nuxeo Web UI - Parent</name>
<description>Nuxeo Web UI - Parent</description>
<version>3.1.8-SNAPSHOT</version>
<version>3.1.10-SNAPSHOT</version>

<properties>
<nuxeo.target.version>2023.*</nuxeo.target.version>
Expand Down

0 comments on commit 38b0fc8

Please sign in to comment.