Skip to content

Commit

Permalink
[ADF-] update library to use new js-api 3.0.0 (#4097)
Browse files Browse the repository at this point in the history
  • Loading branch information
eromano committed Jan 8, 2019
1 parent 2acd1b4 commit 3ef7d3b
Show file tree
Hide file tree
Showing 430 changed files with 1,986 additions and 2,169 deletions.
10 changes: 10 additions & 0 deletions .dockerignore
Expand Up @@ -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 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -31,3 +31,4 @@ src/environments/
/docs/docs.json
/protractorFailuresReport
coverage/
/desktop.ini
1 change: 1 addition & 0 deletions .travis.yml
Expand Up @@ -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:
Expand Down
5 changes: 1 addition & 4 deletions README.md
Expand Up @@ -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>
Expand All @@ -20,6 +16,7 @@
</a>
</p>


## Introduction

See the [Introduction page](INTRODUCTION.md) to get started with the Alfresco Application Development Framework.
Expand Down
Binary file removed assets/angular2.png
Binary file not shown.
Binary file removed assets/browserstack.png
Binary file not shown.
2 changes: 1 addition & 1 deletion demo-shell/proxy.conf.js
Expand Up @@ -15,7 +15,7 @@ module.exports = {
}
},
"/activiti-app": {
"target": "http://localhost:9999",
"target": "http://localhost:8080",
"secure": false,
"pathRewrite": {
"^/activiti-app/activiti-app": ""
Expand Down
Expand Up @@ -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';

Expand Down Expand Up @@ -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 = '';
Expand Down
11 changes: 0 additions & 11 deletions demo-shell/src/app/components/file-view/file-view.component.html
Expand Up @@ -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"
Expand Down Expand Up @@ -274,7 +264,6 @@
[allowGoBack]="allowGoBack"
[displayName]="displayName"
[showToolbar]="showToolbar"
[allowShare]="allowShare"
[allowPrint]="allowPrint"
[allowDownload]="allowDownload"
[allowSidebar]="allowSidebar"
Expand Down
Expand Up @@ -43,7 +43,6 @@ export class FileViewComponent implements OnInit {
openWith = false;
allowDownload = true;
allowPrint = true;
allowShare = true;
allowSidebar = true;
allowLeftSidebar = true;
moreActions = true;
Expand Down Expand Up @@ -120,10 +119,6 @@ export class FileViewComponent implements OnInit {
this.allowPrint = !this.allowPrint;
}

toggleAllowShare() {
this.allowShare = !this.allowShare;
}

toggleOpenMoreActions() {
this.moreActions = !this.moreActions;
}
Expand Down
4 changes: 2 additions & 2 deletions demo-shell/src/app/components/files/files.component.ts
Expand Up @@ -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,
Expand Down Expand Up @@ -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;
Expand Down
Expand Up @@ -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',
Expand Down
Expand Up @@ -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({
Expand Down
Expand Up @@ -18,5 +18,5 @@ <h1>Overlay Viewer</h1>
<adf-viewer
[(showViewer)]="showViewer"
[overlayMode]="isOverlay"
[fileNodeId]="nodeId">
[nodeId]="nodeId">
</adf-viewer>
Expand Up @@ -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({
Expand Down
Expand Up @@ -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
Expand Down
Expand Up @@ -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({
Expand Down
Expand Up @@ -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 {
Expand Down
Expand Up @@ -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';
Expand Down
19 changes: 12 additions & 7 deletions demo-shell/src/app/components/search/search-result.component.ts
Expand Up @@ -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';
Expand Down Expand Up @@ -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;
})
);
Expand All @@ -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: []
}
}));
}
});
}
Expand All @@ -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) {
Expand Down
Expand Up @@ -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',
Expand Down
4 changes: 2 additions & 2 deletions demo-shell/src/tsconfig.dev.json
Expand Up @@ -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/*"
Expand Down
15 changes: 7 additions & 8 deletions docs/core/viewer.component.md
Expand Up @@ -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>
```

Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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>
```

Expand Down Expand Up @@ -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">
Expand All @@ -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">
Expand Down Expand Up @@ -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>
Expand Down Expand Up @@ -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>
Expand All @@ -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>
Expand Down
1 change: 0 additions & 1 deletion e2e/Util.kt

This file was deleted.

4 changes: 2 additions & 2 deletions e2e/actions/users.actions.ts
Expand Up @@ -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');
Expand Down
File renamed without changes.
Expand Up @@ -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');
Expand Down
Expand Up @@ -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';

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 3ef7d3b

Please sign in to comment.