diff --git a/.travis.yml b/.travis.yml index a768059ad..8b0fe2f95 100644 --- a/.travis.yml +++ b/.travis.yml @@ -45,3 +45,8 @@ jobs: script: npm run build.e2e && SUITE="--suite sharingContent" npm run e2e:docker - name: Test Suite viewContent&metadata&extensions script: npm run build.e2e && SUITE="--suite viewer,infoDrawer,extensions" npm run e2e:docker + +after_failure: + - alfrescoContainerId=$(docker ps -a | grep 'alfresco-content-repository-community' | awk '{print $1}') + - docker logs $alfrescoContainerId > alfresco.log + - cat alfresco.log diff --git a/build-tomcat-e2e.sh b/build-tomcat-e2e.sh index 72d2f9d75..061f8a1a4 100755 --- a/build-tomcat-e2e.sh +++ b/build-tomcat-e2e.sh @@ -3,7 +3,7 @@ npm run build.e2e -- --base-href ./ node -e " const fs = require('fs'); const config = require('./dist/app/app.config.json'); -config.baseShareUrl = 'http://localhost:4000/content-app/#/preview/s/'; +config.baseShareUrl = 'http://localhost:8080/content-app/#/preview/s/'; fs.writeFileSync( './dist/app/app.config.json', JSON.stringify(config, null, 2) diff --git a/cspell.json b/cspell.json index 1ca728ea2..bbfeb7ade 100644 --- a/cspell.json +++ b/cspell.json @@ -64,7 +64,8 @@ "denysvuika", "submenu", "submenus", - "dateitem" + "dateitem", + "versionable" ], "dictionaries": ["html", "en-gb", "en_US"] } diff --git a/docker-compose-keycloak.yml b/docker-compose-keycloak.yml index 33c21fa03..9ef10c92c 100644 --- a/docker-compose-keycloak.yml +++ b/docker-compose-keycloak.yml @@ -190,7 +190,7 @@ services: - alfresco - share ports: - - 4000:80 + - 8080:8080 auth: image: jboss/keycloak:4.8.3.Final diff --git a/docker-compose.yml b/docker-compose.yml index a513d6a42..a110f11ad 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,10 +2,10 @@ version: '2' services: alfresco: - image: alfresco/alfresco-content-repository-community:6.1.2-ga + image: alfresco/alfresco-content-repository-community:latest mem_limit: 1500m - depends_on: - - postgres + volumes: + - ./docker/acs-cm:/usr/local/tomcat/shared/classes/alfresco/extension environment: JAVA_OPTS: ' -Ddb.driver=org.postgresql.Driver @@ -17,51 +17,92 @@ services: -Dsolr.secureComms=none -Dsolr.base.url=/solr -Dindex.subsystem.name=solr6 - -Dshare.host=localhost + -Dshare.host=127.0.0.1 + -Dshare.port=8080 + -Dalfresco.host=localhost -Dalfresco.port=8080 -Daos.baseUrlOverwrite=http://localhost:8080/alfresco/aos -Dmessaging.broker.url="failover:(nio://activemq:61616)?timeout=3000&jms.useCompression=true" -Ddeployment.method=DOCKER_COMPOSE + -Dlocal.transform.service.enabled=true + -DlocalTransform.pdfrenderer.url=http://alfresco-pdf-renderer:8090/ + -DlocalTransform.imagemagick.url=http://imagemagick:8090/ + -DlocalTransform.libreoffice.url=http://libreoffice:8090/ + -DlocalTransform.tika.url=http://tika:8090/ + -DlocalTransform.misc.url=http://transform-misc:8090/ + -Dlegacy.transform.service.enabled=true + -Dalfresco-pdf-renderer.url=http://alfresco-pdf-renderer:8090/ + -Djodconverter.url=http://libreoffice:8090/ + -Dimg.url=http://imagemagick:8090/ + -Dtika.url=http://tika:8090/ + -Dtransform.misc.url=http://transform-misc:8090/ -Dcsrf.filter.enabled=false - -Xms1g -Xmx1g + -Xms1500m -Xmx1500m ' - networks: - - internal + + alfresco-pdf-renderer: + image: alfresco/alfresco-pdf-renderer:2.1.0 + mem_limit: 1g + environment: + JAVA_OPTS: ' -Xms256m -Xmx512m' ports: - - 8080:8080 #Browser port + - 8090:8090 + + imagemagick: + image: alfresco/alfresco-imagemagick:2.1.0 + mem_limit: 1g + environment: + JAVA_OPTS: ' -Xms256m -Xmx512m' + ports: + - 8091:8090 + + libreoffice: + image: alfresco/alfresco-libreoffice:2.1.0 + mem_limit: 1g + environment: + JAVA_OPTS: ' -Xms256m -Xmx512m' + ports: + - 8092:8090 + + tika: + image: alfresco/alfresco-tika:2.1.0 + mem_limit: 1g + environment: + JAVA_OPTS: ' -Xms256m -Xmx512m' + ports: + - 8093:8090 + + transform-misc: + image: alfresco/alfresco-transform-misc:2.1.0 + mem_limit: 1g + environment: + JAVA_OPTS: ' -Xms256m -Xmx512m' + ports: + - 8094:8090 share: - image: alfresco/alfresco-share:6.1.0-RC3 + image: alfresco/alfresco-share:6.2.0 mem_limit: 1g depends_on: - alfresco environment: - REPO_HOST=alfresco - REPO_PORT=8080 - - 'CATALINA_OPTS= -Xms500m -Xmx500m' - networks: - - internal - ports: - - 8083:8080 postgres: - image: postgres:10.1 - mem_limit: 1500m + image: postgres:11.4 + mem_limit: 512m environment: - POSTGRES_PASSWORD=alfresco - POSTGRES_USER=alfresco - POSTGRES_DB=alfresco command: postgres -c max_connections=300 -c log_min_messages=LOG - networks: - - internal ports: - 5432:5432 solr6: - image: alfresco/alfresco-search-services:1.3.0-RC2 - mem_limit: 2500m - depends_on: - - alfresco + image: alfresco/alfresco-search-services:1.4.0 + mem_limit: 2g environment: #Solr needs to know how to register itself with Alfresco - SOLR_ALFRESCO_HOST=alfresco @@ -71,17 +112,15 @@ services: - SOLR_SOLR_PORT=8983 #Create the default alfresco and archive cores - SOLR_CREATE_ALFRESCO_DEFAULTS=alfresco,archive + #HTTP by default + - ALFRESCO_SECURE_COMMS=none - 'SOLR_JAVA_MEM=-Xms2g -Xmx2g' - networks: - - internal ports: - - 8983:8983 #Browser port + - 8083:8983 #Browser port activemq: - image: alfresco/alfresco-activemq:5.15.6 - mem_limit: 2048m - networks: - - internal + image: alfresco/alfresco-activemq:5.15.8 + mem_limit: 1g ports: - 8161:8161 # Web Console - 5672:5672 # AMQP @@ -93,24 +132,19 @@ services: build: . depends_on: - alfresco - networks: - - internal ports: - 4001:8080 - # volumes: - # - ./app.config.json:/usr/share/nginx/html/app.config.json - # - ./nginx.conf:/etc/nginx/conf.d/default.conf proxy: - image: nginx:stable-alpine + image: alfresco/acs-community-ngnix:1.0.0 + mem_limit: 128m depends_on: - - content-app + - alfresco volumes: - - ./docker/proxy/nginx.conf:/etc/nginx/conf.d/default.conf - networks: - - internal + - ./docker/proxy/nginx.conf:/etc/nginx/nginx.conf ports: - - 4000:80 - -networks: - internal: + - 8080:8080 + links: + - alfresco + - share + - content-app diff --git a/docker/acs-cm/Readme.md b/docker/acs-cm/Readme.md new file mode 100644 index 000000000..85498dfe9 --- /dev/null +++ b/docker/acs-cm/Readme.md @@ -0,0 +1,20 @@ +# Custom Node creation instruction + +Use the v1 POST node/{nodeId}/children for creating the custom node with a payload like: + +``` +{ + "name":"acme document2.txt", + "nodeType":"acme:document", + "properties": { + "acme:documentId": "DOC001", + "acme:securityClassification":"Public", + "cm:title":"My text" + }, + "aspectNames": [ + "acme:securityClassified" + ] +} +``` + +Tip: You could use the api explorer with /api-explorer/ diff --git a/docker/acs-cm/acme-bootstrap-context.xml b/docker/acs-cm/acme-bootstrap-context.xml new file mode 100644 index 000000000..31ed7299d --- /dev/null +++ b/docker/acs-cm/acme-bootstrap-context.xml @@ -0,0 +1,13 @@ + + + + + + +alfresco/extension/acme-content-model.xml + + + + diff --git a/docker/acs-cm/acme-content-model.xml b/docker/acs-cm/acme-content-model.xml new file mode 100644 index 000000000..2ef460104 --- /dev/null +++ b/docker/acs-cm/acme-content-model.xml @@ -0,0 +1,66 @@ + + + Sample Document Model + My Name + 1.0 + + + + + + + + + + + + + + + + + Public + Client Confidential + Company Confidential + Strictly Confidential + + + + + + + + Sample Document Type + cm:content + + + Document Identification Number + d:text + + + + acme:securityClassified + + + + + + + ACME Security Classified + Content has been security classified + + + d:text + + true + false + false + + + + + + + + + diff --git a/docker/proxy/nginx.conf b/docker/proxy/nginx.conf index ebc56e11f..25f275517 100644 --- a/docker/proxy/nginx.conf +++ b/docker/proxy/nginx.conf @@ -1,33 +1,44 @@ -server { - listen *:80; +worker_processes 1; - set $allowOriginSite *; - proxy_pass_request_headers on; - proxy_pass_header Set-Cookie; +events { + worker_connections 1024; +} - access_log off; +http { + server { + listen *:8080; - proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504; - proxy_redirect off; - proxy_buffering off; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_pass_header Set-Cookie; + client_max_body_size 0; - location / { - proxy_pass http://content-app:8080; - } + set $allowOriginSite *; + proxy_pass_request_headers on; + proxy_pass_header Set-Cookie; - location /alfresco/ { - proxy_pass http://alfresco:8080; - } + # External settings, do not remove + #ENV_ACCESS_LOG - location /api-explorer/ { - proxy_pass http://alfresco:8080/api-explorer; - } + proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504; + proxy_redirect off; + proxy_buffering off; + proxy_set_header Host $host:$server_port; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_pass_header Set-Cookie; - location /share/ { - proxy_pass http://share:8080; + location / { + proxy_pass http://content-app:8080; + } + + location /alfresco/ { + proxy_pass http://alfresco:8080; + } + + location /api-explorer/ { + proxy_pass http://alfresco:8080/api-explorer/; + } + + location /share/ { + proxy_pass http://share:8080; + } } } diff --git a/docker/tomcat/docker-compose.yml b/docker/tomcat/docker-compose.yml index d5b57119c..4ce088f1d 100644 --- a/docker/tomcat/docker-compose.yml +++ b/docker/tomcat/docker-compose.yml @@ -91,7 +91,7 @@ services: networks: - internal ports: - - 4000:80 + - 8080:80 networks: - ? internal + internal: diff --git a/docs/getting-started/docker.md b/docs/getting-started/docker.md index 67c932663..90040c8a6 100644 --- a/docs/getting-started/docker.md +++ b/docs/getting-started/docker.md @@ -20,7 +20,7 @@ npm run build npm run start:docker ``` -The ACA runs on port `4000` when served from within container. +The ACA runs on port `8080` when served from within container. Use the following command to stop all the containers: diff --git a/docs/ja/getting-started/docker.md b/docs/ja/getting-started/docker.md index 4b6468e7f..9752ce18e 100644 --- a/docs/ja/getting-started/docker.md +++ b/docs/ja/getting-started/docker.md @@ -7,7 +7,7 @@ nav: ja ACA には ACS 6.0 Community 版が事前構成されています。 -アプリケーションは2つのモードで実行されます: +アプリケーションは 2 つのモードで実行されます: - Development (最新のソースコードを実行し、アプリケーションのビルドが必要) - Preview (最新の公開されたコンテナー、マスターブランチで実行) @@ -21,7 +21,7 @@ npm run build npm run start:docker ``` -コンテナ内から提供される場合、ACA は `4000` ポートで実行されます。 +コンテナ内から提供される場合、ACA は `8080` ポートで実行されます。 次のコマンドを使用して、すべてのコンテナを停止します: diff --git a/e2e/components/dialog/upload-new-version-dialog.ts b/e2e/components/dialog/upload-new-version-dialog.ts index 9ed40472f..2e88c17da 100755 --- a/e2e/components/dialog/upload-new-version-dialog.ts +++ b/e2e/components/dialog/upload-new-version-dialog.ts @@ -100,7 +100,6 @@ export class UploadNewVersionDialog extends Component { async clickUpload() { await this.uploadButton.click(); - await this.waitForDialogToClose(); } diff --git a/e2e/suites/actions/upload-new-version.test.ts b/e2e/suites/actions/upload-new-version.test.ts index 0363a68e0..3a3594679 100755 --- a/e2e/suites/actions/upload-new-version.test.ts +++ b/e2e/suites/actions/upload-new-version.test.ts @@ -52,6 +52,8 @@ describe('Upload new version', () => { const parentFav = `parentFav-${Utils.random()}`; let parentFavId; const parentSearch = `parentSearch-${Utils.random()}`; let parentSearchId; + const nameConflictMessage = 'New version not uploaded, another file with the same name already exists'; + const file = FILES.pdfFile; let fileId; const fileToUpload1 = FILES.docxFile; const fileToUpload2 = FILES.xlsxFile; @@ -116,7 +118,7 @@ describe('Upload new version', () => { }); afterEach(async (done) => { - // await Utils.pressEscape(); + await Utils.pressEscape(); await page.refresh(); done(); }); @@ -147,10 +149,11 @@ describe('Upload new version', () => { await uploadNewVersionDialog.clickMajor(); await uploadNewVersionDialog.enterDescription('new major version description'); await uploadNewVersionDialog.clickUpload(); + await uploadNewVersionDialog.waitForDialogToClose(); expect(await dataTable.isItemPresent(fileToUpload1)).toBe(true, 'File not updated'); expect(await apis.user.nodes.getFileVersionType(file1Id)).toEqual('MAJOR', 'File has incorrect version type'); - expect(await apis.user.nodes.getFileVersionLabel(file1Id)).toEqual('1.0', 'File has incorrect version label'); + expect(await apis.user.nodes.getFileVersionLabel(file1Id)).toEqual('2.0', 'File has incorrect version label'); }); it('file is updated after uploading a new version - minor - [C297546]', async () => { @@ -163,10 +166,11 @@ describe('Upload new version', () => { await uploadNewVersionDialog.clickMinor(); await uploadNewVersionDialog.enterDescription('new minor version description'); await uploadNewVersionDialog.clickUpload(); + await uploadNewVersionDialog.waitForDialogToClose(); expect(await dataTable.isItemPresent(fileToUpload2)).toBe(true, 'File not updated'); expect(await apis.user.nodes.getFileVersionType(file2Id)).toEqual('MINOR', 'File has incorrect version type'); - expect(await apis.user.nodes.getFileVersionLabel(file2Id)).toEqual('0.1', 'File has incorrect version label'); + expect(await apis.user.nodes.getFileVersionLabel(file2Id)).toEqual('1.1', 'File has incorrect version label'); }); it('file is not updated when clicking Cancel - [C297547]', async () => { @@ -181,8 +185,8 @@ describe('Upload new version', () => { await uploadNewVersionDialog.clickCancel(); expect(await dataTable.isItemPresent(file3)).toBe(true, 'File was updated'); - expect(await apis.user.nodes.getFileVersionType(file3Id)).toEqual('', 'File has incorrect version type'); - expect(await apis.user.nodes.getFileVersionLabel(file3Id)).toEqual('', 'File has incorrect version label'); + expect(await apis.user.nodes.getFileVersionType(file3Id)).toEqual('MAJOR', 'File has incorrect version type'); + expect(await apis.user.nodes.getFileVersionLabel(file3Id)).toEqual('1.0', 'File has incorrect version label'); }); it('upload new version fails when new file name already exists - [C297548]', async () => { @@ -196,11 +200,12 @@ describe('Upload new version', () => { await uploadNewVersionDialog.enterDescription('new version description'); await uploadNewVersionDialog.clickUpload(); - await page.refresh(); + const message = await page.getSnackBarMessage(); + expect(message).toContain(nameConflictMessage); expect(await dataTable.isItemPresent(file4)).toBe(true, 'File was updated'); - expect(await apis.user.nodes.getFileVersionType(file4Id)).toEqual('', 'File has incorrect version type'); - expect(await apis.user.nodes.getFileVersionLabel(file4Id)).toEqual('', 'File has incorrect version label'); + expect(await apis.user.nodes.getFileVersionType(file4Id)).toEqual('MAJOR', 'File has incorrect version type'); + expect(await apis.user.nodes.getFileVersionLabel(file4Id)).toEqual('1.0', 'File has incorrect version label'); }); it('file is unlocked after uploading a new version - [C297549]', async () => { @@ -213,11 +218,12 @@ describe('Upload new version', () => { await uploadNewVersionDialog.clickMinor(); await uploadNewVersionDialog.enterDescription('new version description'); await uploadNewVersionDialog.clickUpload(); + await uploadNewVersionDialog.waitForDialogToClose(); expect(await dataTable.isItemPresent(fileToUpload4)).toBe(true, 'File name was not changed'); expect(await apis.user.nodes.isFileLockedWrite(fileLocked1Id)).toBe(false, `${fileLocked1} is still locked`); expect(await apis.user.nodes.getFileVersionType(fileLocked1Id)).toEqual('MINOR', 'File has incorrect version type'); - expect(await apis.user.nodes.getFileVersionLabel(fileLocked1Id)).toEqual('0.1', 'File has incorrect version label'); + expect(await apis.user.nodes.getFileVersionLabel(fileLocked1Id)).toEqual('1.1', 'File has incorrect version label'); }); it('file remains locked after canceling of uploading a new version - [C297550]', async () => { @@ -294,10 +300,11 @@ describe('Upload new version', () => { await uploadNewVersionDialog.clickMajor(); await uploadNewVersionDialog.enterDescription('new major version description'); await uploadNewVersionDialog.clickUpload(); + await uploadNewVersionDialog.waitForDialogToClose(); expect(await dataTable.isItemPresent(fileToUpload1)).toBe(true, 'File not updated'); expect(await apis.user.nodes.getFileVersionType(file1Id)).toEqual('MAJOR', 'File has incorrect version type'); - expect(await apis.user.nodes.getFileVersionLabel(file1Id)).toEqual('1.0', 'File has incorrect version label'); + expect(await apis.user.nodes.getFileVersionLabel(file1Id)).toEqual('2.0', 'File has incorrect version label'); }); it('file is updated after uploading a new version - minor - [C297553]', async () => { @@ -310,10 +317,11 @@ describe('Upload new version', () => { await uploadNewVersionDialog.clickMinor(); await uploadNewVersionDialog.enterDescription('new minor version description'); await uploadNewVersionDialog.clickUpload(); + await uploadNewVersionDialog.waitForDialogToClose(); expect(await dataTable.isItemPresent(fileToUpload2)).toBe(true, 'File not updated'); expect(await apis.user.nodes.getFileVersionType(file2Id)).toEqual('MINOR', 'File has incorrect version type'); - expect(await apis.user.nodes.getFileVersionLabel(file2Id)).toEqual('0.1', 'File has incorrect version label'); + expect(await apis.user.nodes.getFileVersionLabel(file2Id)).toEqual('1.1', 'File has incorrect version label'); }); it('file is not updated when clicking Cancel - [C297554]', async () => { @@ -328,8 +336,8 @@ describe('Upload new version', () => { await uploadNewVersionDialog.clickCancel(); expect(await dataTable.isItemPresent(file3)).toBe(true, 'File was updated'); - expect(await apis.user.nodes.getFileVersionType(file3Id)).toEqual('', 'File has incorrect version type'); - expect(await apis.user.nodes.getFileVersionLabel(file3Id)).toEqual('', 'File has incorrect version label'); + expect(await apis.user.nodes.getFileVersionType(file3Id)).toEqual('MAJOR', 'File has incorrect version type'); + expect(await apis.user.nodes.getFileVersionLabel(file3Id)).toEqual('1.0', 'File has incorrect version label'); }); it('upload new version fails when new file name already exists - [C297555]', async () => { @@ -343,11 +351,12 @@ describe('Upload new version', () => { await uploadNewVersionDialog.enterDescription('new version description'); await uploadNewVersionDialog.clickUpload(); - await page.refresh(); + const message = await page.getSnackBarMessage(); + expect(message).toContain(nameConflictMessage); expect(await dataTable.isItemPresent(file4)).toBe(true, 'File was updated'); - expect(await apis.user.nodes.getFileVersionType(file4Id)).toEqual('', 'File has incorrect version type'); - expect(await apis.user.nodes.getFileVersionLabel(file4Id)).toEqual('', 'File has incorrect version label'); + expect(await apis.user.nodes.getFileVersionType(file4Id)).toEqual('MAJOR', 'File has incorrect version type'); + expect(await apis.user.nodes.getFileVersionLabel(file4Id)).toEqual('1.0', 'File has incorrect version label'); }); it('file is unlocked after uploading a new version - [C297556]', async () => { @@ -360,11 +369,12 @@ describe('Upload new version', () => { await uploadNewVersionDialog.clickMinor(); await uploadNewVersionDialog.enterDescription('new version description'); await uploadNewVersionDialog.clickUpload(); + await uploadNewVersionDialog.waitForDialogToClose(); expect(await dataTable.isItemPresent(fileToUpload4)).toBe(true, 'File name was not changed'); expect(await apis.user.nodes.isFileLockedWrite(fileLocked1Id)).toBe(false, `${fileLocked1} is still locked`); expect(await apis.user.nodes.getFileVersionType(fileLocked1Id)).toEqual('MINOR', 'File has incorrect version type'); - expect(await apis.user.nodes.getFileVersionLabel(fileLocked1Id)).toEqual('0.1', 'File has incorrect version label'); + expect(await apis.user.nodes.getFileVersionLabel(fileLocked1Id)).toEqual('1.1', 'File has incorrect version label'); }); it('file remains locked after canceling of uploading a new version - [C297557]', async () => { @@ -440,10 +450,11 @@ describe('Upload new version', () => { await uploadNewVersionDialog.clickMajor(); await uploadNewVersionDialog.enterDescription('new major version description'); await uploadNewVersionDialog.clickUpload(); + await uploadNewVersionDialog.waitForDialogToClose(); expect(await dataTable.isItemPresent(fileToUpload1, parentRF)).toBe(true, 'File not updated'); expect(await apis.user.nodes.getFileVersionType(file1Id)).toEqual('MAJOR', 'File has incorrect version type'); - expect(await apis.user.nodes.getFileVersionLabel(file1Id)).toEqual('1.0', 'File has incorrect version label'); + expect(await apis.user.nodes.getFileVersionLabel(file1Id)).toEqual('2.0', 'File has incorrect version label'); }); it('file is updated after uploading a new version - minor - [C297560]', async () => { @@ -456,10 +467,11 @@ describe('Upload new version', () => { await uploadNewVersionDialog.clickMinor(); await uploadNewVersionDialog.enterDescription('new minor version description'); await uploadNewVersionDialog.clickUpload(); + await uploadNewVersionDialog.waitForDialogToClose(); expect(await dataTable.isItemPresent(fileToUpload2, parentRF)).toBe(true, 'File not updated'); expect(await apis.user.nodes.getFileVersionType(file2Id)).toEqual('MINOR', 'File has incorrect version type'); - expect(await apis.user.nodes.getFileVersionLabel(file2Id)).toEqual('0.1', 'File has incorrect version label'); + expect(await apis.user.nodes.getFileVersionLabel(file2Id)).toEqual('1.1', 'File has incorrect version label'); }); it('file is not updated when clicking Cancel - [C297561]', async () => { @@ -474,8 +486,8 @@ describe('Upload new version', () => { await uploadNewVersionDialog.clickCancel(); expect(await dataTable.isItemPresent(file3, parentRF)).toBe(true, 'File was updated'); - expect(await apis.user.nodes.getFileVersionType(file3Id)).toEqual('', 'File has incorrect version type'); - expect(await apis.user.nodes.getFileVersionLabel(file3Id)).toEqual('', 'File has incorrect version label'); + expect(await apis.user.nodes.getFileVersionType(file3Id)).toEqual('MAJOR', 'File has incorrect version type'); + expect(await apis.user.nodes.getFileVersionLabel(file3Id)).toEqual('1.0', 'File has incorrect version label'); }); it('upload new version fails when new file name already exists - [C297562]', async () => { @@ -489,11 +501,12 @@ describe('Upload new version', () => { await uploadNewVersionDialog.enterDescription('new version description'); await uploadNewVersionDialog.clickUpload(); - await page.refresh(); + const message = await page.getSnackBarMessage(); + expect(message).toContain(nameConflictMessage); expect(await dataTable.isItemPresent(file4, parentRF)).toBe(true, 'File was updated'); - expect(await apis.user.nodes.getFileVersionType(file4Id)).toEqual('', 'File has incorrect version type'); - expect(await apis.user.nodes.getFileVersionLabel(file4Id)).toEqual('', 'File has incorrect version label'); + expect(await apis.user.nodes.getFileVersionType(file4Id)).toEqual('MAJOR', 'File has incorrect version type'); + expect(await apis.user.nodes.getFileVersionLabel(file4Id)).toEqual('1.0', 'File has incorrect version label'); }); it('file is unlocked after uploading a new version - [C297563]', async () => { @@ -506,11 +519,12 @@ describe('Upload new version', () => { await uploadNewVersionDialog.clickMinor(); await uploadNewVersionDialog.enterDescription('new version description'); await uploadNewVersionDialog.clickUpload(); + await uploadNewVersionDialog.waitForDialogToClose(); expect(await dataTable.isItemPresent(fileToUpload4, parentRF)).toBe(true, 'File name was not changed'); expect(await apis.user.nodes.isFileLockedWrite(fileLocked1Id)).toBe(false, `${fileLocked1} is still locked`); expect(await apis.user.nodes.getFileVersionType(fileLocked1Id)).toEqual('MINOR', 'File has incorrect version type'); - expect(await apis.user.nodes.getFileVersionLabel(fileLocked1Id)).toEqual('0.1', 'File has incorrect version label'); + expect(await apis.user.nodes.getFileVersionLabel(fileLocked1Id)).toEqual('1.1', 'File has incorrect version label'); }); it('file remains locked after canceling of uploading a new version - [C297564]', async () => { @@ -587,10 +601,11 @@ describe('Upload new version', () => { await uploadNewVersionDialog.clickMajor(); await uploadNewVersionDialog.enterDescription('new major version description'); await uploadNewVersionDialog.clickUpload(); + await uploadNewVersionDialog.waitForDialogToClose(); expect(await dataTable.isItemPresent(fileToUpload1)).toBe(true, 'File not updated'); expect(await apis.user.nodes.getFileVersionType(file1Id)).toEqual('MAJOR', 'File has incorrect version type'); - expect(await apis.user.nodes.getFileVersionLabel(file1Id)).toEqual('1.0', 'File has incorrect version label'); + expect(await apis.user.nodes.getFileVersionLabel(file1Id)).toEqual('2.0', 'File has incorrect version label'); }); it('file is updated after uploading a new version - minor - [C297567]', async () => { @@ -603,10 +618,11 @@ describe('Upload new version', () => { await uploadNewVersionDialog.clickMinor(); await uploadNewVersionDialog.enterDescription('new minor version description'); await uploadNewVersionDialog.clickUpload(); + await uploadNewVersionDialog.waitForDialogToClose(); expect(await dataTable.isItemPresent(fileToUpload2)).toBe(true, 'File not updated'); expect(await apis.user.nodes.getFileVersionType(file2Id)).toEqual('MINOR', 'File has incorrect version type'); - expect(await apis.user.nodes.getFileVersionLabel(file2Id)).toEqual('0.1', 'File has incorrect version label'); + expect(await apis.user.nodes.getFileVersionLabel(file2Id)).toEqual('1.1', 'File has incorrect version label'); }); it('file is not updated when clicking Cancel - [C297568]', async () => { @@ -621,8 +637,8 @@ describe('Upload new version', () => { await uploadNewVersionDialog.clickCancel(); expect(await dataTable.isItemPresent(file3)).toBe(true, 'File was updated'); - expect(await apis.user.nodes.getFileVersionType(file3Id)).toEqual('', 'File has incorrect version type'); - expect(await apis.user.nodes.getFileVersionLabel(file3Id)).toEqual('', 'File has incorrect version label'); + expect(await apis.user.nodes.getFileVersionType(file3Id)).toEqual('MAJOR', 'File has incorrect version type'); + expect(await apis.user.nodes.getFileVersionLabel(file3Id)).toEqual('1.0', 'File has incorrect version label'); }); it('upload new version fails when new file name already exists - [C297569]', async () => { @@ -636,11 +652,12 @@ describe('Upload new version', () => { await uploadNewVersionDialog.enterDescription('new version description'); await uploadNewVersionDialog.clickUpload(); - await page.refresh(); + const message = await page.getSnackBarMessage(); + expect(message).toContain(nameConflictMessage); expect(await dataTable.isItemPresent(file4)).toBe(true, 'File was updated'); - expect(await apis.user.nodes.getFileVersionType(file4Id)).toEqual('', 'File has incorrect version type'); - expect(await apis.user.nodes.getFileVersionLabel(file4Id)).toEqual('', 'File has incorrect version label'); + expect(await apis.user.nodes.getFileVersionType(file4Id)).toEqual('MAJOR', 'File has incorrect version type'); + expect(await apis.user.nodes.getFileVersionLabel(file4Id)).toEqual('1.0', 'File has incorrect version label'); }); it('file is unlocked after uploading a new version - [C297570]', async () => { @@ -653,11 +670,12 @@ describe('Upload new version', () => { await uploadNewVersionDialog.clickMinor(); await uploadNewVersionDialog.enterDescription('new version description'); await uploadNewVersionDialog.clickUpload(); + await uploadNewVersionDialog.waitForDialogToClose(); expect(await dataTable.isItemPresent(fileToUpload4)).toBe(true, 'File name was not changed'); expect(await apis.user.nodes.isFileLockedWrite(fileLocked1Id)).toBe(false, `${fileLocked1} is still locked`); expect(await apis.user.nodes.getFileVersionType(fileLocked1Id)).toEqual('MINOR', 'File has incorrect version type'); - expect(await apis.user.nodes.getFileVersionLabel(fileLocked1Id)).toEqual('0.1', 'File has incorrect version label'); + expect(await apis.user.nodes.getFileVersionLabel(fileLocked1Id)).toEqual('1.1', 'File has incorrect version label'); }); it('file remains locked after canceling of uploading a new version - [C297571]', async () => { @@ -738,11 +756,12 @@ describe('Upload new version', () => { await uploadNewVersionDialog.clickMajor(); await uploadNewVersionDialog.enterDescription('new major version description'); await uploadNewVersionDialog.clickUpload(); + await uploadNewVersionDialog.waitForDialogToClose(); // TODO: enable when ACA-2329 is fixed // expect(await dataTable.isItemPresent(fileToUpload1, parentSearch)).toBe(true, 'File not updated'); expect(await apis.user.nodes.getFileVersionType(fileSearch1Id)).toEqual('MAJOR', 'File has incorrect version type'); - expect(await apis.user.nodes.getFileVersionLabel(fileSearch1Id)).toEqual('1.0', 'File has incorrect version label'); + expect(await apis.user.nodes.getFileVersionLabel(fileSearch1Id)).toEqual('2.0', 'File has incorrect version label'); }); it('file is updated after uploading a new version - minor - [C307005]', async () => { @@ -759,11 +778,12 @@ describe('Upload new version', () => { await uploadNewVersionDialog.clickMinor(); await uploadNewVersionDialog.enterDescription('new minor version description'); await uploadNewVersionDialog.clickUpload(); + await uploadNewVersionDialog.waitForDialogToClose(); // TODO: enable when ACA-2329 is fixed // expect(await dataTable.isItemPresent(fileToUpload2, parentSearch)).toBe(true, 'File not updated'); expect(await apis.user.nodes.getFileVersionType(fileSearch2Id)).toEqual('MINOR', 'File has incorrect version type'); - expect(await apis.user.nodes.getFileVersionLabel(fileSearch2Id)).toEqual('0.1', 'File has incorrect version label'); + expect(await apis.user.nodes.getFileVersionLabel(fileSearch2Id)).toEqual('1.1', 'File has incorrect version label'); }); it('file is not updated when clicking Cancel - [C307006]', async () => { @@ -782,8 +802,8 @@ describe('Upload new version', () => { await uploadNewVersionDialog.clickCancel(); expect(await dataTable.isItemPresent(fileSearch3, parentSearch)).toBe(true, 'File was updated'); - expect(await apis.user.nodes.getFileVersionType(fileSearch3Id)).toEqual('', 'File has incorrect version type'); - expect(await apis.user.nodes.getFileVersionLabel(fileSearch3Id)).toEqual('', 'File has incorrect version label'); + expect(await apis.user.nodes.getFileVersionType(fileSearch3Id)).toEqual('MAJOR', 'File has incorrect version type'); + expect(await apis.user.nodes.getFileVersionLabel(fileSearch3Id)).toEqual('1.0', 'File has incorrect version label'); }); it('upload new version fails when new file name already exists - [C307007]', async () => { @@ -801,11 +821,12 @@ describe('Upload new version', () => { await uploadNewVersionDialog.enterDescription('new version description'); await uploadNewVersionDialog.clickUpload(); - await page.refresh(); + const message = await page.getSnackBarMessage(); + expect(message).toContain(nameConflictMessage); expect(await dataTable.isItemPresent(fileSearch4, parentSearch)).toBe(true, 'File was updated'); - expect(await apis.user.nodes.getFileVersionType(fileSearch4Id)).toEqual('', 'File has incorrect version type'); - expect(await apis.user.nodes.getFileVersionLabel(fileSearch4Id)).toEqual('', 'File has incorrect version label'); + expect(await apis.user.nodes.getFileVersionType(fileSearch4Id)).toEqual('MAJOR', 'File has incorrect version type'); + expect(await apis.user.nodes.getFileVersionLabel(fileSearch4Id)).toEqual('1.0', 'File has incorrect version label'); }); it('file is unlocked after uploading a new version - [C307008]', async () => { @@ -822,12 +843,13 @@ describe('Upload new version', () => { await uploadNewVersionDialog.clickMinor(); await uploadNewVersionDialog.enterDescription('new version description'); await uploadNewVersionDialog.clickUpload(); + await uploadNewVersionDialog.waitForDialogToClose(); // TODO: enable when ACA-2329 is fixed // expect(await dataTable.isItemPresent(fileToUpload4, parentSearch)).toBe(true, 'File name was not changed'); expect(await apis.user.nodes.isFileLockedWrite(fileLockedSearch1Id)).toBe(false, `${fileLockedSearch1} is still locked`); expect(await apis.user.nodes.getFileVersionType(fileLockedSearch1Id)).toEqual('MINOR', 'File has incorrect version type'); - expect(await apis.user.nodes.getFileVersionLabel(fileLockedSearch1Id)).toEqual('0.1', 'File has incorrect version label'); + expect(await apis.user.nodes.getFileVersionLabel(fileLockedSearch1Id)).toEqual('1.1', 'File has incorrect version label'); }); it('file remains locked after canceling of uploading a new version - [C307009]', async () => { diff --git a/e2e/utilities/repo-client/apis/nodes/node-body-create.ts b/e2e/utilities/repo-client/apis/nodes/node-body-create.ts index cbb76069b..c22d1f1fe 100755 --- a/e2e/utilities/repo-client/apis/nodes/node-body-create.ts +++ b/e2e/utilities/repo-client/apis/nodes/node-body-create.ts @@ -33,6 +33,7 @@ export class NodeBodyCreate { public name: string, public nodeType: string, public relativePath: string = '/', + public aspectNames?: string[], // workaround for REPO-4772 public properties?: any[] ) {} } diff --git a/e2e/utilities/repo-client/apis/nodes/node-content-tree.ts b/e2e/utilities/repo-client/apis/nodes/node-content-tree.ts index 642e0aa76..1a99300d7 100755 --- a/e2e/utilities/repo-client/apis/nodes/node-content-tree.ts +++ b/e2e/utilities/repo-client/apis/nodes/node-content-tree.ts @@ -35,6 +35,7 @@ export interface NodeContentTree { export function flattenNodeContentTree(content: NodeContentTree, relativePath: string = '/'): NodeBodyCreate[] { const { name, files, folders, title, description } = content; + const aspectNames: string[] = ['cm:versionable']; let data: NodeBodyCreate[] = []; let properties: any; @@ -75,7 +76,8 @@ export function flattenNodeContentTree(content: NodeContentTree, relativePath: s .map((filename: string): NodeBodyCreate => ({ nodeType: NODE_TYPE_FILE, name: filename, - relativePath + relativePath, + aspectNames })); data = data.concat(filesData); diff --git a/e2e/utilities/repo-client/apis/nodes/nodes-api.ts b/e2e/utilities/repo-client/apis/nodes/nodes-api.ts index 6f8c406d4..e7535ee36 100755 --- a/e2e/utilities/repo-client/apis/nodes/nodes-api.ts +++ b/e2e/utilities/repo-client/apis/nodes/nodes-api.ts @@ -222,7 +222,8 @@ export class NodesApi extends RepoApi { 'cm:title': title, 'cm:description': description, 'cm:author': author - } + }, + aspectNames: ['cm:versionable'] // workaround for REPO-4772 }; if (imageProps) { nodeBody.properties = Object.assign(nodeBody.properties, imageProps); diff --git a/package.json b/package.json index d7b098203..86b501c51 100644 --- a/package.json +++ b/package.json @@ -17,9 +17,9 @@ "lint": "ng lint && npm run spellcheck && npm run format:check && npm run e2e.typecheck", "wd:update": "webdriver-manager update --gecko=false $VERSION_CHROME", "e2e.typecheck": "tsc -p ./e2e/tsconfig.e2e.typecheck.json", - "e2e": "npm run wd:update && protractor --baseUrl=${TEST_BASE_URL:-http://localhost:4000} $SUITE", + "e2e": "npm run wd:update && protractor --baseUrl=${TEST_BASE_URL:-http://localhost:8080} $SUITE", "e2e.local": "npm run wd:update && protractor --baseUrl=http://localhost:4200 $SUITE", - "wait:app": "wait-on http://localhost:8080 && wait-on http://localhost:4000", + "wait:app": "wait-on http://localhost:8080/alfresco/ -t 1000000 && wait-on http://localhost:8080 -t 400000", "start:docker": "docker-compose up -d --build && npm run wait:app", "stop:docker": "docker-compose stop", "e2e:docker": "npm run start:docker && npm run e2e && npm run stop:docker", @@ -29,7 +29,7 @@ "format:fix": "prettier --write \"src/{app,environments}/**/*.{ts,js,css,scss,html}\"", "build.tomcat": "npm run build.shared && npm run build.extensions && npm run build.app -- --prod --base-href ./ && jar -cvf docker/tomcat/artifacts/content-app.war -C dist/app/ .", "build.tomcat.e2e": "./build-tomcat-e2e.sh", - "e2e.tomcat": "npm run wd:update && protractor --baseUrl=http://localhost:4000/content-app/ $SUITE", + "e2e.tomcat": "npm run wd:update && protractor --baseUrl=http://localhost:8080/content-app/ $SUITE", "docker.tomcat.start": "cd docker/tomcat && docker-compose up -d --build && npm run wait:app", "docker.tomcat.stop": "cd docker/tomcat && docker-compose stop", "docker.tomcat.e2e": "npm run docker.tomcat.start && npm run e2e.tomcat" diff --git a/protractor.conf.js b/protractor.conf.js index 1df8d849f..5b4226e30 100755 --- a/protractor.conf.js +++ b/protractor.conf.js @@ -120,7 +120,7 @@ exports.config = { directConnect: true, - // baseUrl: 'http://localhost:4000', + // baseUrl: 'http://localhost:8080', getPageTimeout: 50000, framework: 'jasmine', diff --git a/src/app/components/info-drawer/info-drawer.component.spec.ts b/src/app/components/info-drawer/info-drawer.component.spec.ts index 57a442605..f25441c43 100644 --- a/src/app/components/info-drawer/info-drawer.component.spec.ts +++ b/src/app/components/info-drawer/info-drawer.component.spec.ts @@ -85,18 +85,6 @@ describe('InfoDrawerComponent', () => { ); }); - it('should set displayNode when node is from personal list', () => { - spyOn(contentApiService, 'getNodeInfo'); - const nodeMock = { entry: { id: 'nodeId', aspectNames: [] } }; - component.node = nodeMock; - - fixture.detectChanges(); - component.ngOnChanges(); - - expect(component.displayNode).toBe(nodeMock.entry); - expect(contentApiService.getNodeInfo).not.toHaveBeenCalled(); - }); - it('should set displayNode when node is library', async(() => { spyOn(contentApiService, 'getNodeInfo'); const nodeMock = { diff --git a/src/app/components/info-drawer/info-drawer.component.ts b/src/app/components/info-drawer/info-drawer.component.ts index 55c3b80d2..447080b89 100644 --- a/src/app/components/info-drawer/info-drawer.component.ts +++ b/src/app/components/info-drawer/info-drawer.component.ts @@ -71,12 +71,8 @@ export class InfoDrawerComponent implements OnChanges, OnInit, OnDestroy { const entry: any = this.node.entry; - if (!entry.aspectNames) { - const id = entry.nodeId || entry.id; - return this.loadNodeInfo(id); - } - - this.setDisplayNode(entry); + const id = entry.nodeId || entry.id; + return this.loadNodeInfo(id); } } diff --git a/start-sso.sh b/start-sso.sh index 97c9236a5..dd5054dd3 100755 --- a/start-sso.sh +++ b/start-sso.sh @@ -1,5 +1,5 @@ export HOST_IP=$(ifconfig | grep -E "([0-9]{1,3}\.){3}[0-9]{1,3}" | grep -v 127.0.0.1 | awk '{ print $2 }' | cut -f2 -d: | head -n1) -export APP_URL="http://${HOST_IP}:4000" +export APP_URL="http://${HOST_IP}:8080" export APP_CONFIG_AUTH_TYPE="OAUTH" export APP_CONFIG_OAUTH2_HOST="http://${HOST_IP}:8085/auth/realms/alfresco"