Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ACS-5627] migrate to standalone components #3339

Merged
merged 37 commits into from
Jul 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
2fbb3cf
standalone preview component
DenysVuika Jul 15, 2023
2b7b9a5
remove deprecated routes
DenysVuika Jul 15, 2023
8f34d4d
remove preview routes
DenysVuika Jul 15, 2023
478ff17
standalone viewer
DenysVuika Jul 15, 2023
b53962c
toggle favorite
DenysVuika Jul 15, 2023
29cef54
edit offline
DenysVuika Jul 15, 2023
ea05704
fix tests
DenysVuika Jul 15, 2023
147bc11
toggle info drawer
DenysVuika Jul 15, 2023
e1d1656
toggle join library
DenysVuika Jul 15, 2023
60e6223
toggle favorite library
DenysVuika Jul 15, 2023
5e5f4a2
view node
DenysVuika Jul 15, 2023
4e765a8
convert app toolbar module to standalone directives
DenysVuika Jul 15, 2023
18b7856
convert sidenav module to standalone
DenysVuika Jul 15, 2023
8005d10
convert search module to standalone
DenysVuika Jul 15, 2023
5ac23d0
shared link view
DenysVuika Jul 15, 2023
55c79bc
shared files
DenysVuika Jul 15, 2023
a6aaf44
reduce module files
DenysVuika Jul 15, 2023
e408431
files component
DenysVuika Jul 15, 2023
06f7e88
files component cleanup
DenysVuika Jul 15, 2023
dd96266
cleanup directives module
DenysVuika Jul 15, 2023
43d6d93
favorite libraries
DenysVuika Jul 15, 2023
dbf3025
favorites component
DenysVuika Jul 15, 2023
93f6d9e
recent files component
DenysVuika Jul 15, 2023
1df8756
libraries component
DenysVuika Jul 15, 2023
85d1449
cleanup
DenysVuika Jul 15, 2023
b56a23a
remove material module barrel
DenysVuika Jul 15, 2023
5db4b81
open in app component
DenysVuika Jul 15, 2023
990ddcd
cleanup modules
DenysVuika Jul 15, 2023
e0d1da5
migrate toolbar module to standalone
DenysVuika Jul 15, 2023
6393fdc
split page layout module
DenysVuika Jul 15, 2023
53d5af1
remove incorrect import
DenysVuika Jul 15, 2023
5aa6a91
remove incorrect import
DenysVuika Jul 15, 2023
a70f772
rule list
DenysVuika Jul 15, 2023
1076fbc
folder rules module
DenysVuika Jul 16, 2023
433f7cc
folder rules module
DenysVuika Jul 16, 2023
cd84665
backwards compatibility for ADW
DenysVuika Jul 16, 2023
8d478fd
reduce core module usage
DenysVuika Jul 16, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions app/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import { NgModule } from '@angular/core';
import { BrowserAnimationsModule, NoopAnimationsModule } from '@angular/platform-browser/animations';

import { TRANSLATION_PROVIDER, AppConfigService, DebugAppConfigService, CoreModule, AuthGuard } from '@alfresco/adf-core';
import { AppService, SharedModule } from '@alfresco/aca-shared';
import { AppService } from '@alfresco/aca-shared';

import { AppExtensionsModule } from './extensions.module';
import { environment } from '../environments/environment';
Expand Down Expand Up @@ -89,7 +89,6 @@ registerLocaleData(localeSv);
BrowserModule,
TranslateModule.forRoot(),
CoreModule.forRoot(),
SharedModule,
CoreExtensionsModule.forRoot(),
LoginComponent,
environment.e2e ? NoopAnimationsModule : BrowserAnimationsModule,
Expand Down
14 changes: 12 additions & 2 deletions projects/aca-content/about/src/about.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,25 @@ import { AboutModule, AppConfigService, AuthenticationService, RepositoryInfo }
import { DiscoveryApiService } from '@alfresco/adf-content-services';
import { PACKAGE_JSON } from './package-json.token';
import { TranslateModule } from '@ngx-translate/core';
import { AppExtensionService, PageLayoutModule } from '@alfresco/aca-shared';
import { AppExtensionService, PageLayoutComponent, PageLayoutContentComponent, PageLayoutHeaderComponent } from '@alfresco/aca-shared';
import { RouterModule } from '@angular/router';
import { MatIconModule } from '@angular/material/icon';
import { CommonModule } from '@angular/common';
import { MatButtonModule } from '@angular/material/button';

