Commit a43ce34c by Mon

เเก้ testfailed ใบงานที่ 43990

parent 6447ea74
...@@ -44,15 +44,15 @@ ...@@ -44,15 +44,15 @@
<input class="form-check-input check-all" type="checkbox" id="all-products" <input class="form-check-input check-all" type="checkbox" id="all-products"
(change)="toggleAll($event)" [checked]="allSelected" aria-label="..."> (change)="toggleAll($event)" [checked]="allSelected" aria-label="...">
</th> </th>
<th scope="col" class="text-start">รูปภาพ</th> <th scope="col" class="text-start">{{"image"|translate}}</th>
<th scope="col" class="text-start">หัวข้อบทความ</th> <th scope="col" class="text-start">{{"Article Title"|translate}}</th>
<th scope="col" class="text-start">ผู้เขียนบทความ</th> <th scope="col" class="text-start">{{"Author"|translate}}</th>
<th scope="col" class="text-start">{{"Status" | translate}}</th> <th scope="col" class="text-start">{{"Status" | translate}}</th>
<th scope="col" class="text-start">วันที่เผยเเพร่</th> <th scope="col" class="text-start">{{"Published Date"|translate}}</th>
<!-- <th scope="col" class="text-start">วันที่สิ้นสุดการเผยเเพร่</th> --> <!-- <th scope="col" class="text-start">วันที่สิ้นสุดการเผยเเพร่</th> -->
<th scope="col" class="text-start">วันที่เเก้ไขล่าสุด</th> <th scope="col" class="text-start">{{"Last Updated Date"|translate}}</th>
<!-- <th scope="col" class="text-start">{{"Update Date" | translate}}</th> --> <!-- <th scope="col" class="text-start">{{"Update Date" | translate}}</th> -->
<th scope="col" class="text-start">การจัดการ</th> <th scope="col" class="text-start">{{"Management"|translate}}</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
...@@ -68,7 +68,9 @@ ...@@ -68,7 +68,9 @@
<span class="p-3 me-1" style="width: 200px;"> <span class="p-3 me-1" style="width: 200px;">
<!-- <img [src]="item.getPicture()" alt="" id="profile-img" class="border-radius-1" <!-- <img [src]="item.getPicture()" alt="" id="profile-img" class="border-radius-1"
style="width: 180px; height: 120px; object-fit: cover;"> --> style="width: 180px; height: 120px; object-fit: cover;"> -->
<img [src]="item.getPicture() === '' ? 'assets/images/media/default-pic-gX.png' : item.getPicture()" id="profile-img" class="border-radius-1" <img
[src]="item.getPicture() === '' ? 'assets/images/media/default-pic-gX.png' : item.getPicture()"
id="profile-img" class="border-radius-1"
style="width: 180px; height: 120px; object-fit: cover;"> style="width: 180px; height: 120px; object-fit: cover;">
</span> </span>
</div> </div>
...@@ -218,7 +220,8 @@ ...@@ -218,7 +220,8 @@
<div class="xl:col-span-12 col-span-12 justify-items-center"> <div class="xl:col-span-12 col-span-12 justify-items-center">
<div class="relative w-[300px] h-[200px] overflow-hidden rounded-md group mx-auto"> <div class="relative w-[300px] h-[200px] overflow-hidden rounded-md group mx-auto">
<img [src]="selectModel.getPicture() === '' ? 'assets/images/media/default-pic-gX.png' : selectModel.getPicture()" <img
[src]="selectModel.getPicture() === '' ? 'assets/images/media/default-pic-gX.png' : selectModel.getPicture()"
alt="Profile Picture" alt="Profile Picture"
class="w-full h-full block transition-all duration-300 ease-in-out group-hover:blur-md border-color"> class="w-full h-full block transition-all duration-300 ease-in-out group-hover:blur-md border-color">
...@@ -245,7 +248,7 @@ ...@@ -245,7 +248,7 @@
</div> </div>
</div> --> </div> -->
<div class="xl:col-span-6 col-span-12"> <div class="xl:col-span-6 col-span-12">
<label for="author" class="text-primary mt-4 font-bold font-14">{{'ผู้เขียนบทความ' | translate}}</label> <label for="author" class="text-primary mt-4 font-bold font-14">{{'Author' | translate}}</label>
<input type="text" class="form-control" id="author" placeholder="" [(ngModel)]="selectModel.author"> <input type="text" class="form-control" id="author" placeholder="" [(ngModel)]="selectModel.author">
<div class="text-danger" *ngIf="!selectModel.author"> <div class="text-danger" *ngIf="!selectModel.author">
{{'Please fill in information' | translate}} {{'Please fill in information' | translate}}
...@@ -261,7 +264,7 @@ ...@@ -261,7 +264,7 @@
</div> </div>
</div> --> </div> -->
<div class="xl:col-span-6 col-span-12"> <div class="xl:col-span-6 col-span-12">
<label for="createdDate" class="mt-4 font-bold font-14 text-primary">{{'วันที่เผยเเพร่' | translate}}</label> <label for="createdDate" class="mt-4 font-bold font-14 text-primary">{{'Published Date' | translate}}</label>
<input type="datetime-local" class="form-control" id="createdDate" placeholder="" <input type="datetime-local" class="form-control" id="createdDate" placeholder=""
[(ngModel)]="selectModel.createdDate" (ngModelChange)="updateMinDate()" max="9999-12-31T23:59"> [(ngModel)]="selectModel.createdDate" (ngModelChange)="updateMinDate()" max="9999-12-31T23:59">
<div class="text-danger" *ngIf="!selectModel.createdDate"> <div class="text-danger" *ngIf="!selectModel.createdDate">
...@@ -270,7 +273,7 @@ ...@@ -270,7 +273,7 @@
</div> </div>
<div class="xl:col-span-6 col-span-12"> <div class="xl:col-span-6 col-span-12">
<label for="endDate" class="mt-4 font-bold font-14 text-primary">{{'วันที่สิ้นสุดการเผยเเพร่' | <label for="endDate" class="mt-4 font-bold font-14 text-primary">{{'End Date' |
translate}}</label> translate}}</label>
<input type="datetime-local" class="form-control" id="endDate" placeholder="" <input type="datetime-local" class="form-control" id="endDate" placeholder=""
[(ngModel)]="selectModel.endDate" [min]="selectModel.createdDate" max="9999-12-31T23:59"> [(ngModel)]="selectModel.endDate" [min]="selectModel.createdDate" max="9999-12-31T23:59">
...@@ -279,9 +282,24 @@ ...@@ -279,9 +282,24 @@
</div> </div>
</div> </div>
<div class="xl:col-span-6 col-span-12">
<label for="status" class="mt-4 font-bold font-14 text-primary">
{{ 'Status' | translate }}
</label>
<ng-select id="status" name="status" [(ngModel)]="selectModel.publish" [items]="statusOptions"
bindValue="value" bindLabel="label" placeholder="Status">
<ng-option value="1">{{ 'เผยแพร่' | translate }}</ng-option>
<ng-option value="0">{{ 'ไม่เผยแพร่' | translate }}</ng-option>
</ng-select>
<div class="text-danger" *ngIf="selectModel.publish === null || selectModel.publish === undefined">
{{ 'Please fill in information' | translate }}
</div>
</div>
<div class="xl:col-span-12 col-span-12"> <div class="xl:col-span-12 col-span-12">
<label class="mt-4 font-bold font-14 text-primary" for="Detail_content">{{ "ชื่อหัวข้อบทความ" | translate }}: <label class="mt-4 font-bold font-14 text-primary" for="Detail_content">{{ "Article Title" | translate }}:
<span class="text-danger">*</span></label> <span class="text-danger">*</span></label>
<nav class="flex rtl:space-x-reverse space-x-2 border-b border-gray-200 mt-3"> <nav class="flex rtl:space-x-reverse space-x-2 border-b border-gray-200 mt-3">
<a (click)="currentarticleIdTab = 1" [class.active]="currentarticleIdTab === 1" <a (click)="currentarticleIdTab = 1" [class.active]="currentarticleIdTab === 1"
...@@ -352,7 +370,7 @@ ...@@ -352,7 +370,7 @@
<!-- ย่อความ --> <!-- ย่อความ -->
<div class="xl:col-span-12 col-span-12"> <div class="xl:col-span-12 col-span-12">
<label class="mt-4 font-bold font-14 text-primary" for="Detail_ex">{{ "บทความเเบบย่อ" | translate }}: <span <label class="mt-4 font-bold font-14 text-primary" for="Detail_ex">{{ "Excerpt" | translate }}: <span
class="text-danger">*</span></label> class="text-danger">*</span></label>
<nav class="flex rtl:space-x-reverse space-x-2 border-b border-gray-200 mt-3"> <nav class="flex rtl:space-x-reverse space-x-2 border-b border-gray-200 mt-3">
<a (click)="currentExcerptTab = 1" [class.active]="currentExcerptTab === 1" <a (click)="currentExcerptTab = 1" [class.active]="currentExcerptTab === 1"
...@@ -405,7 +423,7 @@ ...@@ -405,7 +423,7 @@
<div class="xl:col-span-12 col-span-12"> <div class="xl:col-span-12 col-span-12">
<label class="mt-4 font-bold font-14 text-primary" for="Detail_content">{{ "เนื้อหาบทความ" | translate }}: <label class="mt-4 font-bold font-14 text-primary" for="Detail_content">{{ "Article Contents" | translate }}:
<span class="text-danger">*</span></label> <span class="text-danger">*</span></label>
<nav class="flex rtl:space-x-reverse space-x-2 border-b border-gray-200 mt-3"> <nav class="flex rtl:space-x-reverse space-x-2 border-b border-gray-200 mt-3">
<a (click)="currentContentTab = 1" [class.active]="currentContentTab === 1" <a (click)="currentContentTab = 1" [class.active]="currentContentTab === 1"
......
...@@ -52,6 +52,10 @@ export class ArticleManageComponent { ...@@ -52,6 +52,10 @@ export class ArticleManageComponent {
['clean'], ['clean'],
] ]
}; };
statusOptions = [
{ value: 1, label: 'เผยแพร่' },
{ value: 0, label: 'ไม่เผยแพร่' },
];
@ViewChild('closeModal') public childModal?: ElementRef; @ViewChild('closeModal') public childModal?: ElementRef;
@ViewChild('modalDetail') public modalDetail?: ElementRef; @ViewChild('modalDetail') public modalDetail?: ElementRef;
...@@ -62,6 +66,7 @@ export class ArticleManageComponent { ...@@ -62,6 +66,7 @@ export class ArticleManageComponent {
currentExcerptTab: number = 1; currentExcerptTab: number = 1;
currentarticleIdTab: number = 1; currentarticleIdTab: number = 1;
action = "new"; action = "new";
allSelected = false; allSelected = false;
someSelected = false; someSelected = false;
...@@ -98,7 +103,7 @@ export class ArticleManageComponent { ...@@ -98,7 +103,7 @@ export class ArticleManageComponent {
) { ) {
this.uploadConfig(); this.uploadConfig();
} }
uploadConfig() { uploadConfig() {
this.uploaderProfile = new FileUploader({ this.uploaderProfile = new FileUploader({
...@@ -231,10 +236,10 @@ export class ArticleManageComponent { ...@@ -231,10 +236,10 @@ export class ArticleManageComponent {
this.selectModel.articleId = ""; this.selectModel.articleId = "";
this.selectModel.content = ""; this.selectModel.content = "";
this.selectModel.author = ""; this.selectModel.author = "";
this.selectModel.publish = 0; this.selectModel.publish = 0;
const now = new Date(); const now = new Date();
this.selectModel.createdDate = this.formatDateToISOString(now); this.selectModel.createdDate = this.formatDateToISOString(now);
this.selectModel.lastModifiedDate = this.formatDateToISOString(now); // ตั้งค่า lastModifiedDate เป็นเวลาปัจจุบัน (YYYY-MM-DDTHH:mm) this.selectModel.lastModifiedDate = this.formatDateToISOString(now); // ตั้งค่า lastModifiedDate เป็นเวลาปัจจุบัน (YYYY-MM-DDTHH:mm)
this.selectModel.endDate = ''; // ตั้งค่า endDate เป็น string ว่าง เพื่อให้ Input ว่างเปล่าตอนสร้างใหม่ this.selectModel.endDate = ''; // ตั้งค่า endDate เป็น string ว่าง เพื่อให้ Input ว่างเปล่าตอนสร้างใหม่
} }
...@@ -290,7 +295,7 @@ export class ArticleManageComponent { ...@@ -290,7 +295,7 @@ export class ArticleManageComponent {
let endDateToSend: string | null = null; let endDateToSend: string | null = null;
if (this.selectModel.endDate) { if (this.selectModel.endDate) {
if (this.selectModel.endDate !== '') { if (this.selectModel.endDate !== '') {
endDateToSend = new Date(this.selectModel.endDate).toISOString(); endDateToSend = new Date(this.selectModel.endDate).toISOString();
} }
} }
...@@ -315,7 +320,7 @@ export class ArticleManageComponent { ...@@ -315,7 +320,7 @@ export class ArticleManageComponent {
publish: this.selectModel.publish, publish: this.selectModel.publish,
viewCount: this.selectModel.viewCount, viewCount: this.selectModel.viewCount,
companyId: this.selectModel.companyId.map(company => ({ companyId: this.selectModel.companyId.map(company => ({
id: company.companyId, id: company.companyId,
})) as any })) as any
}; };
......
...@@ -114,5 +114,13 @@ ...@@ -114,5 +114,13 @@
"Publish":"Publish", "Publish":"Publish",
"Unpublish":"Unpublish", "Unpublish":"Unpublish",
"Public":"Public", "Public":"Public",
"Pending":"Pending" "Pending":"Pending",
"image":"image",
"Article Title":"Article Title",
"Author":"Author",
"Published Date":"Published Date",
"Last Updated Date":"Last Updated Date",
"Management":"Management",
"Excerpt":"Excerpt",
"Article Contents":"Article Contents"
} }
...@@ -114,5 +114,14 @@ ...@@ -114,5 +114,14 @@
"Publish":"เผยเเพร่", "Publish":"เผยเเพร่",
"Unpublish":"ไม่เผยเเพร่", "Unpublish":"ไม่เผยเเพร่",
"Public":"สาธารณะ", "Public":"สาธารณะ",
"Pending":"รอดำเนินการ" "Pending":"รอดำเนินการ",
"image":"รูปภาพ",
"Article Title":"หัวข้อบทความ",
"Author":"ผู้เขียน",
"Published Date":"วันที่เผยเเพร่",
"Last Updated Date":"วันที่เเก้ไขล่าสุด",
"Management":"การจัดการ",
"Excerpt":"บทความเเบบย่อ",
"Article Contents":"เนื้อหาบทความ"
} }
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