-
Notifications
You must be signed in to change notification settings - Fork 460
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature/container properties form (#23020)
* Added Tabs to Container Create Page and updated translation strings * Added container properties component and added Inplace editor to it * Removed unused comment * [WIP] Properties form UI updated * Added Monaco Editor to Properties Form * add history and permission iframe * refactoring * create edit route for container and resolver * Added controls to container form * change component and folders name * Added method docs, Added translations, Minor fixes * Added missing translations * Added MonacoEditor type model for reusability * CSS refactor * CSS refactor * Renamed container create component as DotContainerCreateComponent * Component and SCSS refactor * Refactored Loop editor to new component * Update core-web/apps/dotcms-ui/src/app/portlets/dot-containers/dot-container-create/dot-container-history/dot-container-history.component.ts Co-authored-by: Rafael Velazco <rjvelazco21@gmail.com> * Update core-web/apps/dotcms-ui/src/app/portlets/dot-containers/dot-container-create/dot-container-permissions/dot-container-permissions.component.ts Co-authored-by: Rafael Velazco <rjvelazco21@gmail.com> * Refactored Content Editor to new component * Fixed Permissions and History componanets * change css style and remove unnecessary ng deep * change css style and remove unnecessary ng deep * Update core-web/apps/dotcms-ui/src/app/portlets/dot-containers/dot-container-create/dot-container-create.component.scss Co-authored-by: Freddy Montes <freddymontes@gmail.com> * Update core-web/apps/dotcms-ui/src/app/portlets/dot-containers/dot-container-create/dot-content-editor/store/dot-content-editor.store.ts Co-authored-by: Freddy Montes <freddymontes@gmail.com> * Removed unnecessary monaco editor initializations * fixed box height issue Co-authored-by: Zulqarnain Huda <zulqarnain.huda@venturedive.com> Co-authored-by: zulqarnainvd <113915849+zulqarnainvd@users.noreply.github.com> Co-authored-by: Rafael Velazco <rjvelazco21@gmail.com> Co-authored-by: Freddy Montes <freddymontes@gmail.com>
- Loading branch information
1 parent
ad819bf
commit a7a2f78
Showing
43 changed files
with
864 additions
and
79 deletions.
There are no files selected for viewing
21 changes: 0 additions & 21 deletions
21
...otcms-ui/src/app/portlets/dot-containers/container-create/container-create.component.scss
This file was deleted.
Oops, something went wrong.
22 changes: 0 additions & 22 deletions
22
...ms-ui/src/app/portlets/dot-containers/container-create/container-create.component.spec.ts
This file was deleted.
Oops, something went wrong.
8 changes: 0 additions & 8 deletions
8
.../dotcms-ui/src/app/portlets/dot-containers/container-create/container-create.component.ts
This file was deleted.
Oops, something went wrong.
20 changes: 0 additions & 20 deletions
20
...pps/dotcms-ui/src/app/portlets/dot-containers/container-create/container-create.module.ts
This file was deleted.
Oops, something went wrong.
6 changes: 3 additions & 3 deletions
6
...create/container-create-routing.module.ts → ...te/dot-container-create-routing.module.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { RouterModule, Routes } from '@angular/router'; | ||
import { ContainerCreateComponent } from './container-create.component'; | ||
import { DotContainerCreateComponent } from './dot-container-create.component'; | ||
|
||
const routes: Routes = [ | ||
{ | ||
path: '', | ||
component: ContainerCreateComponent | ||
component: DotContainerCreateComponent | ||
} | ||
]; | ||
|
||
@NgModule({ | ||
imports: [RouterModule.forChild(routes)], | ||
exports: [RouterModule] | ||
}) | ||
export class ContainerCreateRoutingModule {} | ||
export class DotContainerCreateRoutingModule {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
.../src/app/portlets/dot-containers/dot-container-create/dot-container-create.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
@use "variables" as *; | ||
|
||
.container-create__tab-container ::ng-deep { | ||
.p-tabview { | ||
height: 100%; | ||
} | ||
.p-tabview-panels { | ||
height: 100%; | ||
flex-grow: 1; | ||
flex-basis: 0; | ||
overflow: scroll; | ||
} | ||
.p-tabview-nav { | ||
padding: 0 $spacing-4; | ||
background: $white; | ||
} | ||
|
||
.p-tabview-panel { | ||
height: 100%; | ||
padding: 0 $spacing-4; | ||
padding-top: $spacing-4; | ||
} | ||
} | ||
|
||
.container-create__tab-container { | ||
display: flex; | ||
flex-direction: column; | ||
height: 100%; | ||
} | ||
|
||
.container-create__tabs { | ||
height: 100%; | ||
} |
35 changes: 35 additions & 0 deletions
35
...c/app/portlets/dot-containers/dot-container-create/dot-container-create.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { DotContainerCreateComponent } from './dot-container-create.component'; | ||
import { DotMessagePipeModule } from '@pipes/dot-message/dot-message-pipe.module'; | ||
import { DotMessageService } from '@services/dot-message/dot-messages.service'; | ||
import { CoreWebService } from '@dotcms/dotcms-js'; | ||
import { CoreWebServiceMock } from '@tests/core-web.service.mock'; | ||
import { MockDotMessageService } from '@tests/dot-message-service.mock'; | ||
|
||
const messages = {}; | ||
|
||
describe('ContainerCreateComponent', () => { | ||
let component: DotContainerCreateComponent; | ||
let fixture: ComponentFixture<DotContainerCreateComponent>; | ||
const messageServiceMock = new MockDotMessageService(messages); | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
declarations: [DotContainerCreateComponent], | ||
imports: [DotMessagePipeModule], | ||
providers: [ | ||
{ provide: DotMessageService, useValue: messageServiceMock }, | ||
{ provide: CoreWebService, useClass: CoreWebServiceMock } | ||
] | ||
}).compileComponents(); | ||
|
||
fixture = TestBed.createComponent(DotContainerCreateComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
8 changes: 8 additions & 0 deletions
8
...ui/src/app/portlets/dot-containers/dot-container-create/dot-container-create.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { Component } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'dot-container-create', | ||
templateUrl: './dot-container-create.component.html', | ||
styleUrls: ['./dot-container-create.component.scss'] | ||
}) | ||
export class DotContainerCreateComponent {} |
26 changes: 26 additions & 0 deletions
26
...ms-ui/src/app/portlets/dot-containers/dot-container-create/dot-container-create.module.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { CommonModule } from '@angular/common'; | ||
|
||
import { DotContainerCreateRoutingModule } from './dot-container-create-routing.module'; | ||
import { DotContainerCreateComponent } from './dot-container-create.component'; | ||
import { DotPortletBaseModule } from '@components/dot-portlet-base/dot-portlet-base.module'; | ||
import { TabViewModule } from 'primeng/tabview'; | ||
import { DotMessagePipeModule } from '@pipes/dot-message/dot-message-pipe.module'; | ||
import { DotContainerPropertiesModule } from '@portlets/dot-containers/dot-container-create/dot-container-properties/dot-container-properties.module'; | ||
import { DotContainerPermissionsModule } from '@dotcms/app/portlets/dot-containers/dot-container-create/dot-container-permissions/dot-container-permissions.module'; | ||
import { DotContainerHistoryModule } from '@dotcms/app/portlets/dot-containers/dot-container-create/dot-container-history/dot-container-history.module'; | ||
|
||
@NgModule({ | ||
declarations: [DotContainerCreateComponent], | ||
imports: [ | ||
CommonModule, | ||
DotContainerCreateRoutingModule, | ||
DotPortletBaseModule, | ||
TabViewModule, | ||
DotMessagePipeModule, | ||
DotContainerPropertiesModule, | ||
DotContainerPermissionsModule, | ||
DotContainerHistoryModule | ||
] | ||
}) | ||
export class DotContainerCreateModule {} |
3 changes: 3 additions & 0 deletions
3
...ontainers/dot-container-create/dot-container-history/dot-container-history.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<dot-portlet-box> | ||
<dot-iframe data-testId="historyIframe" [src]="historyUrl"></dot-iframe> | ||
</dot-portlet-box> |
5 changes: 5 additions & 0 deletions
5
...ontainers/dot-container-create/dot-container-history/dot-container-history.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
dot-portlet-box { | ||
height: 100%; | ||
overflow-x: auto; | ||
margin: 0; | ||
} |
47 changes: 47 additions & 0 deletions
47
...ainers/dot-container-create/dot-container-history/dot-container-history.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import { Component, DebugElement, ElementRef, Input, ViewChild } from '@angular/core'; | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
import { By } from '@angular/platform-browser'; | ||
import { DotContainerHistoryComponent } from './dot-container-history.component'; | ||
import { DotPortletBoxModule } from '@components/dot-portlet-base/components/dot-portlet-box/dot-portlet-box.module'; | ||
|
||
@Component({ | ||
selector: 'dot-iframe', | ||
template: '' | ||
}) | ||
export class IframeMockComponent { | ||
@Input() src: string; | ||
@ViewChild('iframeElement') iframeElement: ElementRef; | ||
} | ||
|
||
describe('ContainerHistoryComponent', () => { | ||
let component: DotContainerHistoryComponent; | ||
let fixture: ComponentFixture<DotContainerHistoryComponent>; | ||
let de: DebugElement; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
declarations: [DotContainerHistoryComponent, IframeMockComponent], | ||
imports: [DotPortletBoxModule] | ||
}).compileComponents(); | ||
|
||
fixture = TestBed.createComponent(DotContainerHistoryComponent); | ||
de = fixture.debugElement; | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
|
||
describe('history', () => { | ||
beforeEach(() => { | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should set iframe history url', () => { | ||
const permissions = de.query(By.css('[data-testId="historyIframe"]')); | ||
expect(permissions.componentInstance.src).toBe('/html/containers/push_history.jsp'); | ||
}); | ||
}); | ||
}); |
18 changes: 18 additions & 0 deletions
18
...-containers/dot-container-create/dot-container-history/dot-container-history.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { Component, OnChanges, ViewChild } from '@angular/core'; | ||
import { IframeComponent } from '@components/_common/iframe/iframe-component'; | ||
|
||
@Component({ | ||
selector: 'dot-container-history', | ||
templateUrl: './dot-container-history.component.html', | ||
styleUrls: ['./dot-container-history.component.scss'] | ||
}) | ||
export class DotContainerHistoryComponent implements OnChanges { | ||
@ViewChild('historyIframe') historyIframe: IframeComponent; | ||
historyUrl = '/html/containers/push_history.jsp'; | ||
|
||
ngOnChanges(): void { | ||
if (this.historyIframe) { | ||
this.historyIframe.iframeElement.nativeElement.contentWindow.location.reload(); | ||
} | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
...dot-containers/dot-container-create/dot-container-history/dot-container-history.module.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { CommonModule } from '@angular/common'; | ||
|
||
import { DotContainerHistoryComponent } from './dot-container-history.component'; | ||
import { DotPortletBoxModule } from '@components/dot-portlet-base/components/dot-portlet-box/dot-portlet-box.module'; | ||
import { IFrameModule } from '@components/_common/iframe'; | ||
|
||
@NgModule({ | ||
declarations: [DotContainerHistoryComponent], | ||
exports: [DotContainerHistoryComponent], | ||
imports: [CommonModule, DotPortletBoxModule, IFrameModule] | ||
}) | ||
export class DotContainerHistoryModule {} |
3 changes: 3 additions & 0 deletions
3
...s/dot-container-create/dot-container-permissions/dot-container-permissions.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<dot-portlet-box> | ||
<dot-iframe data-testId="permissionsIframe" [src]="permissionsUrl"></dot-iframe> | ||
</dot-portlet-box> |
5 changes: 5 additions & 0 deletions
5
...s/dot-container-create/dot-container-permissions/dot-container-permissions.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
dot-portlet-box { | ||
height: 100%; | ||
overflow-x: auto; | ||
margin: 0; | ||
} |
47 changes: 47 additions & 0 deletions
47
...ot-container-create/dot-container-permissions/dot-container-permissions.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import { Component, DebugElement, ElementRef, Input, ViewChild } from '@angular/core'; | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
import { By } from '@angular/platform-browser'; | ||
import { DotContainerPermissionsComponent } from './dot-container-permissions.component'; | ||
import { DotPortletBoxModule } from '@components/dot-portlet-base/components/dot-portlet-box/dot-portlet-box.module'; | ||
|
||
@Component({ | ||
selector: 'dot-iframe', | ||
template: '' | ||
}) | ||
export class IframeMockComponent { | ||
@Input() src: string; | ||
@ViewChild('iframeElement') iframeElement: ElementRef; | ||
} | ||
|
||
describe('ContainerPermissionsComponent', () => { | ||
let component: DotContainerPermissionsComponent; | ||
let fixture: ComponentFixture<DotContainerPermissionsComponent>; | ||
let de: DebugElement; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
declarations: [DotContainerPermissionsComponent, IframeMockComponent], | ||
imports: [DotPortletBoxModule] | ||
}).compileComponents(); | ||
|
||
fixture = TestBed.createComponent(DotContainerPermissionsComponent); | ||
de = fixture.debugElement; | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
|
||
describe('permissions', () => { | ||
beforeEach(() => { | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should set iframe permissions url', () => { | ||
const permissions = de.query(By.css('[data-testId="permissionsIframe"]')); | ||
expect(permissions.componentInstance.src).toBe('/html/containers/permissions.jsp'); | ||
}); | ||
}); | ||
}); |
10 changes: 10 additions & 0 deletions
10
...ers/dot-container-create/dot-container-permissions/dot-container-permissions.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { Component } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'dot-container-permissions', | ||
templateUrl: './dot-container-permissions.component.html', | ||
styleUrls: ['./dot-container-permissions.component.scss'] | ||
}) | ||
export class DotContainerPermissionsComponent { | ||
permissionsUrl = '/html/containers/permissions.jsp'; | ||
} |
13 changes: 13 additions & 0 deletions
13
...ainers/dot-container-create/dot-container-permissions/dot-container-permissions.module.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { CommonModule } from '@angular/common'; | ||
|
||
import { DotContainerPermissionsComponent } from './dot-container-permissions.component'; | ||
import { DotPortletBoxModule } from '@components/dot-portlet-base/components/dot-portlet-box/dot-portlet-box.module'; | ||
import { IFrameModule } from '@components/_common/iframe'; | ||
|
||
@NgModule({ | ||
declarations: [DotContainerPermissionsComponent], | ||
exports: [DotContainerPermissionsComponent], | ||
imports: [CommonModule, DotPortletBoxModule, IFrameModule] | ||
}) | ||
export class DotContainerPermissionsModule {} |
Oops, something went wrong.