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

Feature/container properties form #23020

Merged
merged 31 commits into from
Oct 4, 2022
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
c9f4b49
Added Tabs to Container Create Page and updated translation strings
motasimvd Sep 6, 2022
c227fd5
Added container properties component and added Inplace editor to it
motasimvd Sep 7, 2022
3583061
Removed unused comment
motasimvd Sep 8, 2022
15bd51c
Merge branch 'feature/container-properties' into feature/container-pr…
motasimvd Sep 11, 2022
e47a1fd
[WIP] Properties form UI updated
motasimvd Sep 14, 2022
b0d96dc
Added Monaco Editor to Properties Form
motasimvd Sep 19, 2022
b551ec6
Merge branch 'canary' into feature/container-properties-form
motasimvd Sep 19, 2022
8810dbf
add history and permission iframe
zulqarnainvd Sep 20, 2022
8479072
refactoring
zulqarnainvd Sep 21, 2022
8958892
create edit route for container and resolver
zulqarnainvd Sep 22, 2022
57ce542
Added controls to container form
motasimvd Sep 26, 2022
34b3f69
change component and folders name
zulqarnainvd Sep 27, 2022
2e69e8d
Added method docs, Added translations, Minor fixes
motasimvd Sep 29, 2022
c2b395f
Added missing translations
motasimvd Sep 29, 2022
adf59d6
Added MonacoEditor type model for reusability
motasimvd Sep 29, 2022
2af4929
CSS refactor
motasimvd Sep 29, 2022
260bbb2
CSS refactor
motasimvd Sep 29, 2022
8b25be2
Renamed container create component as DotContainerCreateComponent
motasimvd Sep 29, 2022
45bafe7
Component and SCSS refactor
motasimvd Oct 2, 2022
2b1d0ed
Refactored Loop editor to new component
motasimvd Oct 3, 2022
0598457
Update core-web/apps/dotcms-ui/src/app/portlets/dot-containers/dot-co…
zulqarnainvd Oct 3, 2022
69b736b
Update core-web/apps/dotcms-ui/src/app/portlets/dot-containers/dot-co…
zulqarnainvd Oct 3, 2022
52e20ab
Refactored Content Editor to new component
motasimvd Oct 3, 2022
00f0da0
Merge remote-tracking branch 'origin/feature/container-properties-for…
motasimvd Oct 3, 2022
9043a59
Fixed Permissions and History componanets
motasimvd Oct 3, 2022
d47e0c3
change css style and remove unnecessary ng deep
zulqarnainvd Oct 3, 2022
61d5453
change css style and remove unnecessary ng deep
zulqarnainvd Oct 3, 2022
87f0429
Update core-web/apps/dotcms-ui/src/app/portlets/dot-containers/dot-co…
motasimvd Oct 4, 2022
f70673e
Update core-web/apps/dotcms-ui/src/app/portlets/dot-containers/dot-co…
motasimvd Oct 4, 2022
998cba5
Removed unnecessary monaco editor initializations
motasimvd Oct 4, 2022
77f10b8
fixed box height issue
zulqarnainvd Oct 4, 2022
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
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
<div class="container-create__tab-container">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

missing the "dot-" prefix

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alfredo-dotcms , Fixed.

<p-tabView class="container-create__tabs">
<p-tabPanel [header]="'message.containers.tab.properties' | dm">
<ng-template pTemplate="content"> Complex Content to Lazy Load 1 </ng-template>
<ng-template pTemplate="content">
<dot-container-properties></dot-container-properties>
</ng-template>
</p-tabPanel>
<p-tabPanel [header]="'message.containers.tab.permissions' | dm">
<ng-template pTemplate="content"> Complex Content to Lazy Load 2 </ng-template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
display: flex;
flex: 1;
flex-direction: column;
overflow: auto;

