diff --git a/.gitignore b/.gitignore index b54c390925a..1d7f61df3b3 100644 --- a/.gitignore +++ b/.gitignore @@ -16,4 +16,6 @@ src/environments/ /demo-shell-ng2/ng2-components/ .happypack/ .happypack/ -.history \ No newline at end of file +.history +package-lock.* +/ng2-components/ng2-alfresco-core/prebuilt-themes/ diff --git a/.travis.yml b/.travis.yml index fea7da6b574..0a8fb4f28f0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,7 +19,7 @@ install: if ([ "$TRAVIS_BRANCH" = "master" ]); then (./scripts/npm-build-all.sh || exit 1;); else - (./scripts/npm-build-all.sh -gitjsapi development || exit 1;); + (./scripts/npm-build-all.sh -vjsapi alpha || exit 1;); fi fi @@ -34,7 +34,7 @@ script: if ([ "$TRAVIS_BRANCH" = "master" ]); then (./scripts/start.sh -t -ss || exit 1;); else - (./scripts/start.sh -dev -t -ss -gitjsapi development || exit 1;); + (./scripts/start.sh -dev -t -ss -vjsapi alpha || exit 1;); fi fi diff --git a/demo-shell-ng2/app.config-dev.json b/demo-shell-ng2/app.config-dev.json index d596b1c58b6..e62d118d6e9 100644 --- a/demo-shell-ng2/app.config-dev.json +++ b/demo-shell-ng2/app.config-dev.json @@ -2,7 +2,7 @@ "ecmHost": "http://{hostname}:{port}/ecm", "bpmHost": "http://{hostname}:{port}/bpm", "application": { - "name": "Alfresco" + "name": "Alfresco ADF Appplication" }, "pagination": { "size": 25 @@ -25,5 +25,231 @@ } ] } + }, + "document-list": { + "supportedPageSizes": [5, 10, 15, 20], + "presets": { + "-trashcan-": [ + { + "key": "$thumbnail", + "type": "image", + "srTitle": "ADF-DOCUMENT-LIST.LAYOUT.THUMBNAIL", + "sortable": false + }, + { + "key": "name", + "type": "text", + "title": "ADF-DOCUMENT-LIST.LAYOUT.NAME", + "cssClass": "full-width ellipsis-cell", + "sortable": true + }, + { + "key": "path", + "type": "location", + "title": "ADF-DOCUMENT-LIST.LAYOUT.LOCATION", + "format": "/files", + "sortable": true + }, + { + "key": "content.sizeInBytes", + "type": "fileSize", + "title": "ADF-DOCUMENT-LIST.LAYOUT.SIZE", + "sortable": true + }, + { + "key": "archivedAt", + "type": "date", + "title": "ADF-DOCUMENT-LIST.LAYOUT.DELETED_ON", + "format": "timeAgo", + "sortable": true + }, + { + "key": "archivedByUser.displayName", + "type": "text", + "title": "ADF-DOCUMENT-LIST.LAYOUT.DELETED_BY", + "sortable": true + } + ], + "-sites-": [ + { + "key": "$thumbnail", + "type": "image", + "srTitle": "ADF-DOCUMENT-LIST.LAYOUT.THUMBNAIL", + "sortable": false + }, + { + "key": "title", + "type": "text", + "title": "ADF-DOCUMENT-LIST.LAYOUT.NAME", + "cssClass": "full-width ellipsis-cell", + "sortable": true + }, + { + "key": "visibility", + "type": "text", + "title": "ADF-DOCUMENT-LIST.LAYOUT.STATUS", + "sortable": true + } + ], + "-favorites-": [ + { + "key": "$thumbnail", + "type": "image", + "srTitle": "ADF-DOCUMENT-LIST.LAYOUT.THUMBNAIL", + "sortable": false + }, + { + "key": "name", + "type": "text", + "title": "ADF-DOCUMENT-LIST.LAYOUT.NAME", + "cssClass": "full-width ellipsis-cell", + "sortable": true + }, + { + "key": "path", + "type": "location", + "title": "ADF-DOCUMENT-LIST.LAYOUT.LOCATION", + "format": "/files", + "sortable": true + }, + { + "key": "content.sizeInBytes", + "type": "fileSize", + "title": "ADF-DOCUMENT-LIST.LAYOUT.SIZE", + "sortable": true + }, + { + "key": "modifiedAt", + "type": "date", + "title": "ADF-DOCUMENT-LIST.LAYOUT.MODIFIED_ON", + "format": "timeAgo", + "sortable": true + }, + { + "key": "modifiedByUser.displayName", + "type": "text", + "title": "ADF-DOCUMENT-LIST.LAYOUT.MODIFIED_BY", + "sortable": true + } + ], + "-recent-": [ + { + "key": "$thumbnail", + "type": "image", + "srTitle": "ADF-DOCUMENT-LIST.LAYOUT.THUMBNAIL", + "sortable": false + }, + { + "key": "name", + "type": "text", + "title": "ADF-DOCUMENT-LIST.LAYOUT.NAME", + "cssClass": "full-width ellipsis-cell", + "sortable": true + }, + { + "key": "path", + "type": "location", + "title": "ADF-DOCUMENT-LIST.LAYOUT.LOCATION", + "cssClass": "ellipsis-cell", + "format": "/files", + "sortable": true + }, + { + "key": "content.sizeInBytes", + "type": "fileSize", + "title": "ADF-DOCUMENT-LIST.LAYOUT.SIZE", + "sortable": true + }, + { + "key": "modifiedAt", + "type": "date", + "title": "ADF-DOCUMENT-LIST.LAYOUT.MODIFIED_ON", + "format": "timeAgo", + "sortable": true + } + ], + "-sharedlinks-": [ + { + "key": "$thumbnail", + "type": "image", + "srTitle": "ADF-DOCUMENT-LIST.LAYOUT.THUMBNAIL", + "sortable": false + }, + { + "key": "name", + "type": "text", + "title": "ADF-DOCUMENT-LIST.LAYOUT.NAME", + "cssClass": "full-width ellipsis-cell", + "sortable": true + }, + { + "key": "path", + "type": "location", + "title": "ADF-DOCUMENT-LIST.LAYOUT.LOCATION", + "cssClass": "ellipsis-cell", + "format": "/files", + "sortable": true + }, + { + "key": "content.sizeInBytes", + "type": "fileSize", + "title": "ADF-DOCUMENT-LIST.LAYOUT.SIZE", + "sortable": true + }, + { + "key": "modifiedAt", + "type": "date", + "title": "ADF-DOCUMENT-LIST.LAYOUT.MODIFIED_ON", + "format": "timeAgo", + "sortable": true + }, + { + "key": "modifiedByUser.displayName", + "type": "text", + "title": "ADF-DOCUMENT-LIST.LAYOUT.MODIFIED_BY", + "sortable": true + }, + { + "key": "sharedByUser.displayName", + "type": "text", + "title": "ADF-DOCUMENT-LIST.LAYOUT.SHARED_BY", + "sortable": true + } + ], + "default": [ + { + "key": "$thumbnail", + "type": "image", + "srTitle": "ADF-DOCUMENT-LIST.LAYOUT.THUMBNAIL", + "sortable": false + }, + { + "key": "name", + "type": "text", + "title": "ADF-DOCUMENT-LIST.LAYOUT.NAME", + "cssClass": "full-width ellipsis-cell", + "sortable": true + }, + { + "key": "content.sizeInBytes", + "type": "fileSize", + "title": "ADF-DOCUMENT-LIST.LAYOUT.SIZE", + "sortable": true + }, + { + "key": "modifiedAt", + "type": "date", + "title": "ADF-DOCUMENT-LIST.LAYOUT.MODIFIED_ON", + "format": "timeAgo", + "sortable": true + }, + { + "key": "modifiedByUser.displayName", + "type": "text", + "title": "ADF-DOCUMENT-LIST.LAYOUT.MODIFIED_BY", + "sortable": true + } + ] + } } } diff --git a/demo-shell-ng2/app.config-prod.json b/demo-shell-ng2/app.config-prod.json index fb64e6299ff..5cb0efa9dd9 100644 --- a/demo-shell-ng2/app.config-prod.json +++ b/demo-shell-ng2/app.config-prod.json @@ -2,7 +2,7 @@ "ecmHost": "http://{hostname}", "bpmHost": "http://{hostname}", "application": { - "name": "Alfresco" + "name": "Alfresco ADF Appplication" }, "pagination": { "size": 25 @@ -25,5 +25,231 @@ } ] } + }, + "document-list": { + "supportedPageSizes": [5, 10, 15, 20], + "presets": { + "-trashcan-": [ + { + "key": "$thumbnail", + "type": "image", + "srTitle": "ADF-DOCUMENT-LIST.LAYOUT.THUMBNAIL", + "sortable": false + }, + { + "key": "name", + "type": "text", + "title": "ADF-DOCUMENT-LIST.LAYOUT.NAME", + "cssClass": "full-width ellipsis-cell", + "sortable": true + }, + { + "key": "path", + "type": "location", + "title": "ADF-DOCUMENT-LIST.LAYOUT.LOCATION", + "format": "/files", + "sortable": true + }, + { + "key": "content.sizeInBytes", + "type": "fileSize", + "title": "ADF-DOCUMENT-LIST.LAYOUT.SIZE", + "sortable": true + }, + { + "key": "archivedAt", + "type": "date", + "title": "ADF-DOCUMENT-LIST.LAYOUT.DELETED_ON", + "format": "timeAgo", + "sortable": true + }, + { + "key": "archivedByUser.displayName", + "type": "text", + "title": "ADF-DOCUMENT-LIST.LAYOUT.DELETED_BY", + "sortable": true + } + ], + "-sites-": [ + { + "key": "$thumbnail", + "type": "image", + "srTitle": "ADF-DOCUMENT-LIST.LAYOUT.THUMBNAIL", + "sortable": false + }, + { + "key": "title", + "type": "text", + "title": "ADF-DOCUMENT-LIST.LAYOUT.NAME", + "cssClass": "full-width ellipsis-cell", + "sortable": true + }, + { + "key": "visibility", + "type": "text", + "title": "ADF-DOCUMENT-LIST.LAYOUT.STATUS", + "sortable": true + } + ], + "-favorites-": [ + { + "key": "$thumbnail", + "type": "image", + "srTitle": "ADF-DOCUMENT-LIST.LAYOUT.THUMBNAIL", + "sortable": false + }, + { + "key": "name", + "type": "text", + "title": "ADF-DOCUMENT-LIST.LAYOUT.NAME", + "cssClass": "full-width ellipsis-cell", + "sortable": true + }, + { + "key": "path", + "type": "location", + "title": "ADF-DOCUMENT-LIST.LAYOUT.LOCATION", + "format": "/files", + "sortable": true + }, + { + "key": "content.sizeInBytes", + "type": "fileSize", + "title": "ADF-DOCUMENT-LIST.LAYOUT.SIZE", + "sortable": true + }, + { + "key": "modifiedAt", + "type": "date", + "title": "ADF-DOCUMENT-LIST.LAYOUT.MODIFIED_ON", + "format": "timeAgo", + "sortable": true + }, + { + "key": "modifiedByUser.displayName", + "type": "text", + "title": "ADF-DOCUMENT-LIST.LAYOUT.MODIFIED_BY", + "sortable": true + } + ], + "-recent-": [ + { + "key": "$thumbnail", + "type": "image", + "srTitle": "ADF-DOCUMENT-LIST.LAYOUT.THUMBNAIL", + "sortable": false + }, + { + "key": "name", + "type": "text", + "title": "ADF-DOCUMENT-LIST.LAYOUT.NAME", + "cssClass": "full-width ellipsis-cell", + "sortable": true + }, + { + "key": "path", + "type": "location", + "title": "ADF-DOCUMENT-LIST.LAYOUT.LOCATION", + "cssClass": "ellipsis-cell", + "format": "/files", + "sortable": true + }, + { + "key": "content.sizeInBytes", + "type": "fileSize", + "title": "ADF-DOCUMENT-LIST.LAYOUT.SIZE", + "sortable": true + }, + { + "key": "modifiedAt", + "type": "date", + "title": "ADF-DOCUMENT-LIST.LAYOUT.MODIFIED_ON", + "format": "timeAgo", + "sortable": true + } + ], + "-sharedlinks-": [ + { + "key": "$thumbnail", + "type": "image", + "srTitle": "ADF-DOCUMENT-LIST.LAYOUT.THUMBNAIL", + "sortable": false + }, + { + "key": "name", + "type": "text", + "title": "ADF-DOCUMENT-LIST.LAYOUT.NAME", + "cssClass": "full-width ellipsis-cell", + "sortable": true + }, + { + "key": "path", + "type": "location", + "title": "ADF-DOCUMENT-LIST.LAYOUT.LOCATION", + "cssClass": "ellipsis-cell", + "format": "/files", + "sortable": true + }, + { + "key": "content.sizeInBytes", + "type": "fileSize", + "title": "ADF-DOCUMENT-LIST.LAYOUT.SIZE", + "sortable": true + }, + { + "key": "modifiedAt", + "type": "date", + "title": "ADF-DOCUMENT-LIST.LAYOUT.MODIFIED_ON", + "format": "timeAgo", + "sortable": true + }, + { + "key": "modifiedByUser.displayName", + "type": "text", + "title": "ADF-DOCUMENT-LIST.LAYOUT.MODIFIED_BY", + "sortable": true + }, + { + "key": "sharedByUser.displayName", + "type": "text", + "title": "ADF-DOCUMENT-LIST.LAYOUT.SHARED_BY", + "sortable": true + } + ], + "default": [ + { + "key": "$thumbnail", + "type": "image", + "srTitle": "ADF-DOCUMENT-LIST.LAYOUT.THUMBNAIL", + "sortable": false + }, + { + "key": "name", + "type": "text", + "title": "ADF-DOCUMENT-LIST.LAYOUT.NAME", + "cssClass": "full-width ellipsis-cell", + "sortable": true + }, + { + "key": "content.sizeInBytes", + "type": "fileSize", + "title": "ADF-DOCUMENT-LIST.LAYOUT.SIZE", + "sortable": true + }, + { + "key": "modifiedAt", + "type": "date", + "title": "ADF-DOCUMENT-LIST.LAYOUT.MODIFIED_ON", + "format": "timeAgo", + "sortable": true + }, + { + "key": "modifiedByUser.displayName", + "type": "text", + "title": "ADF-DOCUMENT-LIST.LAYOUT.MODIFIED_BY", + "sortable": true + } + ] + } } } diff --git a/demo-shell-ng2/app/app.component.html b/demo-shell-ng2/app/app.component.html index 92feb690989..90c6b646328 100644 --- a/demo-shell-ng2/app/app.component.html +++ b/demo-shell-ng2/app/app.component.html @@ -1,80 +1 @@ - - - - - ADF Demo Application - -
- - - - Home - Content Services - Process Services - Login - - - - - - - - - - - - - extension - DL: Custom Sources - - - view_module - DataTable - - - poll - Form - - - library_books - Form List - - - file_upload - Uploader - - - extension - Webscript - - - local_offer - Tag - - - thumb_up - Social - - - settings - Settings - - - info_outline - About - - - -
- - + \ No newline at end of file diff --git a/demo-shell-ng2/app/app.component.scss b/demo-shell-ng2/app/app.component.scss deleted file mode 100644 index 66c299f9010..00000000000 --- a/demo-shell-ng2/app/app.component.scss +++ /dev/null @@ -1,24 +0,0 @@ -.user-profile { - margin-right: 10px; -} - -.app-menu--spacer { - flex: 1 1 auto; -} - -.p-10 { - padding: 10px; -} - -.m-10 { - margin: 10px; -} - -._dialog_overlay { - position: static !important; -} - -.md-simple-snackbar-action { - border: 0px; - cursor: pointer; -} diff --git a/demo-shell-ng2/app/app.component.ts b/demo-shell-ng2/app/app.component.ts index c95712a3c2e..d25c345123a 100644 --- a/demo-shell-ng2/app/app.component.ts +++ b/demo-shell-ng2/app/app.component.ts @@ -16,73 +16,25 @@ */ import { Component, ViewEncapsulation } from '@angular/core'; -import { Router } from '@angular/router'; -import { - AlfrescoAuthenticationService, - AlfrescoSettingsService, - AlfrescoTranslationService, - LogService, - StorageService -} from 'ng2-alfresco-core'; - -declare var document: any; +import { ActivatedRoute, Router } from '@angular/router'; +import { AlfrescoSettingsService, PageTitleService, StorageService } from 'ng2-alfresco-core'; @Component({ selector: 'adf-app', templateUrl: './app.component.html', - styleUrls: ['./app.component.scss', './theme.scss'], + styleUrls: ['./theme.scss'], encapsulation: ViewEncapsulation.None }) export class AppComponent { searchTerm: string = ''; - constructor(private authService: AlfrescoAuthenticationService, - private router: Router, - private settingsService: AlfrescoSettingsService, - private translateService: AlfrescoTranslationService, + constructor(private settingsService: AlfrescoSettingsService, private storage: StorageService, - private logService: LogService) { + pageTitleService: PageTitleService, + route: ActivatedRoute, + router: Router) { this.setProvider(); - } - - isAPageWithHeaderBar(): boolean { - return location.pathname === '/login' || location.pathname === '/settings'; - } - - onLogout(event) { - event.preventDefault(); - this.authService.logout() - .subscribe( - () => { - this.navigateToLogin(); - }, - (error: any) => { - if (error && error.response && error.response.status === 401) { - this.navigateToLogin(); - } else { - this.logService.error('An unknown error occurred while logging out', error); - this.navigateToLogin(); - } - } - ); - } - - navigateToLogin() { - this.router.navigate(['/login']); - } - - onToggleSearch(event) { - let expandedHeaderClass = 'header-search-expanded', - header = document.querySelector('header'); - if (event.expanded) { - header.classList.add(expandedHeaderClass); - } else { - header.classList.remove(expandedHeaderClass); - } - } - - changeLanguage(lang: string) { - this.translateService.use(lang); + pageTitleService.setTitle(); } private setProvider() { diff --git a/demo-shell-ng2/app/app.module.ts b/demo-shell-ng2/app/app.module.ts index d184360c00c..c5073419f35 100644 --- a/demo-shell-ng2/app/app.module.ts +++ b/demo-shell-ng2/app/app.module.ts @@ -31,15 +31,18 @@ import { SearchModule } from 'ng2-alfresco-search'; import { SocialModule } from 'ng2-alfresco-social'; import { TagModule } from 'ng2-alfresco-tag'; import { UploadModule } from 'ng2-alfresco-upload'; -import { UserInfoComponentModule } from 'ng2-alfresco-userinfo'; +import { UserInfoModule } from 'ng2-alfresco-userinfo'; import { ViewerModule } from 'ng2-alfresco-viewer'; import { WebScriptModule } from 'ng2-alfresco-webscript'; +import { FlexLayoutModule } from '@angular/flex-layout'; import { Editor3DModule } from 'ng2-3d-editor'; import { ChartsModule } from 'ng2-charts'; import { AppComponent } from './app.component'; import { routing } from './app.routes'; import { CustomEditorsModule } from './components/activiti/custom-editor/custom-editor.component'; +import { AppLayoutComponent } from './components/app-layout/app-layout.component'; +import { FileViewComponent } from './components/file-view/file-view.component'; import { FormListDemoComponent } from './components/form/form-list-demo.component'; import { ThemePickerModule } from './components/theme-picker/theme-picker'; import { MaterialModule } from './material.module'; @@ -69,38 +72,32 @@ import { WebscriptComponent } from './components/index'; -let appConfigFile = 'app.config-dev.json'; -if (process.env.ENV === 'production') { - appConfigFile = 'app.config-prod.json'; -} - @NgModule({ imports: [ BrowserModule, routing, - CoreModule.forRoot({ - appConfigFile: appConfigFile - }), + CoreModule, MaterialModule, - LoginModule.forRoot(), - SearchModule.forRoot(), - DataTableModule.forRoot(), - DocumentListModule.forRoot(), - UploadModule.forRoot(), - TagModule.forRoot(), - SocialModule.forRoot(), - WebScriptModule.forRoot(), - ViewerModule.forRoot(), - ActivitiFormModule.forRoot(), - ActivitiTaskListModule.forRoot(), - ActivitiProcessListModule.forRoot(), - UserInfoComponentModule.forRoot(), - AnalyticsModule.forRoot(), - DiagramsModule.forRoot(), + LoginModule, + SearchModule, + DataTableModule, + DocumentListModule, + UploadModule, + TagModule, + SocialModule, + WebScriptModule, + ViewerModule, + ActivitiFormModule, + ActivitiTaskListModule, + ActivitiProcessListModule, + UserInfoModule, + AnalyticsModule, + DiagramsModule, CustomEditorsModule, - Editor3DModule.forRoot(), + Editor3DModule, ChartsModule, - ThemePickerModule + ThemePickerModule, + FlexLayoutModule ], declarations: [ AppComponent, @@ -124,7 +121,9 @@ if (process.env.ENV === 'production') { SettingsComponent, FormDemoComponent, FormListDemoComponent, - CustomSourcesComponent + CustomSourcesComponent, + FileViewComponent, + AppLayoutComponent ], providers: [ { provide: AppConfigService, useClass: DebugAppConfigService }, diff --git a/demo-shell-ng2/app/app.routes.ts b/demo-shell-ng2/app/app.routes.ts index ecc6bea0a93..829aab11ada 100644 --- a/demo-shell-ng2/app/app.routes.ts +++ b/demo-shell-ng2/app/app.routes.ts @@ -18,6 +18,7 @@ import { ModuleWithProviders } from '@angular/core'; import { RouterModule, Routes } from '@angular/router'; import { AuthGuard, AuthGuardBpm, AuthGuardEcm } from 'ng2-alfresco-core'; +import { AppLayoutComponent } from './components/app-layout/app-layout.component'; import { AboutComponent, @@ -39,113 +40,119 @@ import { } from './components/index'; import { UploadButtonComponent } from 'ng2-alfresco-upload'; +import { FileViewComponent } from './components/file-view/file-view.component'; import { CustomSourcesComponent } from './components/files/custom-sources.component'; import { FormListDemoComponent } from './components/form/form-list-demo.component'; export const appRoutes: Routes = [ { path: 'login', component: LoginDemoComponent }, + { path: 'settings', component: SettingsComponent }, + { path: 'files/:nodeId/view', component: FileViewComponent, canActivate: [ AuthGuardEcm ] }, { path: '', - component: HomeComponent, - canActivate: [AuthGuard] - }, - { - path: 'home', - component: HomeComponent, - canActivate: [AuthGuard] - }, - { - path: 'files', - component: FilesComponent, - canActivate: [AuthGuardEcm] - }, - { - path: 'files/:id', - component: FilesComponent, - canActivate: [AuthGuardEcm] - }, - { - path: 'dl-custom-sources', - component: CustomSourcesComponent, - canActivate: [AuthGuardEcm] - }, - { - path: 'datatable', - component: DataTableDemoComponent, - canActivate: [AuthGuard] - }, - { - path: 'uploader', - component: UploadButtonComponent, - canActivate: [AuthGuardEcm] - }, - { - path: 'search', - component: SearchComponent, - canActivate: [AuthGuardEcm] - }, - { - path: 'activiti', - component: ActivitiAppsViewComponent, - canActivate: [AuthGuardBpm] - }, - { - path: 'activiti/apps', - component: ActivitiAppsViewComponent, - canActivate: [AuthGuardBpm] - }, - { - path: 'activiti/apps/:appId/tasks', - component: ActivitiDemoComponent, - canActivate: [AuthGuardBpm] - }, - { - path: 'activiti/apps/:appId/processes', - component: ActivitiDemoComponent, - canActivate: [AuthGuardBpm] - }, - { - path: 'activiti/apps/:appId/diagram/:processDefinitionId', - component: ActivitiShowDiagramComponent, - canActivate: [AuthGuardBpm] - }, - // TODO: check if neeeded - { - path: 'activiti/appId/:appId', - component: ActivitiDemoComponent, - canActivate: [AuthGuardBpm] - }, - // TODO: check if needed - { - path: 'activiti/tasks/:id', - component: FormViewerComponent, - canActivate: [AuthGuardBpm] - }, - // TODO: check if needed - { - path: 'activiti/tasksnode/:id', - component: FormNodeViewerComponent, - canActivate: [AuthGuardBpm] - }, - { - path: 'webscript', - component: WebscriptComponent, - canActivate: [AuthGuardEcm] - }, - { - path: 'tag', - component: TagComponent, - canActivate: [AuthGuardEcm] - }, - { - path: 'social', - component: SocialComponent, - canActivate: [AuthGuardEcm] - }, - { path: 'about', component: AboutComponent }, - { path: 'settings', component: SettingsComponent }, - { path: 'form', component: FormDemoComponent }, - { path: 'form-list', component: FormListDemoComponent } + component: AppLayoutComponent, + canActivate: [AuthGuard], + children: [ + { + path: '', + component: HomeComponent + }, + { + path: 'home', + component: HomeComponent + }, + { + path: 'files', + component: FilesComponent, + canActivate: [AuthGuardEcm] + }, + { + path: 'files/:id', + component: FilesComponent, + canActivate: [AuthGuardEcm] + }, + { + path: 'dl-custom-sources', + component: CustomSourcesComponent, + canActivate: [AuthGuardEcm] + }, + { + path: 'datatable', + component: DataTableDemoComponent + }, + { + path: 'uploader', + component: UploadButtonComponent, + canActivate: [AuthGuardEcm] + }, + { + path: 'search', + component: SearchComponent, + canActivate: [AuthGuardEcm] + }, + { + path: 'activiti', + component: ActivitiAppsViewComponent, + canActivate: [AuthGuardBpm] + }, + { + path: 'activiti/apps', + component: ActivitiAppsViewComponent, + canActivate: [AuthGuardBpm] + }, + { + path: 'activiti/apps/:appId/tasks', + component: ActivitiDemoComponent, + canActivate: [AuthGuardBpm] + }, + { + path: 'activiti/apps/:appId/processes', + component: ActivitiDemoComponent, + canActivate: [AuthGuardBpm] + }, + { + path: 'activiti/apps/:appId/diagram/:processDefinitionId', + component: ActivitiShowDiagramComponent, + canActivate: [AuthGuardBpm] + }, + // TODO: check if neeeded + { + path: 'activiti/appId/:appId', + component: ActivitiDemoComponent, + canActivate: [AuthGuardBpm] + }, + // TODO: check if needed + { + path: 'activiti/tasks/:id', + component: FormViewerComponent, + canActivate: [AuthGuardBpm] + }, + // TODO: check if needed + { + path: 'activiti/tasksnode/:id', + component: FormNodeViewerComponent, + canActivate: [AuthGuardBpm] + }, + { + path: 'webscript', + component: WebscriptComponent, + canActivate: [AuthGuardEcm] + }, + { + path: 'tag', + component: TagComponent, + canActivate: [AuthGuardEcm] + }, + { + path: 'social', + component: SocialComponent, + canActivate: [AuthGuardEcm] + }, + { path: 'about', component: AboutComponent }, + { path: 'form', component: FormDemoComponent }, + { path: 'form-list', component: FormListDemoComponent } + ] + } ]; export const routing: ModuleWithProviders = RouterModule.forRoot(appRoutes); diff --git a/demo-shell-ng2/app/components/about/about.component.html b/demo-shell-ng2/app/components/about/about.component.html index 284fd42d37e..ac9815a75f7 100644 --- a/demo-shell-ng2/app/components/about/about.component.html +++ b/demo-shell-ng2/app/components/about/about.component.html @@ -16,20 +16,7 @@

Product Versions

BPM

{{ bpmVersion.edition }}

- - - - - - - - - - - - - -
Major VersionRevision VersionMinor VersionType
{{ bpmVersion.majorVersion }}{{ bpmVersion.revisionVersion }}{{ bpmVersion.minorVersion }}{{ bpmVersion.type }}
+ {{ bpmVersion.majorVersion }}.{{ bpmVersion.minorVersion }}.{{ bpmVersion.revisionVersion }}

ECM

@@ -38,64 +25,14 @@

ECM

{{ ecmVersion.version.display }}

License

- - - - - - - - - - - - - - - - - - - -
Issued At Expires At Remaining Days Holder Mode Is Cluster Enabled Is Cryptodoc Enable
{{ ecmVersion.license.issuedAt }}{{ ecmVersion.license.expiresAt }}{{ ecmVersion.license.remainingDays }}{{ ecmVersion.license.holder }}{{ ecmVersion.license.mode }}{{ ecmVersion.license.isClusterEnabled }}{{ ecmVersion.license.isCryptodocEnabled }}
+ +

Status

- - - - - - - - - - - - - -
ReadOnly Is Audit Enable Is quick shared enable Thumbnail Generation
{{ ecmVersion.status.isReadOnly }}{{ ecmVersion.status.isAuditEnabled }}{{ ecmVersion.status.isQuickShareEnabled }}{{ ecmVersion.status.isThumbnailGenerationEnabled }}
+ +

Modules

- - - - - - - - - - - - - - - - - - - - - -
ID Title Description Version Install Date Install State Version Minor Version Max
{{ module.id }}{{ module.title }}{{ module.description }}{{ module.version }}{{ module.installDate }}{{ module.installState }}{{ module.versionMin }}{{ module.versionMax }}
+ +
@@ -108,5 +45,5 @@

Source code

Packages

Current project is using the following ADF libraries: - +
diff --git a/demo-shell-ng2/app/components/about/about.component.ts b/demo-shell-ng2/app/components/about/about.component.ts index 5b54dc5b33a..130b6f72e12 100644 --- a/demo-shell-ng2/app/components/about/about.component.ts +++ b/demo-shell-ng2/app/components/about/about.component.ts @@ -17,20 +17,23 @@ import { Component, OnInit } from '@angular/core'; import { Http } from '@angular/http'; -import { AlfrescoAuthenticationService, AppConfigService, BpmProductVersionModel, DiscoveryApiService, EcmProductVersionModel, LogService } from 'ng2-alfresco-core'; +import { AlfrescoAuthenticationService, AppConfigService, BpmProductVersionModel, DiscoveryApiService, EcmProductVersionModel } from 'ng2-alfresco-core'; import { ObjectDataTableAdapter } from 'ng2-alfresco-datatable'; @Component({ - selector: 'about-page', + selector: 'adf-about-page', templateUrl: './about.component.html', styleUrls: ['./about.component.css'] }) export class AboutComponent implements OnInit { data: ObjectDataTableAdapter; + status: ObjectDataTableAdapter; + license: ObjectDataTableAdapter; + modules: ObjectDataTableAdapter; githubUrlCommitAlpha: string = 'https://github.com/Alfresco/alfresco-ng2-components/commits/'; - configFile: string = ''; + configFile: string = 'app.config.json'; ecmHost: string = ''; bpmHost: string = ''; @@ -40,7 +43,6 @@ export class AboutComponent implements OnInit { constructor(private http: Http, private appConfig: AppConfigService, private authService: AlfrescoAuthenticationService, - private logService: LogService, private discovery: DiscoveryApiService) { } @@ -49,6 +51,33 @@ export class AboutComponent implements OnInit { if (this.authService.isEcmLoggedIn()) { this.discovery.getEcmProductInfo().subscribe((ecmVers) => { this.ecmVersion = ecmVers; + + this.modules = new ObjectDataTableAdapter(this.ecmVersion.modules, [ + {type: 'text', key: 'id', title: 'ID', sortable: true}, + {type: 'text', key: 'title', title: 'Title', sortable: true}, + {type: 'text', key: 'version', title: 'Description', sortable: true}, + {type: 'text', key: 'installDate', title: 'Install Date', sortable: true}, + {type: 'text', key: 'installState', title: 'Install State', sortable: true}, + {type: 'text', key: 'versionMin', title: 'Version Minor', sortable: true}, + {type: 'text', key: 'versionMax', title: 'Version Max', sortable: true} + ]); + + this.status = new ObjectDataTableAdapter([this.ecmVersion.status], [ + {type: 'text', key: 'isReadOnly', title: 'ReadOnly', sortable: true}, + {type: 'text', key: 'isAuditEnabled', title: 'Is Audit Enable', sortable: true}, + {type: 'text', key: 'isQuickShareEnabled', title: 'Is quick shared enable', sortable: true}, + {type: 'text', key: 'isThumbnailGenerationEnabled', title: 'Thumbnail Generation', sortable: true} + ]); + + this.license = new ObjectDataTableAdapter([this.ecmVersion.license], [ + {type: 'text', key: 'issuedAt', title: 'Issued At', sortable: true}, + {type: 'text', key: 'expiresAt', title: 'Expires At', sortable: true}, + {type: 'text', key: 'remainingDays', title: 'Remaining Days', sortable: true}, + {type: 'text', key: 'holder', title: 'Holder', sortable: true}, + {type: 'text', key: 'mode', title: 'Is Cluster Enabled', sortable: true}, + {type: 'text', key: 'isClusterEnabled', title: 'Is Cluster Enabled', sortable: true}, + {type: 'text', key: 'isCryptodocEnabled', title: 'Is Cryptodoc Enable', sortable: true} + ]); }); } @@ -62,13 +91,11 @@ export class AboutComponent implements OnInit { let regexp = new RegExp('^(ng2-activiti|ng2-alfresco|alfresco-)'); let alfrescoPackages = Object.keys(response.json().dependencies).filter((val) => { - this.logService.log(val); return regexp.test(val); }); let alfrescoPackagesTableRepresentation = []; alfrescoPackages.forEach((val) => { - this.logService.log(response.json().dependencies[val]); alfrescoPackagesTableRepresentation.push({ name: val, version: response.json().dependencies[val].version @@ -77,15 +104,13 @@ export class AboutComponent implements OnInit { this.gitHubLinkCreation(alfrescoPackagesTableRepresentation); - this.logService.log(alfrescoPackagesTableRepresentation); - this.data = new ObjectDataTableAdapter(alfrescoPackagesTableRepresentation, [ {type: 'text', key: 'name', title: 'Name', sortable: true}, {type: 'text', key: 'version', title: 'Version', sortable: true} ]); + }); - this.configFile = this.appConfig.configFile; this.ecmHost = this.appConfig.get('ecmHost'); this.bpmHost = this.appConfig.get('bpmHost'); } diff --git a/demo-shell-ng2/app/components/activiti/activiti-demo.component.css b/demo-shell-ng2/app/components/activiti/activiti-demo.component.css deleted file mode 100644 index cb7bea8cf30..00000000000 --- a/demo-shell-ng2/app/components/activiti/activiti-demo.component.css +++ /dev/null @@ -1,88 +0,0 @@ -.activiti-task-list__item:hover { - cursor: pointer; - font-weight: bold; -} - -.task-column { - padding: 10px 10px 10px 10px; -} - -.mdl-layout__header { - z-index: 1; -} - -.list-buttons { - text-align: left; - margin-bottom: 5px; -} - -.adf-no-form-container { - text-align: center; - font-weight: 600; - font-size: 18px; - font-family: Muli; - padding: 16px; -} - -.action-header { - border: 1px solid ; - text-align: left; -} - -.activiti-demo-grid { - display: flex; -} - -.activiti-demo-grid-item { - margin: 4px; - box-shadow: 0 2px 2px 0 rgba(0,0,0,.14), 0 3px 1px -2px rgba(0,0,0,.2), 0 1px 5px 0 rgba(0,0,0,.12); - padding: 10px 10px 10px 10px; -} - -.activiti-demo-list-buttons { - margin-bottom: 24px; -} - -.activiti-demo-list-buttons-start { - width: 100%; -} - -.activiti-demo-tasks-menu { - min-width: 170px; -} - -.activiti-demo-tasks-list { - min-width: 510px; - padding: 0; -} - -.activiti-demo-tasks-details, -.activiti-demo-tasks-start { - flex-grow: 1; - min-width: 680px; -} - -.activiti-demo-tasks-list >>> .adf-data-table { - border: none; -} - -.activiti-demo-tasks-list >>> .adf-data-table tr, -.activiti-demo-tasks-list >>> .adf-data-table td { - height: 36px; - font-size: 14px; -} - -.activiti-demo-tasks-list >>> .adf-data-table td { - padding-top: 0; - padding-bottom: 0; - border-bottom: none; -} - -.activiti-demo-tasks-list >>> .adf-data-table th { - padding-top: 0; - padding-bottom: 0; - height: 40px; - vertical-align: middle; - font-size: 14px; -} - diff --git a/demo-shell-ng2/app/components/activiti/activiti-demo.component.html b/demo-shell-ng2/app/components/activiti/activiti-demo.component.html index 168554bf11c..b91c008e984 100644 --- a/demo-shell-ng2/app/components/activiti/activiti-demo.component.html +++ b/demo-shell-ng2/app/components/activiti/activiti-demo.component.html @@ -1,8 +1,8 @@
-
-
+
+
-
- - +
-
- + - +
{{'PS-TAB.AUDIT-LOG' | translate}} @@ -92,7 +90,7 @@
-
+
-
-
-
+
+
+
-
- - +
-
- + - +
- {{'PS-TAB.START-PROCESS' | translate}} + {{'PS-TAB.AUDIT-LOG' | translate}}
-
-
-
+
+
Report List

-
- + - +
{{'ANALYTICS_REPORT.NO_REPORT_MESSAGE' | translate}}
diff --git a/demo-shell-ng2/app/components/activiti/activiti-demo.component.scss b/demo-shell-ng2/app/components/activiti/activiti-demo.component.scss new file mode 100644 index 00000000000..3b297a204a6 --- /dev/null +++ b/demo-shell-ng2/app/components/activiti/activiti-demo.component.scss @@ -0,0 +1,106 @@ + +.adf-no-form-container { + text-align: center; + font-weight: 600; + font-size: 18px; +} + +.activiti-demo-grid { + + .activiti-demo-grid-item { + margin: 4px; + box-shadow: 0 2px 2px 0 rgba(0,0,0,.14), 0 3px 1px -2px rgba(0,0,0,.2), 0 1px 5px 0 rgba(0,0,0,.12); + padding: 10px; + } + + .activiti-demo-list-buttons { + margin-bottom: 24px; + } + + .activiti-demo-list-buttons-start { + width: 100%; + } + + .activiti-demo-tasks-list.small-pagination, + .activiti-demo-processes-list.small-pagination { + .adf-pagination { + + flex-wrap: wrap; + padding-bottom: 24px; + padding-top: 8px; + + &__block { + border-right: none; + } + + &__range-block.adf-pagination__block:first-child { + order: 1; + width: 60%; + flex: 0 0 auto; + box-sizing: border-box; + padding-left: 2px; + justify-content: flex-start; + } + + &__perpage-block { + order: 3; + width: 60%; + box-sizing: border-box; + padding-left: 2px; + justify-content: flex-start; + } + + &__actualinfo-block { + order: 2; + width: 40%; + box-sizing: border-box; + padding-right: 2px; + justify-content: flex-end; + } + + &__controls-block { + order: 4; + width: 40%; + box-sizing: border-box; + padding-right: 2px; + justify-content: flex-end; + } + } + } + + .activiti-demo-list { + .adf-data-table { + border: none; + } + + .adf-data-table tr, + .adf-data-table td { + height: 36px; + font-size: 14px; + } + + .adf-data-table td { + padding-top: 0; + padding-bottom: 0; + border-bottom: none; + } + + .adf-data-table th { + padding-top: 0; + padding-bottom: 0; + height: 40px; + vertical-align: middle; + font-size: 14px; + } + } + + @media screen and (max-width: 1279px) { + container-widget .grid-list { + flex-direction: column; + + .grid-list-item { + width: 100% !important; + } + } + } +} diff --git a/demo-shell-ng2/app/components/activiti/activiti-demo.component.ts b/demo-shell-ng2/app/components/activiti/activiti-demo.component.ts index 8ad9141f2d4..bcde6be5abf 100644 --- a/demo-shell-ng2/app/components/activiti/activiti-demo.component.ts +++ b/demo-shell-ng2/app/components/activiti/activiti-demo.component.ts @@ -16,11 +16,14 @@ */ // tslint:disable-next-line:adf-file-name -import { AfterViewInit, Component, ElementRef, Input, OnDestroy, OnInit, ViewChild } from '@angular/core'; +import { AfterViewInit, Component, ElementRef, Input, OnDestroy, OnInit, ViewChild, ViewEncapsulation } from '@angular/core'; import { ActivatedRoute, Router } from '@angular/router'; import { Pagination } from 'alfresco-js-api'; import { AnalyticsReportListComponent } from 'ng2-activiti-analytics'; -import { FORM_FIELD_VALIDATORS, FormEvent, FormFieldEvent, FormRenderingService, FormService } from 'ng2-activiti-form'; +import { + DynamicTableRow, FORM_FIELD_VALIDATORS, FormEvent, FormFieldEvent, FormRenderingService, + FormService, ValidateDynamicTableRowEvent +} from 'ng2-activiti-form'; import { FilterProcessRepresentationModel, ProcessFiltersComponent, @@ -48,15 +51,14 @@ import { Subscription } from 'rxjs/Rx'; import { /*CustomEditorComponent*/ CustomStencil01 } from './custom-editor/custom-editor.component'; import { DemoFieldValidator } from './demo-field-validator'; -declare var componentHandler; - const currentProcessIdNew = '__NEW__'; const currentTaskIdNew = '__NEW__'; @Component({ - selector: 'activiti-demo', + selector: 'adf-activiti-demo', templateUrl: './activiti-demo.component.html', - styleUrls: ['./activiti-demo.component.css'] + styleUrls: ['./activiti-demo.component.scss'], + encapsulation: ViewEncapsulation.None }) export class ActivitiDemoComponent implements AfterViewInit, OnDestroy, OnInit { @@ -90,7 +92,7 @@ export class ActivitiDemoComponent implements AfterViewInit, OnDestroy, OnInit { fileShowed: boolean = false; selectFirstReport: boolean = false; - private tabs = { tasks : 0 , processes : 1, reports: 2}; + private tabs = { tasks: 0, processes: 1, reports: 2 }; content: Blob; contentName: string; @@ -99,14 +101,14 @@ export class ActivitiDemoComponent implements AfterViewInit, OnDestroy, OnInit { currentTaskId: string; currentProcessInstanceId: string; - taskSchemaColumns: any [] = []; + taskSchemaColumns: any[] = []; taskPagination: Pagination = { skipCount: 0, maxItems: 10, totalItems: 0 }; taskPage: number = 0; - processSchemaColumns: any [] = []; + processSchemaColumns: any[] = []; activeTab: number = this.tabs.tasks; // tasks|processes|reports @@ -159,6 +161,17 @@ export class ActivitiDemoComponent implements AfterViewInit, OnDestroy, OnInit { console.log(`Field value changed. Form: ${e.form.id}, Field: ${e.field.id}, Value: ${e.field.value}`); }); + formService.validateDynamicTableRow.subscribe( + (e: ValidateDynamicTableRowEvent) => { + const row: DynamicTableRow = e.row; + if (row && row.value && row.value.name === 'admin') { + e.summary.isValid = false; + e.summary.text = 'Sorry, wrong value. You cannot use "admin".'; + e.preventDefault(); + } + } + ); + // Uncomment this block to see form event handling in action /* formService.formEvents.subscribe((event: Event) => { @@ -199,13 +212,13 @@ export class ActivitiDemoComponent implements AfterViewInit, OnDestroy, OnInit { ngOnInit() { this.taskListService.tasksList$.subscribe( (tasks) => { - this.taskPagination = {count: tasks.data.length, maxItems: this.taskPagination.maxItems, skipCount: this.taskPagination.skipCount, totalItems: tasks.total}; - console.log({count: tasks.data.length, maxItems: this.taskPagination.maxItems, skipCount: this.taskPagination.skipCount, totalItems: tasks.total}); + this.taskPagination = { count: tasks.data.length, maxItems: this.taskPagination.maxItems, skipCount: this.taskPagination.skipCount, totalItems: tasks.total }; + console.log({ count: tasks.data.length, maxItems: this.taskPagination.maxItems, skipCount: this.taskPagination.skipCount, totalItems: tasks.total }); }, (err) => { - console.log('err'); - }); + console.log('err' + err); + }); - if (this.router.url.includes('processes') ) { + if (this.router.url.includes('processes')) { this.activeTab = this.tabs.processes; } this.sub = this.route.params.subscribe(params => { @@ -225,6 +238,7 @@ export class ActivitiDemoComponent implements AfterViewInit, OnDestroy, OnInit { ngOnDestroy() { this.sub.unsubscribe(); + this.taskListService.tasksList$.subscribe(); } onTaskFilterClick(filter: FilterRepresentationModel): void { @@ -277,6 +291,16 @@ export class ActivitiDemoComponent implements AfterViewInit, OnDestroy, OnInit { this.currentTaskId = taskId; } + onTaskRowDblClick(event: CustomEvent) { + const taskId = event.detail.value.obj.id; + this.currentTaskId = taskId; + } + + onProcessRowDblClick(event: CustomEvent) { + const processInstanceId = event.detail.value.obj.id; + this.currentProcessInstanceId = processInstanceId; + } + onProcessRowClick(processInstanceId): void { this.currentProcessInstanceId = processInstanceId; } @@ -309,7 +333,7 @@ export class ActivitiDemoComponent implements AfterViewInit, OnDestroy, OnInit { onStartProcessInstance(instance: ProcessInstance): void { this.currentProcessInstanceId = instance.id; this.activitiStartProcess.reset(); - this.resetProcessFilters(); + this.activitiprocessfilter.selectRunningFilter(); } onCancelProcessInstance() { @@ -369,11 +393,6 @@ export class ActivitiDemoComponent implements AfterViewInit, OnDestroy, OnInit { } ngAfterViewInit() { - // workaround for MDL issues with dynamic components - if (componentHandler) { - componentHandler.upgradeAllRegistered(); - } - this.loadStencilScriptsInPageFromActiviti(); } @@ -403,8 +422,10 @@ export class ActivitiDemoComponent implements AfterViewInit, OnDestroy, OnInit { created: event.value.created }); this.activitifilter.selectFilter(null); - this.taskList.setCustomDataSource([processTaskDataRow]); - this.taskList.selectTask(taskId); + if (this.taskList) { + this.taskList.setCustomDataSource([processTaskDataRow]); + this.taskList.selectTask(taskId); + } this.currentTaskId = taskId; } diff --git a/demo-shell-ng2/app/components/activiti/activiti-process-attachments.component.css b/demo-shell-ng2/app/components/activiti/activiti-process-attachments.component.css index 5aadf220a03..5989db0e26c 100644 --- a/demo-shell-ng2/app/components/activiti/activiti-process-attachments.component.css +++ b/demo-shell-ng2/app/components/activiti/activiti-process-attachments.component.css @@ -1,3 +1,3 @@ -adf-create-process-attachment >>> button { +adf-create-process-attachment ::ng-deep button { float: right; } diff --git a/demo-shell-ng2/app/components/activiti/activiti-process-attachments.component.html b/demo-shell-ng2/app/components/activiti/activiti-process-attachments.component.html index 2fe07f5a1c6..40c432c332c 100644 --- a/demo-shell-ng2/app/components/activiti/activiti-process-attachments.component.html +++ b/demo-shell-ng2/app/components/activiti/activiti-process-attachments.component.html @@ -3,15 +3,18 @@
Attachments
@@ -20,10 +23,10 @@
Attachments
- - +
diff --git a/demo-shell-ng2/app/components/activiti/activiti-process-attachments.component.ts b/demo-shell-ng2/app/components/activiti/activiti-process-attachments.component.ts index 0c317b6b9ad..487faefa465 100644 --- a/demo-shell-ng2/app/components/activiti/activiti-process-attachments.component.ts +++ b/demo-shell-ng2/app/components/activiti/activiti-process-attachments.component.ts @@ -15,8 +15,9 @@ * limitations under the License. */ -import { Component, Input, OnInit, ViewChild } from '@angular/core'; +import { Component, Input, OnChanges, OnInit, ViewChild } from '@angular/core'; import { ProcessAttachmentListComponent, ProcessUploadService } from 'ng2-activiti-processlist'; +import { ProcessInstance, ProcessService } from 'ng2-activiti-processlist'; import { UploadService } from 'ng2-alfresco-core'; @Component({ @@ -24,11 +25,11 @@ import { UploadService } from 'ng2-alfresco-core'; templateUrl: './activiti-process-attachments.component.html', styleUrls: ['./activiti-process-attachments.component.css'], providers: [ - { provide: UploadService, useClass: ProcessUploadService } + {provide: UploadService, useClass: ProcessUploadService} ] }) -export class ActivitiProcessAttachmentsComponent implements OnInit { +export class ActivitiProcessAttachmentsComponent implements OnInit, OnChanges { @Input() processId: string; @@ -39,15 +40,23 @@ export class ActivitiProcessAttachmentsComponent implements OnInit { fileShowed: boolean = false; content: Blob; contentName: string; + processInstance: ProcessInstance; - constructor(private uploadService: UploadService) { - + constructor(private uploadService: UploadService, private processService: ProcessService) { } ngOnInit() { this.uploadService.fileUploadComplete.subscribe(value => this.onFileUploadComplete(value.data)); } + ngOnChanges() { + if (this.processId) { + this.processService.getProcess(this.processId).subscribe((processInstance: ProcessInstance) => { + this.processInstance = processInstance; + }); + } + } + onFileUploadComplete(content: any) { this.processAttachList.add(content); } @@ -58,4 +67,8 @@ export class ActivitiProcessAttachmentsComponent implements OnInit { this.contentName = content.name; } + isCompletedProcess(): boolean { + return this.processInstance && this.processInstance.ended !== undefined && this.processInstance.ended !== null; + } + } diff --git a/demo-shell-ng2/app/components/activiti/activiti-show-diagram.component.html b/demo-shell-ng2/app/components/activiti/activiti-show-diagram.component.html index fb812041e8c..6bac0d752a1 100644 --- a/demo-shell-ng2/app/components/activiti/activiti-show-diagram.component.html +++ b/demo-shell-ng2/app/components/activiti/activiti-show-diagram.component.html @@ -1,4 +1,4 @@
- +
diff --git a/demo-shell-ng2/app/components/activiti/activiti-task-attachments.component.css b/demo-shell-ng2/app/components/activiti/activiti-task-attachments.component.css index b2f81426048..b267b82e421 100644 --- a/demo-shell-ng2/app/components/activiti/activiti-task-attachments.component.css +++ b/demo-shell-ng2/app/components/activiti/activiti-task-attachments.component.css @@ -1,3 +1,3 @@ -adf-create-task-attachment >>> button { +adf-create-task-attachment ::ng-deep button { float: right; } diff --git a/demo-shell-ng2/app/components/activiti/activiti-task-attachments.component.html b/demo-shell-ng2/app/components/activiti/activiti-task-attachments.component.html index 72871b82b6c..614eb855bf9 100644 --- a/demo-shell-ng2/app/components/activiti/activiti-task-attachments.component.html +++ b/demo-shell-ng2/app/components/activiti/activiti-task-attachments.component.html @@ -3,15 +3,18 @@
Attachments
@@ -20,10 +23,10 @@
Attachments
- - +
diff --git a/demo-shell-ng2/app/components/activiti/activiti-task-attachments.component.ts b/demo-shell-ng2/app/components/activiti/activiti-task-attachments.component.ts index 4d5cda21326..e10f87513cc 100644 --- a/demo-shell-ng2/app/components/activiti/activiti-task-attachments.component.ts +++ b/demo-shell-ng2/app/components/activiti/activiti-task-attachments.component.ts @@ -15,8 +15,9 @@ * limitations under the License. */ -import { Component, Input, OnInit, ViewChild } from '@angular/core'; +import { Component, Input, OnChanges, OnInit, ViewChild } from '@angular/core'; import { ProcessUploadService, TaskAttachmentListComponent } from 'ng2-activiti-tasklist'; +import { ActivitiTaskListService } from 'ng2-activiti-tasklist'; import { UploadService } from 'ng2-alfresco-core'; @Component({ @@ -28,7 +29,7 @@ import { UploadService } from 'ng2-alfresco-core'; ] }) -export class ActivitiTaskAttachmentsComponent implements OnInit { +export class ActivitiTaskAttachmentsComponent implements OnInit, OnChanges { @Input() taskId: string; @@ -40,7 +41,10 @@ export class ActivitiTaskAttachmentsComponent implements OnInit { content: Blob; contentName: string; - constructor(private uploadService: UploadService) { + taskDetails: any; + + constructor(private uploadService: UploadService, + private activitiTaskList: ActivitiTaskListService) { } @@ -48,6 +52,15 @@ export class ActivitiTaskAttachmentsComponent implements OnInit { this.uploadService.fileUploadComplete.subscribe(value => this.onFileUploadComplete(value.data)); } + ngOnChanges() { + if (this.taskId) { + this.activitiTaskList.getTaskDetails(this.taskId).map((res) => res).subscribe( + (res: any) => { + this.taskDetails = res; + }); + } + } + onFileUploadComplete(content: any) { this.taskAttachList.add(content); } @@ -58,4 +71,7 @@ export class ActivitiTaskAttachmentsComponent implements OnInit { this.contentName = content.name; } + isCompletedTask(): boolean { + return this.taskDetails && this.taskDetails.endDate !== undefined && this.taskDetails.endDate !== null; + } } diff --git a/demo-shell-ng2/app/components/activiti/form-node-viewer.component.html b/demo-shell-ng2/app/components/activiti/form-node-viewer.component.html index e2f166282b9..c66bacf0545 100644 --- a/demo-shell-ng2/app/components/activiti/form-node-viewer.component.html +++ b/demo-shell-ng2/app/components/activiti/form-node-viewer.component.html @@ -1,6 +1,6 @@
- - +
diff --git a/demo-shell-ng2/app/components/activiti/form-viewer.component.html b/demo-shell-ng2/app/components/activiti/form-viewer.component.html index 2a5c98ccdb4..acda361721e 100644 --- a/demo-shell-ng2/app/components/activiti/form-viewer.component.html +++ b/demo-shell-ng2/app/components/activiti/form-viewer.component.html @@ -1,11 +1,11 @@
- - + + - - + + - +
diff --git a/demo-shell-ng2/app/components/app-layout/app-layout.component.html b/demo-shell-ng2/app/components/app-layout/app-layout.component.html new file mode 100644 index 00000000000..5f0f5131ea5 --- /dev/null +++ b/demo-shell-ng2/app/components/app-layout/app-layout.component.html @@ -0,0 +1,49 @@ + + + + + {{link.icon}} + {{link.title}} + + + exit_to_app + Logout + + + + + + + + ADF Demo Application + +
+ + + + Home + Content Services + Process Services + Login + + + + + + + + + + +
+ + +
\ No newline at end of file diff --git a/demo-shell-ng2/app/components/app-layout/app-layout.component.scss b/demo-shell-ng2/app/components/app-layout/app-layout.component.scss new file mode 100644 index 00000000000..f9aebf51388 --- /dev/null +++ b/demo-shell-ng2/app/components/app-layout/app-layout.component.scss @@ -0,0 +1,52 @@ +@mixin adf-app-layout-theme($theme) { + $primary: map-get($theme, primary); + $minimumAppWidth: 320px; + $toolbarHeight: 64px; + + .adf-app-layout { + display: block; + min-width: $minimumAppWidth; + height: 100%; + + .adf-nav-container { + display: block; + min-width: $minimumAppWidth; + height: 100%; + } + + .adf-sidenav-link { + &.active { + color: mat-color($primary); + } + } + + &-user-profile { + margin-right: 10px; + } + + &-menu-spacer { + flex: 1 1 auto; + } + + &-toolbar { + height: $toolbarHeight; + line-height: $toolbarHeight; + overflow: hidden; + + md-toolbar-row { + height: $toolbarHeight; + align-items: stretch; + justify-content: space-between; + } + + .adf-toolbar-link { + min-width: 0; + line-height: $toolbarHeight; + + &.active { + background-color: rgba(0,0,0,.12); + } + } + } + } +} \ No newline at end of file diff --git a/demo-shell-ng2/app/components/app-layout/app-layout.component.ts b/demo-shell-ng2/app/components/app-layout/app-layout.component.ts new file mode 100644 index 00000000000..494a107fa27 --- /dev/null +++ b/demo-shell-ng2/app/components/app-layout/app-layout.component.ts @@ -0,0 +1,53 @@ +/*! + * @license + * Copyright 2016 Alfresco Software, Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Component, ViewEncapsulation } from '@angular/core'; +import { AlfrescoTranslationService } from 'ng2-alfresco-core'; + +@Component({ + templateUrl: 'app-layout.component.html', + styleUrls: ['app-layout.component.scss'], + host: { + 'class': 'adf-app-layout' + }, + encapsulation: ViewEncapsulation.None +}) +export class AppLayoutComponent { + + links: Array = [ + { href: '/home', icon: 'home', title: 'Home' }, + { href: '/files', icon: 'folder_open', title: 'Content Services' }, + { href: '/activiti', icon: 'device_hub', title: 'Process Services' }, + { href: '/login', icon: 'vpn_key', title: 'Login' }, + { href: '/dl-custom-sources', icon: 'extension', title: 'DL: Custom Sources' }, + { href: '/datatable', icon: 'view_module', title: 'DataTable' }, + { href: '/form', icon: 'poll', title: 'Form' }, + { href: '/form-list', icon: 'library_books', title: 'Form List' }, + { href: '/uploader', icon: 'file_upload', title: 'Uploader' }, + { href: '/webscript', icon: 'extension', title: 'Webscript' }, + { href: '/tag', icon: 'local_offer', title: 'Tag' }, + { href: '/social', icon: 'thumb_up', title: 'Social' }, + { href: '/settings', icon: 'settings', title: 'Settings' }, + { href: '/about', icon: 'info_outline', title: 'About' } + ]; + + constructor(private translateService: AlfrescoTranslationService) {} + + changeLanguage(lang: string) { + this.translateService.use(lang); + } +} diff --git a/demo-shell-ng2/app/components/datatable/datatable-demo.component.css b/demo-shell-ng2/app/components/datatable/datatable-demo.component.css index cf1e8fe8da1..207585ba571 100644 --- a/demo-shell-ng2/app/components/datatable/datatable-demo.component.css +++ b/demo-shell-ng2/app/components/datatable/datatable-demo.component.css @@ -1,10 +1,10 @@ -alfresco-datatable >>> .custom-row-style.alfresco-datatable__row:focus { +adf-datatable ::ng-deep .custom-row-style.alfresco-datatable__row:focus { outline-offset: -1px; outline-width: 1px; outline-color: green; outline-style: solid; } -alfresco-datatable >>> .custom-row-style.alfresco-datatable__row--selected { +adf-datatable ::ng-deep .custom-row-style.alfresco-datatable__row--selected { color: green; } diff --git a/demo-shell-ng2/app/components/file-view/file-view.component.html b/demo-shell-ng2/app/components/file-view/file-view.component.html new file mode 100644 index 00000000000..050da36d0d4 --- /dev/null +++ b/demo-shell-ng2/app/components/file-view/file-view.component.html @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/demo-shell-ng2/app/components/file-view/file-view.component.ts b/demo-shell-ng2/app/components/file-view/file-view.component.ts new file mode 100644 index 00000000000..6137f1b5751 --- /dev/null +++ b/demo-shell-ng2/app/components/file-view/file-view.component.ts @@ -0,0 +1,53 @@ +/*! + * @license + * Copyright 2016 Alfresco Software, Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Component, OnInit } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { AlfrescoApiService } from 'ng2-alfresco-core'; + +@Component({ + selector: 'adf-file-view', + templateUrl: 'file-view.component.html' +}) +export class FileViewComponent implements OnInit { + + nodeId: string = null; + + constructor( + private router: Router, + private route: ActivatedRoute, + private apiService: AlfrescoApiService) {} + + ngOnInit() { + this.route.params.subscribe(params => { + const id = params.nodeId; + if (id) { + this.apiService.getInstance().nodes.getNodeInfo(id).then( + (node) => { + if (node && node.isFile) { + this.nodeId = id; + return; + } + this.router.navigate(['/files', id]); + }, + () => this.router.navigate(['/files', id]) + ); + } + }); + } + +} diff --git a/demo-shell-ng2/app/components/files/files.component.css b/demo-shell-ng2/app/components/files/files.component.css deleted file mode 100644 index 62054c10771..00000000000 --- a/demo-shell-ng2/app/components/files/files.component.css +++ /dev/null @@ -1,60 +0,0 @@ -.container { - margin: 10px; -} - -@media only screen and (max-width: 640px) { - .container { - margin: 0; - } -} - -.error-message { - text-align: left; -} - -.error-message--text { - color: #d50000; -} - -.adf-not-overlay-viewer { - height:900px; -} - -adf-document-list >>> adf-datatable tr.is-selected .image-table-cell { - position: relative; -} - -adf-document-list >>> adf-datatable tr.document-list__create { - background: green !important; -} - -adf-document-list >>> adf-datatable tr.document-list__disable { - background: red !important; -} - -adf-document-list >>> adf-datatable tr.is-selected .image-table-cell::before { - content: "\E876"; /* "done" */ - font-family: "Material Icons"; - font-size: 24px; - line-height: 32px; - text-align: center; - color: white; - position: absolute; - width: 32px; - height: 32px; - top: 50%; - left: 50%; - margin-top: -16px; - margin-left: -12px; - border-radius: 100%; - background: #00bcd4; -} - -.adf-demo-site-container-style { - margin-top: 10px; - margin-bottom: 10px; - width: 100%; - min-width: 200px; -} - - diff --git a/demo-shell-ng2/app/components/files/files.component.html b/demo-shell-ng2/app/components/files/files.component.html index 3f4ba40def1..1f218c0a180 100644 --- a/demo-shell-ng2/app/components/files/files.component.html +++ b/demo-shell-ng2/app/components/files/files.component.html @@ -3,8 +3,8 @@
- @@ -14,40 +14,42 @@ {{errorMessage}}
- - - + + - - + - - - +
+ + + +
- @@ -58,25 +60,31 @@ - + - - - - - +
- +
-

Current folder ID: {{ documentList.currentFolderId }}

- -
- Selected Nodes: -
    -
  • - {{ node.entry.name }} -
  • -
-
- -
-
- Use inline viewer (no overlay) -
- -
- Use File Viewer dialog -
- -
- Multiselect (with checkboxes) -
- -
- Dropdown breadcrumb -
- -
- Multiple File Upload -
+
-
- Folder upload -
- -
- Custom extensions filter -
- -
- Enable versioning -
- -
- Disable upload button when user has no permissions -
- -
Upload
-
- - - -
-
- - +

Current folder ID: {{ documentList.currentFolderId }}

+ +
+ Selected Nodes: +
    +
  • + {{ node.entry.name }} +
  • +
-
- - + +
+
+ Multiselect (with checkboxes) +
+ +
+ Multiple File Upload +
+ +
+ Folder upload +
+ +
+ Custom extensions filter +
+ +
+ Enable versioning +
+ +
Upload
+
+ + + +
+
+ + +
+
+ + +
+
+ Enable upload (demoing enabled/disabled state only if the permission are not checked dynamically) +
-
- Enable upload (demoing enabled/disabled state only if the permission are not checked dynamically) -
-
- -
-

For 'Multiple' selection mode use Cmd (macOS) or Ctrl (Win) to toggle selection of multiple items.

- - - {{mode.viewValue}} - - + +
+

For 'Multiple' selection mode use Cmd (macOS) or Ctrl (Win) to toggle selection of multiple items.

+ + + {{mode.viewValue}} + + +
- -
- - - - - - - - - - - - - -
- - -
-
-
diff --git a/demo-shell-ng2/app/components/files/files.component.scss b/demo-shell-ng2/app/components/files/files.component.scss new file mode 100644 index 00000000000..9cbbedf0069 --- /dev/null +++ b/demo-shell-ng2/app/components/files/files.component.scss @@ -0,0 +1,93 @@ +$minimumDocumentListWidth: 425px; + +.container { + margin: 10px; +} + +@media only screen and (max-width: 640px) { + .container { + margin: 0; + } +} + +.error-message { + text-align: left; +} + +.error-message--text { + color: #d50000; +} + +.adf-not-overlay-viewer { + height:900px; +} + +adf-document-list ::ng-deep adf-datatable tr.is-selected .image-table-cell { + position: relative; +} + +adf-document-list ::ng-deep adf-datatable tr.document-list__create { + background: green !important; +} + +adf-document-list ::ng-deep adf-datatable tr.document-list__disable { + background: red !important; +} + +adf-document-list ::ng-deep adf-datatable tr.is-selected .image-table-cell::before { + content: "\E876"; /* "done" */ + font-family: "Material Icons"; + font-size: 24px; + line-height: 32px; + text-align: center; + color: white; + position: absolute; + width: 32px; + height: 32px; + top: 50%; + left: 50%; + margin-top: -16px; + margin-left: -12px; + border-radius: 100%; + background: #00bcd4; +} + +.adf-demo-site-container-style { + margin-top: 10px; + margin-bottom: 10px; + width: 100%; + min-width: 200px; +} + +.adf-content-service-settings { + padding: 16px; +} + +.adf-files-toolbar { + & /deep/ md-toolbar-row { + white-space: initial; + + & /deep/ a.adf-breadcrumb-item-anchor { + white-space: initial; + } + } +} + +@media (max-width: $minimumDocumentListWidth) { + adf-document-list /deep/ adf-datatable { + & /deep/ .adf-data-table-cell--fileSize { + display: none; + } + } + + .adf-demo-site-container-style { + width: 100%; + display: block; + + & /deep/ .adf-site-dropdown-list-element { + width: 100%; + } + } +} + + diff --git a/demo-shell-ng2/app/components/files/files.component.ts b/demo-shell-ng2/app/components/files/files.component.ts index 49fa245059c..9c33269d766 100644 --- a/demo-shell-ng2/app/components/files/files.component.ts +++ b/demo-shell-ng2/app/components/files/files.component.ts @@ -27,25 +27,22 @@ import { import { DataColumn, DataRow } from 'ng2-alfresco-datatable'; import { DocumentListComponent, PermissionStyleModel } from 'ng2-alfresco-documentlist'; -import { ViewerService } from 'ng2-alfresco-viewer'; +const DEFAULT_FOLDER_TO_SHOW = '-my-'; @Component({ selector: 'adf-files-component', templateUrl: './files.component.html', - styleUrls: ['./files.component.css'] + styleUrls: ['./files.component.scss'] }) export class FilesComponent implements OnInit { // The identifier of a node. You can also use one of these well-known aliases: -my- | -shared- | -root- - currentFolderId: string = '-my-'; + currentFolderId: string = DEFAULT_FOLDER_TO_SHOW; errorMessage: string = null; fileNodeId: any; showViewer: boolean = false; toolbarColor = 'default'; - useDropdownBreadcrumb = false; - useViewerDialog = true; - useInlineViewer = false; selectionModes = [ { value: 'none', viewValue: 'None' }, @@ -62,9 +59,6 @@ export class FilesComponent implements OnInit { @Input() multipleFileUpload: boolean = false; - @Input() - disableWithNoPermission: boolean = false; - @Input() folderUpload: boolean = false; @@ -92,31 +86,19 @@ export class FilesComponent implements OnInit { private contentService: AlfrescoContentService, private dialog: MdDialog, private translateService: AlfrescoTranslationService, - private viewerService: ViewerService, private router: Router, @Optional() private route: ActivatedRoute) { } showFile(event) { - if (this.useViewerDialog) { - if (event.value.entry.isFile) { - this.viewerService - .showViewerForNode(event.value.entry) - .then(result => { - console.log(result); - }); - } - } else { - if (event.value.entry.isFile) { - this.fileNodeId = event.value.entry.id; - this.showViewer = true; - } else { - this.showViewer = false; - } + const entry = event.value.entry; + if (entry && entry.isFile) { + this.router.navigate(['/files', entry.id, 'view']); } } onFolderChange($event) { + this.currentFolderId = $event.value.id; this.router.navigate(['/files', $event.value.id]); } @@ -136,7 +118,7 @@ export class FilesComponent implements OnInit { }); } - this.uploadService.fileUploadComplete.debounceTime(300).subscribe(value => this.onFileUploadEvent(value)); + this.uploadService.fileUploadComplete.asObservable().debounceTime(300).subscribe(value => this.onFileUploadEvent(value)); this.uploadService.fileUploadDeleted.subscribe((value) => this.onFileUploadEvent(value)); this.contentService.folderCreated.subscribe(value => this.onFolderCreated(value)); @@ -223,7 +205,11 @@ export class FilesComponent implements OnInit { } getSiteContent(site: SiteModel) { - this.currentFolderId = site && site.guid ? site.guid : '-my-'; + this.currentFolderId = site && site.guid ? site.guid : DEFAULT_FOLDER_TO_SHOW; + } + + getDocumentListCurrentFolderId() { + return this.documentList.currentFolderId || DEFAULT_FOLDER_TO_SHOW; } hasSelection(selection: Array): boolean { diff --git a/demo-shell-ng2/app/components/form/demo-form.ts b/demo-shell-ng2/app/components/form/demo-form.ts index a496247facb..daae995c37b 100644 --- a/demo-shell-ng2/app/components/form/demo-form.ts +++ b/demo-shell-ng2/app/components/form/demo-form.ts @@ -2,14 +2,14 @@ * @license * Copyright 2016 Alfresco Software, Ltd. * - * Licensed under the Apache License, Version 2.0 (the 'License'); + * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an 'AS IS' BASIS, + * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. diff --git a/demo-shell-ng2/app/components/form/form-list-demo.component.ts b/demo-shell-ng2/app/components/form/form-list-demo.component.ts index 162b04084b9..90b9eb930ff 100644 --- a/demo-shell-ng2/app/components/form/form-list-demo.component.ts +++ b/demo-shell-ng2/app/components/form/form-list-demo.component.ts @@ -66,8 +66,8 @@ export class FormListDemoComponent { onRowDblClick(event: CustomEvent) { let rowForm = event.detail.value.obj; - this.formService.getFormDefinitionById(rowForm.id).subscribe((definition) => { - let form = this.formService.parseForm(definition); + this.formService.getFormDefinitionById(rowForm.id).subscribe((formModel) => { + let form = this.formService.parseForm(formModel.formDefinition); this.form = form; }); diff --git a/demo-shell-ng2/app/components/home/home.component.css b/demo-shell-ng2/app/components/home/home.component.scss similarity index 70% rename from demo-shell-ng2/app/components/home/home.component.css rename to demo-shell-ng2/app/components/home/home.component.scss index c2f3fabcdf6..ef2f88a86ce 100644 --- a/demo-shell-ng2/app/components/home/home.component.css +++ b/demo-shell-ng2/app/components/home/home.component.scss @@ -5,6 +5,18 @@ display: block; overflow-y: auto; height: 400px; + + h2 { + line-height: 30px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + + .material-icons { + position: relative; + top: 6px; + } } .adf-home-card-title { diff --git a/demo-shell-ng2/app/components/home/home.component.ts b/demo-shell-ng2/app/components/home/home.component.ts index 06cb1aaccb3..e9ac7cca29d 100644 --- a/demo-shell-ng2/app/components/home/home.component.ts +++ b/demo-shell-ng2/app/components/home/home.component.ts @@ -20,6 +20,6 @@ import { Component } from '@angular/core'; @Component({ selector: 'home-view', templateUrl: './home.component.html', - styleUrls: ['./home.component.css'] + styleUrls: ['./home.component.scss'] }) export class HomeComponent {} diff --git a/demo-shell-ng2/app/components/login/login-demo.component.css b/demo-shell-ng2/app/components/login/login-demo.component.css index 32185b2b029..db7a0976961 100644 --- a/demo-shell-ng2/app/components/login/login-demo.component.css +++ b/demo-shell-ng2/app/components/login/login-demo.component.css @@ -35,6 +35,6 @@ } } -.settings >>> .mat-slide-toggle-thumb-container { +.settings ::ng-deep .mat-slide-toggle-thumb-container { cursor: pointer; } diff --git a/demo-shell-ng2/app/components/login/login-demo.component.html b/demo-shell-ng2/app/components/login/login-demo.component.html index 3d2cbab27e8..d1c4bc48b37 100644 --- a/demo-shell-ng2/app/components/login/login-demo.component.html +++ b/demo-shell-ng2/app/components/login/login-demo.component.html @@ -45,21 +45,22 @@ settings - +

Content Services @@ -68,7 +69,7 @@ Process Services @@ -77,7 +78,7 @@ CSRF @@ -86,7 +87,7 @@ Login footer diff --git a/demo-shell-ng2/app/components/search/search-bar.component.html b/demo-shell-ng2/app/components/search/search-bar.component.html index 1a7d13a90c9..1f3b2a73a86 100644 --- a/demo-shell-ng2/app/components/search/search-bar.component.html +++ b/demo-shell-ng2/app/components/search/search-bar.component.html @@ -1,15 +1,14 @@ - - + - - + diff --git a/demo-shell-ng2/app/components/search/search-bar.component.ts b/demo-shell-ng2/app/components/search/search-bar.component.ts index 9978723e6e4..c34e75d9d03 100644 --- a/demo-shell-ng2/app/components/search/search-bar.component.ts +++ b/demo-shell-ng2/app/components/search/search-bar.component.ts @@ -64,8 +64,4 @@ export class SearchBarComponent { onSearchTermChange(event) { this.searchTerm = event.value; } - - onExpandToggle(event) { - this.expand.emit(event); - } } diff --git a/demo-shell-ng2/app/components/search/search.component.html b/demo-shell-ng2/app/components/search/search.component.html index 5f73bf6081e..a606f50dcc4 100644 --- a/demo-shell-ng2/app/components/search/search.component.html +++ b/demo-shell-ng2/app/components/search/search.component.html @@ -1,14 +1,14 @@

-

Search results

- Search results
+ + (nodeDbClick)="nodeDbClick($event)">
- - +
diff --git a/demo-shell-ng2/app/components/search/search.component.scss b/demo-shell-ng2/app/components/search/search.component.scss new file mode 100644 index 00000000000..a8a1a2930ab --- /dev/null +++ b/demo-shell-ng2/app/components/search/search.component.scss @@ -0,0 +1,20 @@ +div.search-results-container { + padding: 0 20px 20px 20px; +} + +.adf-search-title { + font-size: 22px; + padding: 15px 0 15px 0; +} + +@media screen and (max-width: 600px) { + :host .col-display-name { + min-width: 100px; + } + :host .col-modified-at, :host .col-modified-by { + display: none; + } + :host div.search-results-container table { + width: 100%; + } +} diff --git a/demo-shell-ng2/app/components/search/search.component.ts b/demo-shell-ng2/app/components/search/search.component.ts index 7adfa19d012..35a1d22f5e1 100644 --- a/demo-shell-ng2/app/components/search/search.component.ts +++ b/demo-shell-ng2/app/components/search/search.component.ts @@ -21,28 +21,7 @@ import { Router } from '@angular/router'; @Component({ selector: 'search-component', templateUrl: './search.component.html', - styles: [` - :host div.search-results-container { - padding: 0 20px 20px 20px; - } - :host h1 { - font-size: 22px; - } - :host tbody tr { - cursor: pointer; - } - @media screen and (max-width: 600px) { - :host .col-display-name { - min-width: 100px; - } - :host .col-modified-at, :host .col-modified-by { - display: none; - } - :host div.search-results-container table { - width: 100%; - } - } - `] + styleUrls: ['./search.component.scss'] }) export class SearchComponent { diff --git a/demo-shell-ng2/app/components/settings/settings.component.css b/demo-shell-ng2/app/components/settings/settings.component.css deleted file mode 100644 index df2ab9e2083..00000000000 --- a/demo-shell-ng2/app/components/settings/settings.component.css +++ /dev/null @@ -1,20 +0,0 @@ -.adf-setting-container { - display: table; - border-collapse: collapse; - border-spacing: 0; -} - -.adf-setting-card { - width: 400px; -} - -.full-width { - width: 100%; -} - -.adf-setting-card-padding { - width: 50%; - display: table-cell; - vertical-align: middle; - margin: 0; -} diff --git a/demo-shell-ng2/app/components/settings/settings.component.html b/demo-shell-ng2/app/components/settings/settings.component.html index 9e66b624ac1..ced5a98a591 100644 --- a/demo-shell-ng2/app/components/settings/settings.component.html +++ b/demo-shell-ng2/app/components/settings/settings.component.html @@ -10,7 +10,7 @@

{{'SETTINGS.TITLE' | translate}}

{{'SETTINGS.CS-HOST' | translate }} - link + link {{'SETTINGS.TITLE' | translate}} {{'SETTINGS.BP-HOST' | translate }} - link + link {{'SETTINGS.TITLE' | translate}} - + - diff --git a/demo-shell-ng2/app/components/settings/settings.component.scss b/demo-shell-ng2/app/components/settings/settings.component.scss new file mode 100644 index 00000000000..dd75412397b --- /dev/null +++ b/demo-shell-ng2/app/components/settings/settings.component.scss @@ -0,0 +1,37 @@ +.adf-app-settings { + display: flex; + height: 100%; + align-items: center; + + .adf-setting-container { + display: table; + border-collapse: collapse; + border-spacing: 0; + } + + .adf-setting-card { + width: 400px; + } + + .full-width { + width: 100%; + } + + .adf-setting-card-padding { + width: 50%; + display: table-cell; + vertical-align: middle; + margin: 0; + } + + .adf-settings-link-icon { + position: relative; + top: 6px; + margin-right: 10px; + } + + .adf-settings-actions { + display: flex; + justify-content: flex-end; + } +} \ No newline at end of file diff --git a/demo-shell-ng2/app/components/settings/settings.component.ts b/demo-shell-ng2/app/components/settings/settings.component.ts index efef660fdd0..a1c6e15132b 100644 --- a/demo-shell-ng2/app/components/settings/settings.component.ts +++ b/demo-shell-ng2/app/components/settings/settings.component.ts @@ -15,53 +15,67 @@ * limitations under the License. */ -import { Component } from '@angular/core'; +import { Component, ViewEncapsulation } from '@angular/core'; import { FormControl, Validators } from '@angular/forms'; import { AlfrescoSettingsService, LogService, StorageService } from 'ng2-alfresco-core'; @Component({ selector: 'app-settings', templateUrl: 'settings.component.html', - styleUrls: ['settings.component.css'] + host: { + 'class': 'adf-app-settings' + }, + styleUrls: ['settings.component.scss'], + encapsulation: ViewEncapsulation.None }) export class SettingsComponent { HOST_REGEX: string = '^(http|https):\/\/.*[^/]$'; ecmHost: string; + ecmHostTmp: string; bpmHost: string; + bpmHostTmp: string; urlFormControlEcm = new FormControl('', [Validators.required, Validators.pattern(this.HOST_REGEX)]); urlFormControlBpm = new FormControl('', [Validators.required, Validators.pattern(this.HOST_REGEX)]); constructor(private settingsService: AlfrescoSettingsService, private storage: StorageService, private logService: LogService) { - this.ecmHost = storage.getItem('ecmHost') || this.settingsService.ecmHost; - this.bpmHost = storage.getItem('bpmHost') || this.settingsService.bpmHost; + this.ecmHostTmp = this.ecmHost = storage.getItem('ecmHost') || this.settingsService.ecmHost; + this.bpmHostTmp = this.bpmHost = storage.getItem('bpmHost') || this.settingsService.bpmHost; } public onChangeECMHost(event: KeyboardEvent): void { - let value = (event.target).value.trim(); + let value = ( event.target).value.trim(); if (value && this.isValidUrl(value)) { this.logService.info(`ECM host: ${value}`); - this.ecmHost = value; - this.storage.setItem(`ecmHost`, value); + this.ecmHostTmp = value; } else { console.error('Ecm address does not match the pattern'); } } public onChangeBPMHost(event: KeyboardEvent): void { - let value = (event.target).value.trim(); + let value = ( event.target).value.trim(); if (value && this.isValidUrl(value)) { this.logService.info(`BPM host: ${value}`); - this.bpmHost = value; - this.storage.setItem(`bpmHost`, value); + this.bpmHostTmp = value; } else { console.error('Bpm address does not match the pattern'); } } + public save(event: KeyboardEvent): void { + if (this.bpmHost !== this.bpmHostTmp) { + this.storage.setItem(`bpmHost`, this.bpmHostTmp); + } + if (this.ecmHost !== this.ecmHostTmp) { + this.storage.setItem(`ecmHost`, this.ecmHostTmp); + } + window.location.href = '/'; + } + isValidUrl(url: string) { return /^(http|https):\/\/.*/.test(url); } diff --git a/demo-shell-ng2/app/components/tag/tag.component.html b/demo-shell-ng2/app/components/tag/tag.component.html index 2f05dc86411..11d44c424ac 100644 --- a/demo-shell-ng2/app/components/tag/tag.component.html +++ b/demo-shell-ng2/app/components/tag/tag.component.html @@ -2,18 +2,18 @@
- +
List Tags Content Services
- +
Tag list By Node ID
- +
diff --git a/demo-shell-ng2/app/components/theme-picker/style-manager/style-manager.ts b/demo-shell-ng2/app/components/theme-picker/style-manager/style-manager.ts index ccc36294b04..062220b4f97 100644 --- a/demo-shell-ng2/app/components/theme-picker/style-manager/style-manager.ts +++ b/demo-shell-ng2/app/components/theme-picker/style-manager/style-manager.ts @@ -1,4 +1,4 @@ -import {Injectable} from '@angular/core'; +import { Injectable } from '@angular/core'; /** * Class for managing stylesheets. Stylesheets are loaded into named slots so that they can be @@ -35,6 +35,7 @@ function getExistingLinkElementByKey(key: string) { function createLinkElementWithKey(key: string) { const linkEl = document.createElement('link'); linkEl.setAttribute('rel', 'stylesheet'); + linkEl.setAttribute('type', 'text/css'); linkEl.classList.add(getClassNameForKey(key)); document.head.appendChild(linkEl); return linkEl; diff --git a/demo-shell-ng2/app/components/theme-picker/theme-picker.ts b/demo-shell-ng2/app/components/theme-picker/theme-picker.ts index 97accd99a97..ab11546468e 100644 --- a/demo-shell-ng2/app/components/theme-picker/theme-picker.ts +++ b/demo-shell-ng2/app/components/theme-picker/theme-picker.ts @@ -1,11 +1,11 @@ -import {CommonModule} from '@angular/common'; -import {ChangeDetectionStrategy, Component, NgModule} from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { ChangeDetectionStrategy, Component, NgModule } from '@angular/core'; import { MdButtonModule, MdGridListModule, MdIconModule, MdMenuModule, MdTooltipModule } from '@angular/material'; -import {StyleManager} from './style-manager/style-manager'; -import {DocsSiteTheme, ThemeStorage} from './theme-storage/theme-storage'; +import { StyleManager } from './style-manager/style-manager'; +import { DocsSiteTheme, ThemeStorage } from './theme-storage/theme-storage'; @Component({ selector: 'theme-picker', diff --git a/demo-shell-ng2/app/components/theme-picker/theme-storage/theme-storage.ts b/demo-shell-ng2/app/components/theme-picker/theme-storage/theme-storage.ts index 2e03c9bf8b0..2aa3df6df87 100644 --- a/demo-shell-ng2/app/components/theme-picker/theme-storage/theme-storage.ts +++ b/demo-shell-ng2/app/components/theme-picker/theme-storage/theme-storage.ts @@ -1,4 +1,4 @@ -import {EventEmitter, Injectable} from '@angular/core'; +import { EventEmitter, Injectable } from '@angular/core'; export interface DocsSiteTheme { href: string; diff --git a/demo-shell-ng2/app/components/webscript/webscript.component.html b/demo-shell-ng2/app/components/webscript/webscript.component.html new file mode 100644 index 00000000000..a4a6faadf48 --- /dev/null +++ b/demo-shell-ng2/app/components/webscript/webscript.component.html @@ -0,0 +1,14 @@ +
+
+
+
+
+
+ + diff --git a/demo-shell-ng2/app/components/webscript/webscript.component.ts b/demo-shell-ng2/app/components/webscript/webscript.component.ts index 4587498c80f..88bc04013ed 100644 --- a/demo-shell-ng2/app/components/webscript/webscript.component.ts +++ b/demo-shell-ng2/app/components/webscript/webscript.component.ts @@ -20,22 +20,7 @@ import { LogService } from 'ng2-alfresco-core'; @Component({ selector: 'alfresco-webscript-demo', - template: ` -
-
-
-
-
-
- - - ` + templateUrl: 'webscript.component.html' }) export class WebscriptComponent { diff --git a/demo-shell-ng2/app/material.module.ts b/demo-shell-ng2/app/material.module.ts index 98ef17108be..68d96368d0f 100644 --- a/demo-shell-ng2/app/material.module.ts +++ b/demo-shell-ng2/app/material.module.ts @@ -21,6 +21,7 @@ import { MdInputModule, MdProgressBarModule, MdSelectModule, + MdSidenavModule, MdSlideToggleModule } from '@angular/material'; @@ -29,6 +30,7 @@ const MATERIAL_MODULES = [ MdInputModule, MdSelectModule, MdDialogModule, + MdSidenavModule, MdProgressBarModule ]; diff --git a/demo-shell-ng2/app/polyfills.ts b/demo-shell-ng2/app/polyfills.ts index 600a34bd90b..836039ee8ea 100644 --- a/demo-shell-ng2/app/polyfills.ts +++ b/demo-shell-ng2/app/polyfills.ts @@ -1,10 +1,27 @@ +/*! + * @license + * Copyright 2016 Alfresco Software, Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + /* tslint:disable */ -import 'core-js/es6'; +import 'core-js/es6/reflect'; import 'core-js/es7/reflect'; +import 'zone.js/dist/zone'; import 'intl'; -require('zone.js/dist/zone'); // IE 8-11 require('element.scrollintoviewifneeded-polyfill'); // IE/FF if (process.env.ENV === 'production') { diff --git a/demo-shell-ng2/app/services/debug-app-config.service.ts b/demo-shell-ng2/app/services/debug-app-config.service.ts index f254de7a901..715acb60e00 100644 --- a/demo-shell-ng2/app/services/debug-app-config.service.ts +++ b/demo-shell-ng2/app/services/debug-app-config.service.ts @@ -29,7 +29,7 @@ export class DebugAppConfigService extends AppConfigService { /** @override */ get(key: string): T { if (key === 'ecmHost' || key === 'bpmHost') { - return (this.storage.getItem(key) || super.get(key)); + return ( this.storage.getItem(key) || super.get(key)); } return super.get(key); } diff --git a/demo-shell-ng2/app/theme.scss b/demo-shell-ng2/app/theme.scss index 4665606589d..d0d7ec0d825 100644 --- a/demo-shell-ng2/app/theme.scss +++ b/demo-shell-ng2/app/theme.scss @@ -1,3 +1,4 @@ +@import './components/app-layout/app-layout.component.scss'; @import '~ng2-alfresco-core/styles/theming'; @import '~ng2-alfresco-core/styles/index'; @import '~ng2-activiti-analytics/styles/index'; @@ -10,10 +11,16 @@ @import '~ng2-alfresco-login/styles/index'; @import '~ng2-alfresco-upload/styles/index'; @import '~ng2-alfresco-userinfo/styles/index'; +@import '~ng2-alfresco-search/styles/index'; @include mat-core(); +$custom-typography: mat-typography-config( + $font-family: 'Muli, Roboto, "Helvetica Neue", sans-serif' +); +@include angular-material-typography($custom-typography); + $primary: mat-palette($alfresco-accent-orange); $accent: mat-palette($alfresco-accent-purple); $warn: mat-palette($alfresco-warn); @@ -21,6 +28,7 @@ $theme: mat-light-theme($primary, $accent, $warn); @include angular-material-theme($theme); +@include adf-app-layout-theme($theme); @include alfresco-core-theme($theme); @include alfresco-activity-analytics-theme($theme); @include alfresco-activity-diagrams-theme($theme); @@ -32,3 +40,4 @@ $theme: mat-light-theme($primary, $accent, $warn); @include alfresco-login-theme($theme); @include alfresco-upload-theme($theme); @include alfresco-userinfo-theme($theme); +@include alfresco-search-theme($theme); diff --git a/demo-shell-ng2/app/vendor.ts b/demo-shell-ng2/app/vendor.ts index 6a4f03e0d1e..f846cac0544 100644 --- a/demo-shell-ng2/app/vendor.ts +++ b/demo-shell-ng2/app/vendor.ts @@ -1,3 +1,20 @@ +/*! + * @license + * Copyright 2016 Alfresco Software, Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + /* tslint:disable */ // Angular @@ -38,12 +55,9 @@ require('script-loader!dialog-polyfill/dialog-polyfill'); import 'dialog-polyfill/dialog-polyfill.css'; // Google Material Design Lite -import 'material-design-icons/iconfont/material-icons.css'; import 'material-design-lite/dist/material.orange-blue.min.css'; import 'material-design-lite/material.js'; -import '../public/css/muli-font.css'; - import 'ng2-activiti-form/stencils/runtime.adf'; import 'ng2-activiti-form/stencils/runtime.ng1'; diff --git a/demo-shell-ng2/config/webpack.common.js b/demo-shell-ng2/config/webpack.common.js index 9436c1774de..99dffd6cf7d 100644 --- a/demo-shell-ng2/config/webpack.common.js +++ b/demo-shell-ng2/config/webpack.common.js @@ -76,7 +76,7 @@ module.exports = { emitErrors: true, licenseFile: path.resolve(__dirname, '../assets/license_header.txt') }, - exclude: [/node_modules/, /bundles/, /dist/, /demo/] + exclude: [/theme-picker/] } ] }, @@ -99,17 +99,27 @@ module.exports = { to: 'resources/i18n' }, { - from: 'app.config-dev.json' + from: 'favicon-96x96.png' }, { - from: 'app.config-prod.json' + from: 'node_modules/pdfjs-dist/build/pdf.worker.js', + to: 'pdf.worker.js' }, { - from: 'favicon-96x96.png' + from: 'node_modules/web-animations-js/web-animations.min.js', + to: 'js/web-animations.min.js' }, { - from: 'node_modules/pdfjs-dist/build/pdf.worker.js', - to: 'pdf.worker.js' + from: 'node_modules/core-js/client/core.min.js', + to: 'js/core.min.js' + }, + { + from: 'node_modules/custom-event-polyfill/custom-event-polyfill.js', + to: 'js/custom-event-polyfill.js' + }, + { + from: 'node_modules/intl/dist/Intl.min.js', + to: 'js/Intl.min.js' }, { context: 'public', @@ -142,6 +152,15 @@ module.exports = { }, pathRewrite: { '^/ecm': '' + }, + secure: false, + changeOrigin: true, + // workaround for REPO-2260 + onProxyRes: function (proxyRes, req, res) { + const header = proxyRes.headers['www-authenticate']; + if (header && header.startsWith('Basic')) { + proxyRes.headers['www-authenticate'] = 'x' + header; + } } }, '/bpm': { @@ -152,6 +171,15 @@ module.exports = { }, pathRewrite: { '^/bpm': '' + }, + secure: false, + changeOrigin: true, + // workaround + onProxyRes: function (proxyRes, req, res) { + const header = proxyRes.headers['www-authenticate']; + if (header && header.startsWith('Basic')) { + proxyRes.headers['www-authenticate'] = 'x' + header; + } } } } diff --git a/demo-shell-ng2/config/webpack.dev.js b/demo-shell-ng2/config/webpack.dev.js index 2795886c122..38881bdaa11 100644 --- a/demo-shell-ng2/config/webpack.dev.js +++ b/demo-shell-ng2/config/webpack.dev.js @@ -5,7 +5,7 @@ const commonConfig = require('./webpack.common.js'); const helpers = require('./helpers'); const path = require('path'); const CopyWebpackPlugin = require('copy-webpack-plugin'); -var HappyPack = require('happypack'); +const HappyPack = require('happypack'); const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin'); const alfrescoLibs = [ @@ -58,7 +58,7 @@ module.exports = webpackMerge(commonConfig, { includePaths: [path.resolve(__dirname, '../../ng2-components/ng2-alfresco-core/styles')] } }] - }, + } ] }, @@ -131,7 +131,11 @@ module.exports = webpackMerge(commonConfig, { from: '**/*', to: `assets/${lib}/i18n/` } - }) + }), + { + from: 'app.config-dev.json', + to: 'app.config.json' + } ]), new CopyWebpackPlugin([ { diff --git a/demo-shell-ng2/config/webpack.prod.js b/demo-shell-ng2/config/webpack.prod.js index 6c632c5484f..92012b9bf25 100644 --- a/demo-shell-ng2/config/webpack.prod.js +++ b/demo-shell-ng2/config/webpack.prod.js @@ -100,6 +100,10 @@ module.exports = webpackMerge(commonConfig, { context: `node_modules/ng2-alfresco-core/prebuilt-themes/`, from: '**/*.css', to: 'prebuilt-themes' + }, + { + from: 'app.config-prod.json', + to: 'app.config.json' } ]), new webpack.NoEmitOnErrorsPlugin(), diff --git a/demo-shell-ng2/config/webpack.style.js b/demo-shell-ng2/config/webpack.style.js new file mode 100644 index 00000000000..0c01d1c0a5d --- /dev/null +++ b/demo-shell-ng2/config/webpack.style.js @@ -0,0 +1,37 @@ +const ExtractTextPlugin = require("extract-text-webpack-plugin"); +const path = require('path'); + +const extractScss = new ExtractTextPlugin('../ng2-components/ng2-alfresco-core/prebuilt-themes/[name].css'); + +module.exports = { + + entry: { + 'adf-blue-orange': '../ng2-components/ng2-alfresco-core/styles/prebuilt/adf-blue-orange.scss', + 'adf-blue-purple': '../ng2-components/ng2-alfresco-core/styles/prebuilt/adf-blue-purple.scss', + 'adf-cyan-orange': '../ng2-components/ng2-alfresco-core/styles/prebuilt/adf-cyan-orange.scss', + 'adf-cyan-purple': '../ng2-components/ng2-alfresco-core/styles/prebuilt/adf-cyan-purple.scss', + 'adf-green-purple': '../ng2-components/ng2-alfresco-core/styles/prebuilt/adf-green-purple.scss', + 'adf-green-orange': '../ng2-components/ng2-alfresco-core/styles/prebuilt/adf-green-orange.scss', + 'adf-pink-bluegrey': '../ng2-components/ng2-alfresco-core/styles/prebuilt/adf-pink-bluegrey.scss', + 'adf-indigo-pink': '../ng2-components/ng2-alfresco-core/styles/prebuilt/adf-indigo-pink.scss', + 'adf-purple-green': '../ng2-components/ng2-alfresco-core/styles/prebuilt/adf-purple-green.scss' + }, + + output: { + filename: '../dist/[name].js' + }, + + module: { + rules: [{ + test: /\.scss$/, + use: extractScss.extract([{ + loader: "raw-loader" + }, { + loader: "sass-loader" + }]) + }] + }, + plugins: [ + extractScss + ] +}; diff --git a/demo-shell-ng2/index.html b/demo-shell-ng2/index.html index cf982e3d69e..227644620fc 100644 --- a/demo-shell-ng2/index.html +++ b/demo-shell-ng2/index.html @@ -6,20 +6,17 @@ + + - + +