mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
add sites and supported page size configuration
This commit is contained in:
@@ -57,6 +57,7 @@
|
|||||||
"APP_NAME": "ADF Demo Application",
|
"APP_NAME": "ADF Demo Application",
|
||||||
"HOME": "Home",
|
"HOME": "Home",
|
||||||
"NODE-SELECTOR": "Node Selector",
|
"NODE-SELECTOR": "Node Selector",
|
||||||
|
"SITES": "Sites",
|
||||||
"CONTENT_SERVICES": "Content Services",
|
"CONTENT_SERVICES": "Content Services",
|
||||||
"BREADCRUMB": "Breadcrumb",
|
"BREADCRUMB": "Breadcrumb",
|
||||||
"NOTIFICATIONS": "Notifications",
|
"NOTIFICATIONS": "Notifications",
|
||||||
|
@@ -81,6 +81,7 @@ import { CloudSettingsComponent } from './components/app-layout/cloud/cloud-sett
|
|||||||
import { AppExtensionsModule } from './app-extension.module';
|
import { AppExtensionsModule } from './app-extension.module';
|
||||||
import { ProcessDetailsCloudDemoComponent } from './components/app-layout/cloud/process-details-cloud-demo.component';
|
import { ProcessDetailsCloudDemoComponent } from './components/app-layout/cloud/process-details-cloud-demo.component';
|
||||||
import { NestedMenuPositionDirective } from './components/app-layout/cloud/directives/nested-menu-position.directive';
|
import { NestedMenuPositionDirective } from './components/app-layout/cloud/directives/nested-menu-position.directive';
|
||||||
|
import { SitesModule } from './components/sites/sites.module';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
@@ -104,7 +105,8 @@ import { NestedMenuPositionDirective } from './components/app-layout/cloud/direc
|
|||||||
MonacoEditorModule.forRoot(),
|
MonacoEditorModule.forRoot(),
|
||||||
ProcessServicesCloudModule,
|
ProcessServicesCloudModule,
|
||||||
GroupCloudModule,
|
GroupCloudModule,
|
||||||
TaskDirectiveModule
|
TaskDirectiveModule,
|
||||||
|
SitesModule
|
||||||
],
|
],
|
||||||
declarations: [
|
declarations: [
|
||||||
AppComponent,
|
AppComponent,
|
||||||
|
@@ -119,6 +119,16 @@ export const appRoutes: Routes = [
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: 'sites',
|
||||||
|
component: AppLayoutComponent,
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: '',
|
||||||
|
loadChildren: 'app/components/sites/sites.module#SitesModule'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: 'header-data',
|
path: 'header-data',
|
||||||
component: AppLayoutComponent,
|
component: AppLayoutComponent,
|
||||||
|
@@ -38,6 +38,7 @@ export class AppLayoutComponent implements OnInit {
|
|||||||
{ href: '/card-view', icon: 'view_headline', title: 'APP_LAYOUT.CARD_VIEW' },
|
{ href: '/card-view', icon: 'view_headline', title: 'APP_LAYOUT.CARD_VIEW' },
|
||||||
{ href: '/header-data', icon: 'edit', title: 'APP_LAYOUT.HEADER_DATA' },
|
{ href: '/header-data', icon: 'edit', title: 'APP_LAYOUT.HEADER_DATA' },
|
||||||
{ href: '/node-selector', icon: 'attachment', title: 'APP_LAYOUT.NODE-SELECTOR' },
|
{ href: '/node-selector', icon: 'attachment', title: 'APP_LAYOUT.NODE-SELECTOR' },
|
||||||
|
{ href: '/sites', icon: 'format_list_bulleted', title: 'APP_LAYOUT.SITES' },
|
||||||
{ href: '/task-list', icon: 'assignment', title: 'APP_LAYOUT.TASK_LIST' },
|
{ href: '/task-list', icon: 'assignment', title: 'APP_LAYOUT.TASK_LIST' },
|
||||||
{ href: '/cloud', icon: 'cloud', title: 'APP_LAYOUT.PROCESS_CLOUD', children: [
|
{ href: '/cloud', icon: 'cloud', title: 'APP_LAYOUT.PROCESS_CLOUD', children: [
|
||||||
{ href: '/cloud/', icon: 'cloud', title: 'APP_LAYOUT.HOME' },
|
{ href: '/cloud/', icon: 'cloud', title: 'APP_LAYOUT.HOME' },
|
||||||
|
@@ -77,6 +77,13 @@
|
|||||||
</button>
|
</button>
|
||||||
</mat-list-item>
|
</mat-list-item>
|
||||||
|
|
||||||
|
<mat-list-item (click)="supportedPageSizesClick()">
|
||||||
|
<a matLine id="adf-supported-page-size">Supported Page Sizes </a>
|
||||||
|
<button mat-icon-button>
|
||||||
|
<mat-icon>info</mat-icon>
|
||||||
|
</button>
|
||||||
|
</mat-list-item>
|
||||||
|
|
||||||
<mat-list-item (click)="textOrientationClick()">
|
<mat-list-item (click)="textOrientationClick()">
|
||||||
<a matLine id="adf-page-orientation-conf">Page Orientation</a>
|
<a matLine id="adf-page-orientation-conf">Page Orientation</a>
|
||||||
<button mat-icon-button>
|
<button mat-icon-button>
|
||||||
|
@@ -171,6 +171,16 @@ export class ConfigEditorComponent {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
supportedPageSizesClick() {
|
||||||
|
this.isUserPreference = true;
|
||||||
|
this.userPreferenceProperty = UserPreferenceValues.SupportedPageSizes;
|
||||||
|
this.userPreferencesService.select(this.userPreferenceProperty).subscribe((supportedPageSizes: number) => {
|
||||||
|
this.code = JSON.stringify(supportedPageSizes);
|
||||||
|
this.field = 'adf-supported-page-size';
|
||||||
|
this.indentCode();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
indentCode() {
|
indentCode() {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.editor.getAction('editor.action.formatDocument').run();
|
this.editor.getAction('editor.action.formatDocument').run();
|
||||||
|
28
demo-shell/src/app/components/sites/sites.component.html
Normal file
28
demo-shell/src/app/components/sites/sites.component.html
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
<h1>Select Site</h1>
|
||||||
|
<adf-sites-dropdown (change)="onSiteChange($event)" [relations]="'members'">
|
||||||
|
</adf-sites-dropdown>
|
||||||
|
|
||||||
|
Current Selected Site {{currentSelectedSite}}
|
||||||
|
|
||||||
|
|
||||||
|
<h1>Hide My Files</h1>
|
||||||
|
<adf-sites-dropdown [hideMyFiles]="true" [relations]="'members'">
|
||||||
|
</adf-sites-dropdown>
|
||||||
|
|
||||||
|
|
||||||
|
<h1>Select Default Site</h1>
|
||||||
|
|
||||||
|
<section>
|
||||||
|
<mat-form-field>
|
||||||
|
<label>Insert a Default site ID</label>
|
||||||
|
<input matInput [(ngModel)]="defaultSite">
|
||||||
|
</mat-form-field>
|
||||||
|
</section>
|
||||||
|
<button (click)="applySite()" mat-button color="primary">Apply</button>
|
||||||
|
|
||||||
|
<div *ngIf="showDefaultSite">
|
||||||
|
<adf-sites-dropdown [relations]="'members'" [value]="defaultSite">
|
||||||
|
</adf-sites-dropdown>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
40
demo-shell/src/app/components/sites/sites.component.ts
Normal file
40
demo-shell/src/app/components/sites/sites.component.ts
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
/*!
|
||||||
|
* @license
|
||||||
|
* Copyright 2019 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 } from '@angular/core';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-sites',
|
||||||
|
templateUrl: 'sites.component.html',
|
||||||
|
styleUrls: ['sites.component.scss']
|
||||||
|
})
|
||||||
|
export class SitesComponent {
|
||||||
|
|
||||||
|
currentSelectedSite: string;
|
||||||
|
hideMyFiles: boolean = false;
|
||||||
|
showDefaultSite: boolean = false;
|
||||||
|
defaultSite: string;
|
||||||
|
|
||||||
|
onSiteChange($event: any) {
|
||||||
|
this.currentSelectedSite = JSON.stringify($event.entry);
|
||||||
|
}
|
||||||
|
|
||||||
|
applySite() {
|
||||||
|
this.showDefaultSite = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
41
demo-shell/src/app/components/sites/sites.module.ts
Normal file
41
demo-shell/src/app/components/sites/sites.module.ts
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
/*!
|
||||||
|
* @license
|
||||||
|
* Copyright 2019 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 { NgModule } from '@angular/core';
|
||||||
|
import { SitesComponent } from './sites.component';
|
||||||
|
import { Routes, RouterModule } from '@angular/router';
|
||||||
|
import { CommonModule } from '@angular/common';
|
||||||
|
import { CoreModule } from '@alfresco/adf-core';
|
||||||
|
import { ContentModule } from '@alfresco/adf-content-services';
|
||||||
|
|
||||||
|
const routes: Routes = [
|
||||||
|
{
|
||||||
|
path: '',
|
||||||
|
component: SitesComponent
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [
|
||||||
|
CommonModule,
|
||||||
|
RouterModule.forChild(routes),
|
||||||
|
CoreModule.forChild(),
|
||||||
|
ContentModule.forChild()
|
||||||
|
],
|
||||||
|
declarations: [SitesComponent]
|
||||||
|
})
|
||||||
|
export class SitesModule {}
|
Reference in New Issue
Block a user