@Component({
standalone: true,
imports: [CommonModule, TranslateModule, AboutModule, PageLayoutModule, RouterModule, MatIconModule, MatButtonModule],
imports: [
CommonModule,
TranslateModule,
AboutModule,
RouterModule,
MatIconModule,
MatButtonModule,
PageLayoutHeaderComponent,
PageLayoutContentComponent,
PageLayoutComponent
],
selector: 'app-about-page',
templateUrl: './about.component.html',
styleUrls: ['./about.component.scss'],
Expand Down
31 changes: 9 additions & 22 deletions projects/aca-content/folder-rules/src/folder-rules.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,16 @@
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
*/

import { CoreModule, TranslationService } from '@alfresco/adf-core';
import { ExtensionService, ExtensionsModule, provideExtensionConfig } from '@alfresco/adf-extensions';
import { TranslationService } from '@alfresco/adf-core';
import { ExtensionService, provideExtensionConfig } from '@alfresco/adf-extensions';
import { NgModule } from '@angular/core';
import * as rules from './folder-rules.rules';
import { CommonModule } from '@angular/common';
import { RouterModule, Routes } from '@angular/router';
import { EditRuleDialogUiComponent } from './rule-details/edit-rule-dialog.ui-component';
import { ManageRulesSmartComponent } from './manage-rules/manage-rules.smart-component';
import { RuleCompositeConditionUiComponent } from './rule-details/conditions/rule-composite-condition.ui-component';
import { RuleDetailsUiComponent } from './rule-details/rule-details.ui-component';
import { RuleSimpleConditionUiComponent } from './rule-details/conditions/rule-simple-condition.ui-component';
import { GenericErrorComponent, PageLayoutModule } from '@alfresco/aca-shared';
import { BreadcrumbModule, ContentNodeSelectorModule, DocumentListModule } from '@alfresco/adf-content-services';
import { RuleListItemUiComponent } from './rule-list/rule-list-item/rule-list-item.ui-component';
import { RuleListGroupingUiComponent } from './rule-list/rule-list-grouping/rule-list-grouping.ui-component';
import { RuleTriggersUiComponent } from './rule-details/triggers/rule-triggers.ui-component';
Expand All @@ -54,30 +51,20 @@ const routes: Routes = [
@NgModule({
providers: [provideExtensionConfig(['folder-rules.plugin.json'])],
imports: [
CommonModule,
RouterModule.forChild(routes),
CoreModule.forChild(),
PageLayoutModule,
BreadcrumbModule,
DocumentListModule,
ExtensionsModule,
ContentNodeSelectorModule,
GenericErrorComponent
],
declarations: [
EditRuleDialogUiComponent,
RuleListItemUiComponent,
RuleListGroupingUiComponent,
RuleListUiComponent,
ManageRulesSmartComponent,
RuleSetPickerSmartComponent,
RuleActionListUiComponent,
RuleActionUiComponent,
RuleCompositeConditionUiComponent,
RuleDetailsUiComponent,
RuleListGroupingUiComponent,
RuleListItemUiComponent,
RuleListUiComponent,
RuleSetPickerSmartComponent,
RuleSimpleConditionUiComponent,
RuleOptionsUiComponent,
RuleTriggersUiComponent,
RuleOptionsUiComponent
RuleDetailsUiComponent,
EditRuleDialogUiComponent
]
})
export class AcaFolderRulesModule {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
*/

import { ComponentFixture, TestBed } from '@angular/core/testing';
import { AcaFolderRulesModule } from '../folder-rules.module';
import { ManageRulesSmartComponent } from './manage-rules.smart-component';
import { DebugElement, Predicate } from '@angular/core';
import { CoreTestingModule } from '@alfresco/adf-core';
Expand Down Expand Up @@ -58,7 +57,7 @@ describe('ManageRulesSmartComponent', () => {

beforeEach(() => {
TestBed.configureTestingModule({
imports: [CoreTestingModule, AcaFolderRulesModule],
imports: [CoreTestingModule, ManageRulesSmartComponent],
providers: [
{
provide: AppService,
Expand All @@ -67,8 +66,6 @@ describe('ManageRulesSmartComponent', () => {
toggleAppNavBar$: new Subject()
}
},
FolderRuleSetsService,
FolderRulesService,
{ provide: Store, useValue: { dispatch: () => {} } },
{ provide: ActivatedRoute, useValue: { params: of({ nodeId: owningFolderIdMock }) } }
]
Expand Down Expand Up @@ -205,7 +202,9 @@ describe('ManageRulesSmartComponent', () => {
expect(ruleDetails).toBeFalsy();
});

it('should call deleteRule() if confirmation dialog returns true', () => {
// TODO: flaky test that needs review
// eslint-disable-next-line ban/ban
xit('should call deleteRule() if confirmation dialog returns true', () => {
const dialog = TestBed.inject(MatDialog);
folderRuleSetsService.folderInfo$ = of(owningFolderMock);
folderRuleSetsService.mainRuleSet$ = of(ownedRuleSetMock);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,26 +23,62 @@
*/

import { ChangeDetectionStrategy, Component, OnDestroy, OnInit, ViewEncapsulation } from '@angular/core';
import { Location } from '@angular/common';
import { CommonModule, Location } from '@angular/common';
import { FolderRulesService } from '../services/folder-rules.service';
import { Observable, Subject, Subscription } from 'rxjs';
import { Rule } from '../model/rule.model';
import { ActivatedRoute } from '@angular/router';
import { ActivatedRoute, RouterModule } from '@angular/router';
import { NodeInfo } from '@alfresco/aca-shared/store';
import { delay, takeUntil } from 'rxjs/operators';
import { EditRuleDialogUiComponent } from '../rule-details/edit-rule-dialog.ui-component';
import { MatDialog } from '@angular/material/dialog';
import { ConfirmDialogComponent } from '@alfresco/adf-content-services';
import { NotificationService } from '@alfresco/adf-core';
import { MatDialog, MatDialogModule } from '@angular/material/dialog';
import { BreadcrumbModule, ConfirmDialogComponent } from '@alfresco/adf-content-services';
import { NotificationService, TemplateModule, ToolbarModule } from '@alfresco/adf-core';
import { ActionDefinitionTransformed } from '../model/rule-action.model';
import { ActionsService } from '../services/actions.service';
import { FolderRuleSetsService } from '../services/folder-rule-sets.service';
import { RuleSet } from '../model/rule-set.model';
import { RuleSetPickerSmartComponent } from '../rule-set-picker/rule-set-picker.smart-component';
import { MatSlideToggleChange } from '@angular/material/slide-toggle';
import { MatSlideToggleChange, MatSlideToggleModule } from '@angular/material/slide-toggle';
import { ActionParameterConstraint } from '../model/action-parameter-constraint.model';
import { TranslateModule } from '@ngx-translate/core';
import {
GenericErrorComponent,
PageLayoutComponent,
PageLayoutContentComponent,
PageLayoutErrorComponent,
PageLayoutHeaderComponent
} from '@alfresco/aca-shared';
import { MatButtonModule } from '@angular/material/button';
import { MatIconModule } from '@angular/material/icon';
import { MatProgressBarModule } from '@angular/material/progress-bar';
import { MatDividerModule } from '@angular/material/divider';
import { RuleListUiComponent } from '../rule-list/rule-list/rule-list.ui-component';
import { RuleDetailsUiComponent } from '../rule-details/rule-details.ui-component';

@Component({
standalone: true,
imports: [
CommonModule,
TranslateModule,
PageLayoutComponent,
ToolbarModule,
MatButtonModule,
MatIconModule,
BreadcrumbModule,
MatProgressBarModule,
MatSlideToggleModule,
MatDividerModule,
RuleListUiComponent,
RouterModule,
TemplateModule,
PageLayoutErrorComponent,
PageLayoutContentComponent,
PageLayoutHeaderComponent,
GenericErrorComponent,
RuleDetailsUiComponent,
MatDialogModule
],
selector: 'aca-manage-rules',
templateUrl: 'manage-rules.smart-component.html',
styleUrls: ['manage-rules.smart-component.scss'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,21 @@
*/

import { Component, forwardRef, Input, OnDestroy, ViewEncapsulation } from '@angular/core';
import { ControlValueAccessor, FormArray, FormControl, NG_VALUE_ACCESSOR, Validators } from '@angular/forms';
import { ControlValueAccessor, FormArray, FormControl, NG_VALUE_ACCESSOR, ReactiveFormsModule, Validators } from '@angular/forms';
import { ActionDefinitionTransformed, RuleAction } from '../../model/rule-action.model';
import { Subscription } from 'rxjs';
import { ruleActionValidator } from '../validators/rule-actions.validator';
import { ActionParameterConstraint } from '../../model/action-parameter-constraint.model';
import { CommonModule } from '@angular/common';
import { TranslateModule } from '@ngx-translate/core';
import { RuleActionUiComponent } from './rule-action.ui-component';
import { MatButtonModule } from '@angular/material/button';
import { MatMenuModule } from '@angular/material/menu';
import { MatIconModule } from '@angular/material/icon';

@Component({
standalone: true,
imports: [CommonModule, TranslateModule, RuleActionUiComponent, ReactiveFormsModule, MatButtonModule, MatMenuModule, MatIconModule],
selector: 'aca-rule-action-list',
templateUrl: './rule-action-list.ui-component.html',
styleUrls: ['./rule-action-list.ui-component.scss'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ describe('RuleActionUiComponent', () => {

beforeEach(() => {
TestBed.configureTestingModule({
imports: [CoreTestingModule]
imports: [CoreTestingModule, RuleActionUiComponent]
});

fixture = TestBed.createComponent(RuleActionUiComponent);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@
*/

import { Component, forwardRef, Input, OnChanges, OnDestroy, OnInit, SimpleChanges, ViewEncapsulation } from '@angular/core';
import { ControlValueAccessor, FormControl, FormGroup, NG_VALUE_ACCESSOR, Validators } from '@angular/forms';
import { ControlValueAccessor, FormControl, FormGroup, NG_VALUE_ACCESSOR, ReactiveFormsModule, Validators } from '@angular/forms';
import { ActionDefinitionTransformed, RuleAction } from '../../model/rule-action.model';
import { CardViewItem } from '@alfresco/adf-core/lib/card-view/interfaces/card-view-item.interface';
import {
CardViewBoolItemModel,
CardViewModule,
CardViewSelectItemModel,
CardViewSelectItemOption,
CardViewTextItemModel,
Expand All @@ -40,9 +41,14 @@ import { takeUntil } from 'rxjs/operators';
import { ActionParameterConstraint, ConstraintValue } from '../../model/action-parameter-constraint.model';
import { ContentNodeSelectorComponent, ContentNodeSelectorComponentData, NodeAction } from '@alfresco/adf-content-services';
import { MatDialog } from '@angular/material/dialog';
import { TranslateService } from '@ngx-translate/core';
import { TranslateModule, TranslateService } from '@ngx-translate/core';
import { CommonModule } from '@angular/common';
import { MatFormFieldModule } from '@angular/material/form-field';
import { MatSelectModule } from '@angular/material/select';

@Component({
standalone: true,
imports: [CommonModule, TranslateModule, ReactiveFormsModule, MatFormFieldModule, MatSelectModule, CardViewModule],
selector: 'aca-rule-action',
templateUrl: './rule-action.ui-component.html',
styleUrls: ['./rule-action.ui-component.scss'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ describe('RuleCompositeConditionUiComponent', () => {

beforeEach(() => {
TestBed.configureTestingModule({
imports: [CoreTestingModule],
declarations: [RuleCompositeConditionUiComponent, RuleSimpleConditionUiComponent]
imports: [CoreTestingModule, RuleCompositeConditionUiComponent, RuleSimpleConditionUiComponent]
});

fixture = TestBed.createComponent(RuleCompositeConditionUiComponent);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,30 @@

import { Component, forwardRef, HostBinding, Input, OnChanges, OnDestroy, SimpleChanges, ViewEncapsulation } from '@angular/core';
import { RuleCompositeCondition } from '../../model/rule-composite-condition.model';
import { ControlValueAccessor, FormArray, FormControl, FormGroup, NG_VALUE_ACCESSOR } from '@angular/forms';
import { ControlValueAccessor, FormArray, FormControl, FormGroup, NG_VALUE_ACCESSOR, ReactiveFormsModule } from '@angular/forms';
import { RuleSimpleCondition } from '../../model/rule-simple-condition.model';
import { CommonModule } from '@angular/common';
import { TranslateModule } from '@ngx-translate/core';
import { MatFormFieldModule } from '@angular/material/form-field';
import { MatSelectModule } from '@angular/material/select';
import { MatButtonModule } from '@angular/material/button';
import { MatMenuModule } from '@angular/material/menu';
import { MatIconModule } from '@angular/material/icon';
import { RuleSimpleConditionUiComponent } from './rule-simple-condition.ui-component';

@Component({
standalone: true,
imports: [
CommonModule,
TranslateModule,
ReactiveFormsModule,
MatFormFieldModule,
MatSelectModule,
MatButtonModule,
MatMenuModule,
MatIconModule,
RuleSimpleConditionUiComponent
],
selector: 'aca-rule-composite-condition',
templateUrl: './rule-composite-condition.ui-component.html',
styleUrls: ['./rule-composite-condition.ui-component.scss'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ describe('RuleSimpleConditionUiComponent', () => {

beforeEach(() => {
TestBed.configureTestingModule({
imports: [CoreTestingModule],
declarations: [RuleSimpleConditionUiComponent]
imports: [CoreTestingModule, RuleSimpleConditionUiComponent]
});

fixture = TestBed.createComponent(RuleSimpleConditionUiComponent);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,21 @@
*/

import { Component, forwardRef, Input, OnDestroy, ViewEncapsulation } from '@angular/core';
import { AbstractControl, ControlValueAccessor, FormControl, FormGroup, NG_VALUE_ACCESSOR } from '@angular/forms';
import { AbstractControl, ControlValueAccessor, FormControl, FormGroup, NG_VALUE_ACCESSOR, ReactiveFormsModule } from '@angular/forms';
import { RuleSimpleCondition } from '../../model/rule-simple-condition.model';
import { comparatorHiddenForConditionFieldType, RuleConditionField, ruleConditionFields } from './rule-condition-fields';
import { RuleConditionComparator, ruleConditionComparators } from './rule-condition-comparators';
import { AppConfigService } from '@alfresco/adf-core';
import { MimeType } from './rule-mime-types';
import { CommonModule } from '@angular/common';
import { TranslateModule } from '@ngx-translate/core';
import { MatFormFieldModule } from '@angular/material/form-field';
import { MatSelectModule } from '@angular/material/select';
import { MatInputModule } from '@angular/material/input';

@Component({
standalone: true,
imports: [CommonModule, TranslateModule, ReactiveFormsModule, MatFormFieldModule, MatSelectModule, MatInputModule],
selector: 'aca-rule-simple-condition',
templateUrl: './rule-simple-condition.ui-component.html',
styleUrls: ['./rule-simple-condition.ui-component.scss'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@ import { By } from '@angular/platform-browser';
import { RuleDetailsUiComponent } from './rule-details.ui-component';
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
import { CoreTestingModule } from '@alfresco/adf-core';
import { RuleCompositeConditionUiComponent } from './conditions/rule-composite-condition.ui-component';
import { RuleTriggersUiComponent } from './triggers/rule-triggers.ui-component';
import { RuleActionListUiComponent } from './actions/rule-action-list.ui-component';
import { RuleActionUiComponent } from './actions/rule-action.ui-component';
import { RuleOptionsUiComponent } from './options/rule-options.ui-component';
import { of, timer } from 'rxjs';

describe('EditRuleDialogSmartComponent', () => {
Expand All @@ -45,16 +40,7 @@ describe('EditRuleDialogSmartComponent', () => {

const setupBeforeEach = (dialogOptions: EditRuleDialogOptions = { actionDefinitions$: of([]), parameterConstraints$: of([]) }) => {
TestBed.configureTestingModule({
imports: [CoreTestingModule],
declarations: [
EditRuleDialogUiComponent,
RuleCompositeConditionUiComponent,
RuleDetailsUiComponent,
RuleTriggersUiComponent,
RuleActionListUiComponent,
RuleActionUiComponent,
RuleOptionsUiComponent
],
imports: [CoreTestingModule, EditRuleDialogUiComponent],
providers: [
{ provide: MatDialogRef, useValue: dialogRef },
{ provide: MAT_DIALOG_DATA, useValue: dialogOptions }
Expand Down
Loading