.container-create__tabs {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need this nesting here.

.p-tabview-nav {
Expand All @@ -14,7 +15,7 @@

.p-tabview-panel {
padding: 0 $spacing-4;
padding-top: $spacing-8;
padding-top: $spacing-4;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { ContainerCreateComponent } from './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/container-create/dot-container-properties/dot-container-properties.module';

@NgModule({
declarations: [ContainerCreateComponent],
Expand All @@ -14,6 +15,8 @@ import { DotMessagePipeModule } from '@pipes/dot-message/dot-message-pipe.module
ContainerCreateRoutingModule,
DotPortletBaseModule,
TabViewModule,
DotMessagePipeModule,
DotContainerPropertiesModule,
DotMessagePipeModule
]
})
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<ng-container>
<div class="dot-container-properties__title-container">
<p-inplace #editText>
<ng-template pTemplate="content">
<span class="p-input-icon-right">
<i class="pi pi-times" (click)="editText.deactivate()"></i>
<input type="text" pInputText />
</span>
</ng-template>
<ng-template pTemplate="display">
Click to Edit
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

language key

<i class="pi pi-pencil"></i>
</ng-template>
</p-inplace>
</div>
<div class="field">
<label for="description" class="block">Description</label>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

language key

<input id="description" type="text" pInputText />
</div>
<div class="field">
<label for="max-contents" class="block">Max Contents</label>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

language key

<input id="max-contents" type="text" pInputText />
<button pButton class="p-button-secondary" type="button" label="Clear"></button>
<button pButton type="button" label="content type code"></button>
</div>

<div class="dot-container-properties__code-container-outer">
<div class="dot-container-properties__pre-post-loop">
<div class="dot-container-properties__pre-post-loop-inplace">
<button
pButton
class="p-button-outlined p-button-secondary"
type="button"
label="ADD PRE AND POST LOOP CODE"
></button>
</div>
</div>
<div>
<form [formGroup]="form">
<dot-textarea-content
formControlName="body"
#value
height="100%"
formControlName="body"
[show]="['code']"
language="html"
(monacoInit)="initEditor($event)"
></dot-textarea-content>
</form>
</div>
<div class="dot-container-properties__pre-post-loop">
<div class="dot-container-properties__pre-post-loop-inplace">
<button
pButton
class="p-button-outlined p-button-secondary"
type="button"
label="ADD PRE AND POST LOOP CODE"
></button>
</div>
</div>
</div>
</ng-container>
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
@use "variables" as *;

:host {
.dot-container-properties__title-container {
padding: $spacing-4 0;
}

.dot-container-properties__code-container-outer {
background: $white;
display: flex;
height: 100%;
flex-direction: column;

.dot-container-properties__pre-post-loop {
.dot-container-properties__pre-post-loop-inplace {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't need all this nesting, BEM does it implicitly

display: flex;
align-items: center;
justify-content: center;
padding: $spacing-6;
background: #e9ebfc;
}
}

form {
margin: $spacing-3;
height: 100%;
display: flex;
flex-direction: column;
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With BEM you don't need all the nesting.

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import { Component, Input, OnInit } from '@angular/core';
import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms';

interface MonacoEditorOperation {
range: number;
text: string;
forceMoveMarkers: boolean;
}

interface MonacoEditor {
getSelection: () => number;
executeEdits: (action: string, data: MonacoEditorOperation[]) => void;
}
fmontes marked this conversation as resolved.
Show resolved Hide resolved

@Component({
selector: 'dot-container-properties',
templateUrl: './dot-container-properties.component.html',
styleUrls: ['./dot-container-properties.component.scss']
})
export class DotContainerPropertiesComponent implements OnInit {
editor: MonacoEditor;
form: UntypedFormGroup;

@Input() body: string;

constructor(private fb: UntypedFormBuilder) {
//
}

ngOnInit(): void {
this.form = this.fb.group({ body: this.body });
}

/**
* This method initializes the monaco editor
*
* @param {*} editor
* @memberof DotTemplateComponent
*/
initEditor(editor: MonacoEditor): void {
this.editor = editor;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { NgModule } from '@angular/core';
import { DotContainerPropertiesComponent } from '@portlets/dot-containers/container-create/dot-container-properties/dot-container-properties.component';
import { CommonModule } from '@angular/common';
import { InplaceModule } from 'primeng/inplace';
import { SharedModule } from 'primeng/api';
import { InputTextModule } from 'primeng/inputtext';
import { DotPortletBaseModule } from '@components/dot-portlet-base/dot-portlet-base.module';
import { CardModule } from 'primeng/card';
import { DotTextareaContentModule } from '@components/_common/dot-textarea-content/dot-textarea-content.module';
import { ReactiveFormsModule } from '@angular/forms';
@NgModule({
declarations: [DotContainerPropertiesComponent],
exports: [DotContainerPropertiesComponent],
imports: [
CommonModule,
InplaceModule,
SharedModule,
InputTextModule,
DotPortletBaseModule,
CardModule,
DotTextareaContentModule,
ReactiveFormsModule
]
})
export class DotContainerPropertiesModule {}