Skip to content

Commit 83b0d56

Browse files
committed
status replace draft
1 parent 28cf449 commit 83b0d56

9 files changed

Lines changed: 476 additions & 450 deletions

File tree

src/app/core/models/post.ts

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,33 @@ import { FileUpload } from './file-upload';
22
import { PostIt } from './postit';
33

44
export interface Post {
5-
author?: string;
6-
description: string;
7-
id?: string;
8-
title: string;
9-
content?: string;
10-
creationDate?: Date;
11-
attachmentIds?: string[];
12-
processedAttachmentIds?: string[];
13-
attachments?: FileUpload[];
14-
updatedDate?: Date;
15-
draft?: boolean;
16-
coverId?: string;
17-
tags?: string[];
18-
todos?: PostIt[];
19-
inProgress?: PostIt[];
20-
done?: PostIt[];
5+
author?: string;
6+
description: string;
7+
id?: string;
8+
title: string;
9+
content?: string;
10+
creationDate?: Date;
11+
attachmentIds?: string[];
12+
processedAttachmentIds?: string[];
13+
attachments?: FileUpload[];
14+
updatedDate?: Date;
15+
coverId?: string;
16+
tags?: string[];
17+
status?: PostStatus;
18+
todos?: PostIt[];
19+
inProgress?: PostIt[];
20+
done?: PostIt[];
2121
}
2222

2323
export type PostItType = 'TODOS' | 'IN_PROGRESS' | 'DONE';
2424

2525
export interface PostSearchCriteria {
26-
id?: string;
27-
dateBefore?: Date;
28-
dateAfter?: Date;
29-
title?: string;
30-
content?: string;
31-
tag?: string;
26+
id?: string;
27+
dateBefore?: Date;
28+
dateAfter?: Date;
29+
title?: string;
30+
content?: string;
31+
tag?: string;
32+
status?: PostStatus;
3233
}
34+
export type PostStatus = "IN_PROGRESS" | "PENDING" | "DONE";

src/app/features/billable-client/billable-client-detail/billable-client-detail.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,8 @@
190190
</div>
191191
</div>
192192
<div class="form-check d-flex justify-content-end mb-1">
193-
<input class="form-check-input" type="checkbox" id="draft" formControlName="student" />
194-
<label class="form-check-label ms-1" for="draft"> Student </label>
193+
<input class="form-check-input" type="checkbox" id="is_student" formControlName="student" />
194+
<label class="form-check-label ms-1" for="is_student"> Student </label>
195195
</div>
196196
<div class="d-flex justify-content-end" *ngIf="hasRoleAdmin">
197197
<button type="submit" class="btn btn-primary" [disabled]="!clientForm.valid">Submit</button>

src/app/features/report/post-detail/post-detail.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
class="card-header bg-light rounded-0 d-flex flex-column flex-md-row justify-content-between align-items-start align-items-md-center"
2828
>
2929
<h4 class="mb-2 mb-md-0">
30-
<fa-icon *ngIf="!post.draft" [icon]="['fas', 'check-circle']" class="text-success me-1"></fa-icon>
30+
<fa-icon *ngIf="post?.status === 'DONE'" [icon]="['fas', 'check-circle']" class="text-success me-1"></fa-icon>
3131
{{ post.title | titlecase }}
3232
</h4>
3333
<small class="text-muted">Last updated: {{ post.updatedDate | date: 'dd/MM/yyyy HH:mm' }}</small>

src/app/features/report/post-editor/post-editor.component.html

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,15 @@
2323
<label class="col-form-label" for="author">Author</label>
2424
<input type="text" class="form-control" id="author" formControlName="author" placeholder="Author" />
2525
</div>
26+
<div class="mb-1">
27+
28+
<label class="col-form-label" for="status">Status</label>
29+
<select class="form-select" formControlName="status" id="status">
30+
<option value="IN_PROGRESS">⏳ In progress</option>
31+
<option value="PENDING">🕗 Pending</option>
32+
<option value="DONE">✅ Done</option>
33+
</select>
34+
</div>
2635
<div class="mb-1">
2736
<label class="col-form-label" for="description">Description</label>
2837
<textarea
@@ -63,11 +72,9 @@
6372
</ng-template>
6473
</ngx-file-drop>
6574
</div>
66-
<hr />
67-
<div class="form-check form-check-inline">
68-
<input class="form-check-input" type="checkbox" id="draft" formControlName="draft" />
69-
<label class="form-check-label" for="draft"> Draft </label>
70-
</div>
75+
76+
77+
7178
</ng-template>
7279
</li>
7380
<li ngbNavItem>

0 commit comments

Comments
 (0)