[ADF-] update library to use new js-api 3.0.0 (#4097)

This commit is contained in:
Eugenio Romano 2019-01-06 23:57:01 +01:00 committed by Eugenio Romano
parent 2acd1b4e26
commit 3ef7d3b7ea
430 changed files with 1966 additions and 2149 deletions

View File

@ -14,3 +14,13 @@ integration
tools
demo-shell/src/
demo-shell/resources/
/angular.json
/desktop.ini
/cspell.json
/.travis.yml
/CODE_OF_CONDUCT.md
/.stylelintignore
/ALFRESCOCORS.md
/CONTRIBUTING.md
/appveyor.yml
/BROWSER-SUPPORT.md

1
.gitignore vendored
View File

@ -31,3 +31,4 @@ src/environments/
/docs/docs.json
/protractorFailuresReport
coverage/
/desktop.ini

View File

@ -55,6 +55,7 @@ jobs:
- npm run stylelint || exit 1
- rm -rf tmp && (./scripts/smart-build.sh -b $TRAVIS_BRANCH || exit 1;);
- npm run build:dist || exit 1
- npm run bundlesize-check || exit 1
- stage: Unit test
name: core
script:

View File

@ -8,10 +8,6 @@
<img src='https://travis-ci.org/Alfresco/alfresco-ng2-components.svg?branch=master' alt='travis
Status' />
</a>
<a title='Build Status AppVeyor' href="https://ci.appveyor.com/project/alfresco/alfresco-ng2-components">
<img src='https://ci.appveyor.com/api/projects/status/github/Alfresco/alfresco-ng2-components' alt='travis
Status' />
</a>
<a href='https://codecov.io/gh/Alfresco/alfresco-ng2-components'>
<img src='http://img.shields.io/codecov/c/github/Alfresco/alfresco-ng2-components/master.svg?maxAge=2592000' alt='Coverage Status' />
</a>
@ -20,6 +16,7 @@
</a>
</p>
## Introduction
See the [Introduction page](INTRODUCTION.md) to get started with the Alfresco Application Development Framework.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

View File

@ -15,7 +15,7 @@ module.exports = {
}
},
"/activiti-app": {
"target": "http://localhost:9999",
"target": "http://localhost:8080",
"secure": false,
"pathRewrite": {
"^/activiti-app/activiti-app": ""

View File

@ -16,7 +16,7 @@
*/
import { Component, ViewEncapsulation } from '@angular/core';
import { SitePaging, SiteEntry, MinimalNodeEntryEntity } from 'alfresco-js-api';
import { SitePaging, SiteEntry, MinimalNodeEntryEntity } from '@alfresco/js-api';
import { ShareDataRow } from '@alfresco/adf-content-services';
import { DataRow, DataColumn, ThumbnailService } from '@alfresco/adf-core';
@ -44,20 +44,20 @@ export class ContentNodeSelectorComponent {
customImageResolver: any = null;
defaultSites: SiteEntry[] = [
{ entry: { title: 'MINE', guid: '-my-' } },
{ entry: { title: 'ROOTY', guid: '-root-' } }];
new SiteEntry({ entry: { title: 'MINE', guid: '-my-' } }),
new SiteEntry({ entry: { title: 'ROOTY', guid: '-root-' } })];
customSites: SitePaging = {
customSites: SitePaging = new SitePaging({
list: {
entries: [
{ entry: { title: 'MINE', guid: '-my-' } },
{ entry: { title: 'ROOTY', guid: '-root-' } }],
pagination: {}
}
};
});
onClickAddSite() {
const newSiteEntry: SiteEntry = { entry: { title: this.customSideTitle, guid: this.customSideGuid } };
const newSiteEntry: SiteEntry = new SiteEntry({ entry: { title: this.customSideTitle, guid: this.customSideGuid } });
this.customSites.list.entries.push(newSiteEntry);
this.customSideGuid = '';
this.customSideTitle = '';

View File

@ -208,16 +208,6 @@
</mat-slide-toggle>
</p>
<p class="toggle">
<mat-slide-toggle
id="adf-switch-share"
[color]="'primary'"
(change)="toggleAllowShare()"
[checked]="allowShare">
Allow Share
</mat-slide-toggle>
</p>
<p class="toggle">
<mat-slide-toggle
id="adf-switch-allowsidebar"
@ -274,7 +264,6 @@
[allowGoBack]="allowGoBack"
[displayName]="displayName"
[showToolbar]="showToolbar"
[allowShare]="allowShare"
[allowPrint]="allowPrint"
[allowDownload]="allowDownload"
[allowSidebar]="allowSidebar"

View File

@ -43,7 +43,6 @@ export class FileViewComponent implements OnInit {
openWith = false;
allowDownload = true;
allowPrint = true;
allowShare = true;
allowSidebar = true;
allowLeftSidebar = true;
moreActions = true;
@ -120,10 +119,6 @@ export class FileViewComponent implements OnInit {
this.allowPrint = !this.allowPrint;
}
toggleAllowShare() {
this.allowShare = !this.allowShare;
}
toggleOpenMoreActions() {
this.moreActions = !this.moreActions;
}

View File

@ -23,7 +23,7 @@ import { Location } from '@angular/common';
import { MatDialog } from '@angular/material';
import { ActivatedRoute, Params, Router } from '@angular/router';
import { MinimalNodeEntity, NodePaging, Pagination, MinimalNodeEntryEntity, SiteEntry } from 'alfresco-js-api';
import { MinimalNodeEntity, NodePaging, Pagination, MinimalNodeEntryEntity, SiteEntry } from '@alfresco/js-api';
import {
AlfrescoApiService, AuthenticationService, AppConfigService, AppConfigValues, ContentService, TranslationService,
FileUploadEvent, FolderCreatedEvent, LogService, NotificationService,
@ -57,7 +57,7 @@ const DEFAULT_FOLDER_TO_SHOW = '-my-';
export class FilesComponent implements OnInit, OnChanges, OnDestroy {
errorMessage: string = null;
fileNodeId: any;
nodeId: any;
showViewer = false;
showVersions = false;
allowDropFiles = true;

View File

@ -17,7 +17,7 @@
import { Component, Inject, ViewEncapsulation } from '@angular/core';
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material';
import { MinimalNodeEntryEntity } from 'alfresco-js-api';
import { MinimalNodeEntryEntity } from '@alfresco/js-api';
@Component({
templateUrl: './metadata-dialog-adapter.component.html',

View File

@ -17,7 +17,7 @@
import { Component, Inject, ViewEncapsulation } from '@angular/core';
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material';
import { MinimalNodeEntryEntity } from 'alfresco-js-api';
import { MinimalNodeEntryEntity } from '@alfresco/js-api';
import { MatSnackBar } from '@angular/material';
@Component({

View File

@ -18,5 +18,5 @@
<adf-viewer
[(showViewer)]="showViewer"
[overlayMode]="isOverlay"
[fileNodeId]="nodeId">
[nodeId]="nodeId">
</adf-viewer>

View File

@ -18,7 +18,7 @@
import { Component, Optional, OnInit, ViewChild } from '@angular/core';
import { ActivatedRoute, Params } from '@angular/router';
import { PermissionListComponent, NodePermissionDialogService } from '@alfresco/adf-content-services';
import { MinimalNodeEntryEntity } from 'alfresco-js-api';
import { MinimalNodeEntryEntity } from '@alfresco/js-api';
import { NodesApiService, NotificationService } from '@alfresco/adf-core';
@Component({

View File

@ -33,7 +33,7 @@ import {
ProcessInstanceFilterRepresentation,
Pagination,
UserProcessInstanceFilterRepresentation
} from 'alfresco-js-api';
} from '@alfresco/js-api';
import {
FORM_FIELD_VALIDATORS, FormEvent, FormFieldEvent, FormRenderingService, FormService,
DynamicTableRow, ValidateDynamicTableRowEvent, AppConfigService, PaginationComponent, UserPreferenceValues

View File

@ -17,7 +17,7 @@
import { Component } from '@angular/core';
import { Router } from '@angular/router';
import { MinimalNodeEntity } from 'alfresco-js-api';
import { MinimalNodeEntity } from '@alfresco/js-api';
import { PreviewService } from '../../services/preview.service';
@Component({

View File

@ -15,7 +15,7 @@
* limitations under the License.
*/
import { QueryBody } from 'alfresco-js-api';
import { QueryBody } from '@alfresco/js-api';
import { SearchConfigurationInterface } from '@alfresco/adf-core';
export class TestSearchConfigurationService implements SearchConfigurationInterface {

View File

@ -16,7 +16,7 @@
*/
import { Component, ViewChild, ViewEncapsulation } from '@angular/core';
import { NodePaging, Pagination, QueryBody, MinimalNodeEntity } from 'alfresco-js-api';
import { NodePaging, Pagination, QueryBody, MinimalNodeEntity } from '@alfresco/js-api';
import { SearchComponent } from '@alfresco/adf-content-services';
import { ThumbnailService } from '@alfresco/adf-core';
import { SearchService, SearchConfigurationService } from '@alfresco/adf-core';

View File

@ -17,7 +17,7 @@
import { Component, OnInit, Optional, OnDestroy } from '@angular/core';
import { Router, ActivatedRoute, Params } from '@angular/router';
import { NodePaging, Pagination } from 'alfresco-js-api';
import { NodePaging, Pagination, ResultSetPaging } from '@alfresco/js-api';
import { SearchQueryBuilderService } from '@alfresco/adf-content-services';
import { UserPreferencesService, SearchService, AppConfigService } from '@alfresco/adf-core';
import { Subscription } from 'rxjs';
@ -61,10 +61,10 @@ export class SearchResultComponent implements OnInit, OnDestroy {
this.isLoading = true;
}),
this.queryBuilder.executed.subscribe((data) => {
this.queryBuilder.executed.subscribe((resultSetPaging: ResultSetPaging) => {
this.queryBuilder.paging.skipCount = 0;
this.onSearchResultLoaded(data);
this.onSearchResultLoaded(resultSetPaging);
this.isLoading = false;
})
);
@ -79,7 +79,12 @@ export class SearchResultComponent implements OnInit, OnDestroy {
this.queryBuilder.update();
} else {
this.queryBuilder.userQuery = null;
this.queryBuilder.executed.next({ list: { pagination: { totalItems: 0 }, entries: [] } });
this.queryBuilder.executed.next(new ResultSetPaging({
list: {
pagination: { totalItems: 0 },
entries: []
}
}));
}
});
}
@ -101,9 +106,9 @@ export class SearchResultComponent implements OnInit, OnDestroy {
this.subscriptions = [];
}
onSearchResultLoaded(nodePaging: NodePaging) {
this.data = nodePaging;
this.pagination = { ...nodePaging.list.pagination };
onSearchResultLoaded(resultSetPaging: ResultSetPaging) {
this.data = resultSetPaging;
this.pagination = { ...resultSetPaging.list.pagination };
}
onRefreshPagination(pagination: Pagination) {

View File

@ -19,7 +19,7 @@ import { Component, ViewChild } from '@angular/core';
import { DocumentListComponent } from '@alfresco/adf-content-services';
import { UserPreferencesService, UserPreferenceValues, RestoreMessageModel, NotificationService } from '@alfresco/adf-core';
import { Router } from '@angular/router';
import { PathInfoEntity } from 'alfresco-js-api';
import { PathInfoEntity } from '@alfresco/js-api';
@Component({
templateUrl: './trashcan.component.html',

View File

@ -8,8 +8,8 @@
"skipLibCheck": false,
"types": [],
"paths": {
"alfresco-js-api": [
"../../node_modules/alfresco-js-api/dist/alfresco-js-api.js"
"@alfresco/js-api": [
"../../node_modules/@alfresco/js-api"
],
"rxjs/*": [
"../../node_modules/rxjs/*"

View File

@ -38,7 +38,7 @@ Using with node id:
<adf-viewer
[showViewer]="true"
[overlayMode]="true"
[fileNodeId]="'d367023a-7ebe-4f3a-a7d0-4f27c43f1045'">
[nodeId]="'d367023a-7ebe-4f3a-a7d0-4f27c43f1045'">
</adf-viewer>
```
@ -106,7 +106,6 @@ See the [Custom layout](#custom-layout) section for full details of all availabl
| thumbnailsTemplate | [`TemplateRef`](https://angular.io/api/core/TemplateRef)`<any>` | null | The template for the pdf thumbnails. |
| urlFile | `string` | "" | If you want to load an external file that does not come from ACS you can use this URL to specify where to load the file from. |
| urlFileViewer | `string` | null | Viewer to use with the `urlFile` address (`pdf`, `image`, `media`, `text`). Used when `urlFile` has no filename and extension. |
| fileNodeId | `void` | | (**Deprecated:** 2.4.0 use nodeId) Node Id of the file to load. |
### Events
@ -147,7 +146,7 @@ Below is the most simple integration of the Viewer and
<adf-viewer
[(showViewer)]="showViewer"
[overlayMode]="true"
[fileNodeId]="nodeId">
[nodeId]="nodeId">
</adf-viewer>
```
@ -276,7 +275,7 @@ the [Viewer component](../core/viewer.component.md). Below is an example that sh
to handle 3D data files:
```html
<adf-viewer [fileNodeId]="fileNodeId">
<adf-viewer [nodeId]="nodeId">
<adf-viewer-extension [supportedExtensions]="['obj','3ds']" #extension>
<ng-template let-urlFileContent="urlFileContent" let-extension="extension">
@ -295,7 +294,7 @@ Note: you need to add the `ng2-3d-editor` dependency to your `package.json` file
You can define multiple `adf-viewer-extension` templates if required:
```html
<adf-viewer [fileNodeId]="fileNodeId">
<adf-viewer [nodeId]="nodeId">
<adf-viewer-extension [supportedExtensions]="['xls','xlsx']" #extension>
<ng-template let-urlFileContent="urlFileContent">
@ -377,7 +376,7 @@ transclusion, which will display all content placed inside the `<adf-viewer-side
```
The second way to customize the sidebar is to use template injection but note that this only works
when using the viewer with `fileNodeId`.
when using the viewer with `nodeId`.
```html
<ng-template let-node="node" #sidebarTemplate>
@ -424,7 +423,7 @@ You can enable a custom "Open With" menu by providing at least one action inside
`adf-viewer-open-with` tag:
```html
<adf-viewer [fileNodeId]="nodeId">
<adf-viewer [nodeId]="nodeId">
<adf-viewer-open-with>
<button mat-menu-item>
@ -451,7 +450,7 @@ You can enable a custom "Open With" menu by providing at least one action inside
You can enable a custom "More actions" menu by providing at least one action inside the `adf-viewer-more-actions` tag:
```html
<adf-viewer [fileNodeId]="nodeId">
<adf-viewer [nodeId]="nodeId">
<adf-viewer-more-actions>
<button mat-menu-item>

View File

@ -1 +0,0 @@
var Util = require('../../util/util');var Util = require('../../util/util');

View File

@ -15,8 +15,8 @@
* limitations under the License.
*/
import { Tenant } from '../models/APS/Tenant';
import { User } from '../models/APS/User';
import { Tenant } from '../models/APS/tenant';
import { User } from '../models/APS/user';
import TestConfig = require('../test.config');
import path = require('path');
import fs = require('fs');

View File

@ -20,7 +20,7 @@ import { FileModel } from '../models/ACS/fileModel';
import { LoginPage } from '../pages/adf/loginPage';
import { TagPage } from '../pages/adf/tagPage';
import { AppNavigationBarPage } from '../pages/adf/process_services/appNavigationBarPage';
import { AppNavigationBarPage } from '../pages/adf/process-services/appNavigationBarPage';
import TestConfig = require('../test.config');
import resources = require('../util/resources');

View File

@ -17,7 +17,7 @@
import { LoginPage } from '../pages/adf/loginPage';
import { NavigationBarPage } from '../pages/adf/navigationBarPage';
import { TreeViewPage } from '../pages/adf/content_services/treeViewPage';
import { TreeViewPage } from '../pages/adf/content-services/treeViewPage';
import { AcsUserModel } from '../models/ACS/acsUserModel';

View File

@ -19,7 +19,7 @@ import { browser } from 'protractor';
import { LoginPage } from '../../pages/adf/loginPage';
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
import { ProcessServicesPage } from '../../pages/adf/process_services/processServicesPage';
import { ProcessServicesPage } from '../../pages/adf/process-services/processServicesPage';
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
import { UserInfoDialog } from '../../pages/adf/dialog/userInfoDialog';

View File

@ -19,7 +19,7 @@ import { browser } from 'protractor';
import { LoginPage } from '../../pages/adf/loginPage';
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
import { ProcessServicesPage } from '../../pages/adf/process_services/processServicesPage';
import { ProcessServicesPage } from '../../pages/adf/process-services/processServicesPage';
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
import TestConfig = require('../../test.config');

View File

@ -19,7 +19,7 @@ import { LoginSSOPage } from '../pages/adf/loginSSOPage';
import { SettingsPage } from '../pages/adf/settingsPage';
import TestConfig = require('../test.config');
import { browser } from 'protractor';
import { NavigationBarPage } from '../pages/adf/NavigationBarPage';
import { NavigationBarPage } from '../pages/adf/navigationBarPage';
import { UserInfoDialog } from '../pages/adf/dialog/userInfoDialog';
import { Identity } from '../actions/APS-cloud/identity';

View File

@ -127,13 +127,6 @@ describe('Viewer - properties', () => {
viewerPage.enablePrint();
});
it('[C260087] Should Show/Hide share button when allowShare is true/false', () => {
viewerPage.checkShareButtonDisplayed();
viewerPage.disableShare();
viewerPage.checkShareButtonIsNotDisplayed();
viewerPage.enableShare();
});
it('[C260092] Should show adf-viewer-toolbar-actions directive buttons when adf-viewer-toolbar-actions is used', () => {
viewerPage.checkMoreActionsDisplayed();

View File

@ -17,12 +17,12 @@
import { LoginPage } from '../pages/adf/loginPage';
import { NavigationBarPage } from '../pages/adf/navigationBarPage';
import { AnalyticsPage } from '../pages/adf/process_services/analyticsPage';
import { ProcessServicesPage } from '../pages/adf/process_services/processServicesPage';
import { AppNavigationBarPage } from '../pages/adf/process_services/appNavigationBarPage';
import { AnalyticsPage } from '../pages/adf/process-services/analyticsPage';
import { ProcessServicesPage } from '../pages/adf/process-services/processServicesPage';
import { AppNavigationBarPage } from '../pages/adf/process-services/appNavigationBarPage';
import TestConfig = require('../test.config');
import { Tenant } from '../models/APS/Tenant';
import { User } from '../models/APS/User';
import { Tenant } from '../models/APS/tenant';
import { User } from '../models/APS/user';
import AlfrescoApi = require('alfresco-js-api-node');

View File

@ -17,9 +17,9 @@
import { Util } from '../../../util/util';
import { ProcessFiltersCloudComponent } from '../process_cloud/processFiltersCloudComponent';
import { ProcessListCloudComponent } from '../process_cloud/processListCloudComponent';
import { EditProcessFilterCloudComponent } from '../process_cloud/editProcessFilterCloudComponent';
import { ProcessFiltersCloudComponent } from '../process-cloud/processFiltersCloudComponent';
import { ProcessListCloudComponent } from '../process-cloud/processListCloudComponent';
import { EditProcessFilterCloudComponent } from '../process-cloud/editProcessFilterCloudComponent';
import { element, by } from 'protractor';
export class ProcessCloudDemoPage {

View File

@ -18,7 +18,7 @@
import { Util } from '../../../util/util';
import { element, by } from 'protractor';
import { TaskFiltersPage } from '../process_services/taskFiltersPage';
import { TaskFiltersPage } from '../process-services/taskFiltersPage';
export class TaskFiltersDemoPage {

View File

@ -16,7 +16,7 @@
*/
import { Util } from '../../../util/util';
import { TasksListPage } from '../process_services/tasksListPage';
import { TasksListPage } from '../process-services/tasksListPage';
import { PaginationPage } from '../paginationPage';
import { element, by } from 'protractor';

View File

@ -17,8 +17,8 @@
import { Util } from '../../../util/util';
import { TaskFiltersCloudComponent } from '../process_cloud/taskFiltersCloudComponent';
import { TaskListCloudComponent } from '../process_cloud/taskListCloudComponent';
import { TaskFiltersCloudComponent } from '../process-cloud/taskFiltersCloudComponent';
import { TaskListCloudComponent } from '../process-cloud/taskListCloudComponent';
import { element, by } from 'protractor';
export class TasksCloudDemoPage {

View File

@ -17,11 +17,11 @@
import { Util } from '../../../util/util';
import { element, by, browser, protractor } from 'protractor';
import { DateUtil } from '../../../util/dateUtil';
export class DatePickerPage {
datePicker = element(by.css('mat-calendar'));
months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
nextMonthButton = element(by.css('button[class*="mat-calendar-next-button"]'));
previousMonthButton = element(by.css('button[class*="mat-calendar-previous-button"]'));
@ -30,8 +30,8 @@ export class DatePickerPage {
}
checkDatesAfterDateAreDisabled(date) {
let afterDate = new Date(date.getTime() + 24 * 60 * 60 * 1000);
let afterCalendar = element(by.css(`td[class*="mat-calendar-body-cell"][aria-label="${this.convertDateToDefaultFormat(afterDate)}"]`));
let afterDate = DateUtil.formatDate('DD-MM-YY', date, 1);
let afterCalendar = element(by.css(`td[class*="mat-calendar-body-cell"][aria-label="${afterDate}"]`));
browser.controlFlow().execute(async () => {
if (await afterCalendar.isPresent()) {
await expect(afterCalendar.getAttribute('aria-disabled')).toBe('true');
@ -42,8 +42,8 @@ export class DatePickerPage {
}
checkDatesBeforeDateAreDisabled(date) {
let beforeDate = new Date(date.getTime() - 24 * 60 * 60 * 1000);
let beforeCalendar = element(by.css(`td[class*="mat-calendar-body-cell"][aria-label="${this.convertDateToDefaultFormat(beforeDate)}"]`));
let beforeDate = DateUtil.formatDate('DD-MM-YY', date, -1);
let beforeCalendar = element(by.css(`td[class*="mat-calendar-body-cell"][aria-label="${beforeDate}"]`));
browser.controlFlow().execute(async () => {
if (await beforeCalendar.isPresent()) {
await expect(beforeCalendar.getAttribute('aria-disabled')).toBe('true');
@ -53,15 +53,6 @@ export class DatePickerPage {
return this;
}
convertDefaultFormatToDate(dateString) { // Format : dd-Mmm-yy
let date = dateString.split('-');
return new Date((2000 + parseInt(date[2], 10)), this.months.indexOf(date[1]), date[0]);
}
convertDateToDefaultFormat(date) { // Format : dd-Mmm-yy
return `${('0' + date.getDate()).slice(-2)}-${this.months[date.getMonth()]}-${date.getFullYear().toString().substr(-2)}`;
}
selectTodayDate() {
this.checkDatePickerIsDisplayed();
let todayDate = element(by.css('.mat-calendar-body-today'));

View File

@ -18,8 +18,8 @@
import { Util } from '../../util/util';
import TestConfig = require('../../test.config');
import { element, by, browser } from 'protractor';
import { ProcessServicesPage } from './process_services/processServicesPage';
import { AppListCloudComponent } from './process_cloud/appListCloudComponent';
import { ProcessServicesPage } from './process-services/processServicesPage';
import { AppListCloudComponent } from './process-cloud/appListCloudComponent';
export class NavigationBarPage {

Some files were not shown because too many files have changed in this diff Show More