Commit 8e94c634 authored by vtduong0912's avatar vtduong0912

tinyMCE added

parent 9fd6656f
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
"inlineStyleLanguage": "scss", "inlineStyleLanguage": "scss",
"assets": [ "assets": [
"src/assets", "src/assets",
{ "glob": "**/*", "input": "node_modules/tinymce", "output": "/tinymce/" },
{ {
"glob": "**/*", "glob": "**/*",
"input": "src/assets/", "input": "src/assets/",
...@@ -38,7 +39,9 @@ ...@@ -38,7 +39,9 @@
} }
], ],
"styles": ["src/styles.scss"], "styles": ["src/styles.scss"],
"scripts": [] "scripts": [
"node_modules/tinymce/tinymce.min.js"
]
}, },
"configurations": { "configurations": {
"production": { "production": {
......
This diff is collapsed.
...@@ -8,16 +8,21 @@ import { JobApi } from '../data-access/model/job-manager.model'; ...@@ -8,16 +8,21 @@ import { JobApi } from '../data-access/model/job-manager.model';
import { NzNotificationService } from 'ng-zorro-antd/notification' import { NzNotificationService } from 'ng-zorro-antd/notification'
import { catchError, of, tap } from 'rxjs'; import { catchError, of, tap } from 'rxjs';
import { NzFormModule } from 'ng-zorro-antd/form'; import { NzFormModule } from 'ng-zorro-antd/form';
import { EditorComponent, TINYMCE_SCRIPT_SRC } from '@tinymce/tinymce-angular'
import { CommonModule } from '@angular/common';
@Component({ @Component({
selector: 'job-form', selector: 'job-form',
standalone: true, standalone: true,
imports: [ imports: [
CommonModule,
NzButtonModule, NzButtonModule,
NzModalModule, NzModalModule,
ReactiveFormsModule, ReactiveFormsModule,
NzFormModule NzFormModule,
EditorComponent,
], ],
providers: [{ provide: TINYMCE_SCRIPT_SRC, useValue: 'tinymce/tinymce.min.js' }],
template: ` template: `
<div class="tw-w-full tw-grid tw-justify-items-end"> <div class="tw-w-full tw-grid tw-justify-items-end">
<button nz-button nzType="primary" (click)="isCreate = true">Create new job</button> <button nz-button nzType="primary" (click)="isCreate = true">Create new job</button>
...@@ -29,8 +34,7 @@ import { NzFormModule } from 'ng-zorro-antd/form'; ...@@ -29,8 +34,7 @@ import { NzFormModule } from 'ng-zorro-antd/form';
<div> <div>
<label>Type</label> <label>Type</label>
<select class="tw-border tw-rounded-lg tw-w-full tw-h-8" formControlName="type"> <select class="tw-border tw-rounded-lg tw-w-full tw-h-8" formControlName="type">
<option value="Full Time">Full Time</option> <option *ngFor="let item of jobTypeItems" (value)="item"> {{ item }} </option>
<option value="Part Time">Part Time</option>
</select> </select>
</div> </div>
<div class="tw-col-span-2"> <div class="tw-col-span-2">
...@@ -78,7 +82,7 @@ import { NzFormModule } from 'ng-zorro-antd/form'; ...@@ -78,7 +82,7 @@ import { NzFormModule } from 'ng-zorro-antd/form';
<nz-form-item> <nz-form-item>
<nz-form-control nzErrorTip="Please enter description!"> <nz-form-control nzErrorTip="Please enter description!">
<nz-input-group> <nz-input-group>
<textarea class="tw-border tw-rounded-lg tw-w-full tw-h-40" type="text" formControlName="description"></textarea> <editor apiKey="4nrurq8srrs4laamy5l9tbrd2je0huj4bu3z3mweu864gkfj" [init]="init" formControlName="description"></editor>
</nz-input-group> </nz-input-group>
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
...@@ -122,9 +126,9 @@ import { NzFormModule } from 'ng-zorro-antd/form'; ...@@ -122,9 +126,9 @@ import { NzFormModule } from 'ng-zorro-antd/form';
export class JobFormComponent { export class JobFormComponent {
@Output() ReloadData = new EventEmitter(); @Output() ReloadData = new EventEmitter();
isCreate: boolean = false; isCreate: boolean = false;
jobCreatingFormGroup: FormGroup; jobCreatingFormGroup: FormGroup;
jobTypeItems = ['Full Time', 'Part Time'];
constructor(private _fb: FormBuilder, constructor(private _fb: FormBuilder,
private _service: JobManagerService, private _service: JobManagerService,
...@@ -142,6 +146,10 @@ export class JobFormComponent { ...@@ -142,6 +146,10 @@ export class JobFormComponent {
}); });
} }
init: EditorComponent['init'] = {
plugins: 'lists link image table code help wordcount'
};
createNotification(type: string, title: string, message: string): void { createNotification(type: string, title: string, message: string): void {
this._notification.create( this._notification.create(
type, type,
......
...@@ -3,7 +3,7 @@ import { NzLayoutModule } from 'ng-zorro-antd/layout'; ...@@ -3,7 +3,7 @@ import { NzLayoutModule } from 'ng-zorro-antd/layout';
import { NzTableModule } from 'ng-zorro-antd/table'; import { NzTableModule } from 'ng-zorro-antd/table';
import { CommonModule } from '@angular/common'; import { CommonModule } from '@angular/common';
import { JobManagerService } from '../data-access/service/job-manager.service'; import { JobManagerService } from '../data-access/service/job-manager.service';
import { Observable, Observer, catchError, of, tap } from 'rxjs'; import { catchError, of, tap } from 'rxjs';
import { ResponseResult, Rows } from '../../../../shared/data-access/interface/response.type'; import { ResponseResult, Rows } from '../../../../shared/data-access/interface/response.type';
import { JobApi } from '../data-access/model/job-manager.model'; import { JobApi } from '../data-access/model/job-manager.model';
import { NzButtonModule } from 'ng-zorro-antd/button'; import { NzButtonModule } from 'ng-zorro-antd/button';
...@@ -13,7 +13,8 @@ import { FormBuilder, FormGroup, FormsModule, ReactiveFormsModule, Validators } ...@@ -13,7 +13,8 @@ import { FormBuilder, FormGroup, FormsModule, ReactiveFormsModule, Validators }
import { NzFormModule } from 'ng-zorro-antd/form'; import { NzFormModule } from 'ng-zorro-antd/form';
import { NzNotificationService } from 'ng-zorro-antd/notification'; import { NzNotificationService } from 'ng-zorro-antd/notification';
import { NzIconModule } from 'ng-zorro-antd/icon'; import { NzIconModule } from 'ng-zorro-antd/icon';
import { NzUploadFile, NzUploadModule } from 'ng-zorro-antd/upload'; import { NzUploadModule } from 'ng-zorro-antd/upload';
import { EditorComponent } from '@tinymce/tinymce-angular';
@Component({ @Component({
selector: 'job-list', selector: 'job-list',
...@@ -30,6 +31,7 @@ import { NzUploadFile, NzUploadModule } from 'ng-zorro-antd/upload'; ...@@ -30,6 +31,7 @@ import { NzUploadFile, NzUploadModule } from 'ng-zorro-antd/upload';
NzIconModule, NzIconModule,
FormsModule, FormsModule,
NzUploadModule, NzUploadModule,
EditorComponent,
], ],
styles: ` styles: `
nz-table[_ngcontent-jjj-c198] nz-pagination[_ngcontent-jjj-c198] { nz-table[_ngcontent-jjj-c198] nz-pagination[_ngcontent-jjj-c198] {
...@@ -49,8 +51,7 @@ import { NzUploadFile, NzUploadModule } from 'ng-zorro-antd/upload'; ...@@ -49,8 +51,7 @@ import { NzUploadFile, NzUploadModule } from 'ng-zorro-antd/upload';
<div> <div>
<label>Type</label> <label>Type</label>
<select class="tw-border tw-rounded-lg tw-w-full tw-h-8" formControlName="type"> <select class="tw-border tw-rounded-lg tw-w-full tw-h-8" formControlName="type">
<option value="Full Time">Full Time</option> <option *ngFor="let item of jobTypeItems" (value)="item">{{ item }}</option>
<option value="Part Time">Part Time</option>
</select> </select>
</div> </div>
<div class="tw-col-span-2"> <div class="tw-col-span-2">
...@@ -98,7 +99,7 @@ import { NzUploadFile, NzUploadModule } from 'ng-zorro-antd/upload'; ...@@ -98,7 +99,7 @@ import { NzUploadFile, NzUploadModule } from 'ng-zorro-antd/upload';
<nz-form-item> <nz-form-item>
<nz-form-control nzErrorTip="Please enter description!"> <nz-form-control nzErrorTip="Please enter description!">
<nz-input-group> <nz-input-group>
<textarea id=myTextarea class="tw-border tw-rounded-lg tw-w-full tw-h-40" type="text" formControlName="description"></textarea> <editor apiKey="4nrurq8srrs4laamy5l9tbrd2je0huj4bu3z3mweu864gkfj" [init]="init" formControlName="description"></editor>
</nz-input-group> </nz-input-group>
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
...@@ -249,6 +250,10 @@ export class JobListComponent implements OnInit { ...@@ -249,6 +250,10 @@ export class JobListComponent implements OnInit {
} }
init: EditorComponent['init'] = {
plugins: 'lists link image table code help wordcount'
};
createNotification(type: string, title: string, message: string) { createNotification(type: string, title: string, message: string) {
this._notification.create( this._notification.create(
type, type,
......
...@@ -2,27 +2,15 @@ ...@@ -2,27 +2,15 @@
<div class="tw-w-full tw-grid tw-grid-cols-1 md:tw-grid-cols-2 xl:tw-grid-cols-3"> <div class="tw-w-full tw-grid tw-grid-cols-1 md:tw-grid-cols-2 xl:tw-grid-cols-3">
<div> <div>
<p class="tw-text-lg tw-font-semibold">Text</p> <p class="tw-text-lg tw-font-semibold">Text</p>
<p>Text text text</p> <p *ngFor="let item of [0, 1, 2, 3, 4, 5]">Text text text</p>
<p>Text text text</p>
<p>Text text text</p>
<p>Text text text</p>
<p>Text text text</p>
</div> </div>
<div> <div>
<p class="tw-text-lg tw-font-semibold">Text</p> <p class="tw-text-lg tw-font-semibold">Text</p>
<p>Text text text</p> <p *ngFor="let item of [0, 1, 2, 3, 4, 5, 6]">Text text text</p>
<p>Text text text</p>
<p>Text text text</p>
<p>Text text text</p>
<p>Text text text</p>
</div> </div>
<div> <div>
<p class="tw-text-lg tw-font-semibold">Text</p> <p class="tw-text-lg tw-font-semibold">Text</p>
<p>Text text text</p> <p *ngFor="let item of [0, 1, 2, 3, 4, 5]">Text text text</p>
<p>Text text text</p>
<p>Text text text</p>
<p>Text text text</p>
<p>Text text text</p>
</div> </div>
<div class="tw-col-span-full tw-text-center tw-pt-6"> <div class="tw-col-span-full tw-text-center tw-pt-6">
<p class="tw-opacity-50">2024 Copyright ... Angular</p> <p class="tw-opacity-50">2024 Copyright ... Angular</p>
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment