mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-24 17:31:52 +00:00
[ACA-3379] Routing & skeleton for manage rules screen (#2575)
* [ACA-3379] Routing & skeleton for manage rules screen * Linting * Update routing so it's no longer lazy loaded * Reverted to using lazy-loaded routes * Remove action visibility from favourites, update e2e test data
This commit is contained in:
@@ -1,10 +1,7 @@
|
||||
{
|
||||
"ACA_FOLDER_RULES": {
|
||||
"MENU": {
|
||||
"CREATE_RULES": "Create rules",
|
||||
"CREATE_RULES_DESC": "[tbd] Creates new rules",
|
||||
"LINK_RULES": "Link to rules set",
|
||||
"LINK_RULES_DESC": "[tbd] Link to existing rules"
|
||||
"ACTIONS": {
|
||||
"MANAGE_RULES": "Manage rules"
|
||||
},
|
||||
"EDIT_RULE_DIALOG": {
|
||||
"CANCEL": "Cancel",
|
||||
|
@@ -28,22 +28,30 @@ import { ExtensionService, provideExtensionConfig } from '@alfresco/adf-extensio
|
||||
import { NgModule } from '@angular/core';
|
||||
import * as rules from './folder-rules.rules';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { RouterModule, Routes } from '@angular/router';
|
||||
|
||||
import { EditRuleDialogSmartComponent } from './rule-details/edit-rule-dialog.smart-component';
|
||||
import { ManageRulesSmartComponent } from './manage-rules/manage-rules.smart-component';
|
||||
import { RuleDetailsUiComponent } from './rule-details/rule-details.ui-component';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: 'rules',
|
||||
component: ManageRulesSmartComponent
|
||||
}
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
providers: [provideExtensionConfig(['folder-rules.plugin.json'])],
|
||||
imports: [CommonModule, CoreModule.forChild()],
|
||||
declarations: [EditRuleDialogSmartComponent, RuleDetailsUiComponent]
|
||||
imports: [CommonModule, RouterModule.forChild(routes), CoreModule.forChild()],
|
||||
declarations: [EditRuleDialogSmartComponent, ManageRulesSmartComponent, RuleDetailsUiComponent]
|
||||
})
|
||||
export class AcaFolderRulesModule {
|
||||
constructor(translation: TranslationService, extensions: ExtensionService) {
|
||||
translation.addTranslationFolder('aca-folder-rules', 'assets/aca-folder-rules');
|
||||
|
||||
extensions.setEvaluators({
|
||||
'rules.canCreateFolderRule': rules.canCreateFolderRule,
|
||||
'rules.canLinkFolderRule': rules.canLinkFolderRule
|
||||
'rules.canManageFolderRules': rules.canManageFolderRules
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@@ -23,11 +23,10 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { AcaRuleContext, hasFolderSelected, canEditFolder } from '@alfresco/aca-shared/rules';
|
||||
import { AcaRuleContext, hasFolderSelected, canEditFolder, isNotFavorites } from '@alfresco/aca-shared/rules';
|
||||
|
||||
export const isFolderRulesEnabled = (context: AcaRuleContext) => context.appConfig.get<boolean>('plugins.folderRules', false);
|
||||
export const isFolderRulesAllowed = (context: AcaRuleContext) =>
|
||||
isFolderRulesEnabled(context) && canEditFolder(context) && hasFolderSelected(context);
|
||||
isFolderRulesEnabled(context) && canEditFolder(context) && hasFolderSelected(context) && isNotFavorites(context);
|
||||
|
||||
export const canCreateFolderRule = (context: AcaRuleContext): boolean => isFolderRulesAllowed(context);
|
||||
export const canLinkFolderRule = (context: AcaRuleContext): boolean => isFolderRulesAllowed(context);
|
||||
export const canManageFolderRules = (context: AcaRuleContext): boolean => isFolderRulesAllowed(context);
|
||||
|
@@ -0,0 +1,32 @@
|
||||
/*!
|
||||
* @license
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
*
|
||||
* This file is part of the Alfresco Example Content Application.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
* the paid license agreement will prevail. Otherwise, the software is
|
||||
* provided under the following open source license terms:
|
||||
*
|
||||
* The Alfresco Example Content Application is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The Alfresco Example Content Application is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'aca-manage-rules',
|
||||
template: `<div>This is the Manage Rules component</div>`
|
||||
})
|
||||
export class ManageRulesSmartComponent {}
|
@@ -24,4 +24,4 @@
|
||||
*/
|
||||
|
||||
export * from './lib/folder-rules.module';
|
||||
export { EditRuleDialogSmartComponent } from './lib/rule-details/edit-rule-dialog.smart-component';
|
||||
export { ManageRulesSmartComponent } from './lib/manage-rules/manage-rules.smart-component';
|
||||
|
Reference in New Issue
Block a user