Skip to content

Commit 2d5c2a6

Browse files
committed
Update the updateAt
1 parent 2681bf6 commit 2d5c2a6

File tree

4 files changed

+21
-13
lines changed

4 files changed

+21
-13
lines changed

frontend/src/app/project/components/add-issue-modal/add-issue-modal.component.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { JUser } from '@trungk18/interface/user';
1212
import { tap } from 'rxjs/operators';
1313
import { until } from 'protractor';
1414
import { NoWhitespaceValidator } from '@trungk18/core/validators/no-whitespace.validator';
15+
import { DateUtil } from '@trungk18/project/utils/date';
1516

1617
@Component({
1718
selector: 'add-issue-modal',
@@ -66,10 +67,13 @@ export class AddIssueModalComponent implements OnInit {
6667
if (this.issueForm.invalid) {
6768
return;
6869
}
70+
let now = DateUtil.getNow();
6971
let issue: JIssue = {
7072
...this.issueForm.getRawValue(),
7173
id: IssueUtil.getRandomId(),
72-
status: IssueStatus.BACKLOG
74+
status: IssueStatus.BACKLOG,
75+
createdAt: now,
76+
updatedAt: now
7377
};
7478

7579
this._projectService.updateIssue(issue);

frontend/src/app/project/components/navigation/navbar-left/navbar-left.component.html

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -57,18 +57,15 @@
5757
<div class="flex-auto"></div>
5858
<div class="item"
5959
*ngIf="authQuery.user$ | async as user">
60-
<a target="_blank"
61-
href="https://trungk18.com/">
62-
<div nz-tooltip
63-
[nzTooltipTitle]="user.name"
64-
nzTooltipPlacement="right"
65-
class="itemIcon">
66-
<j-avatar class="flex"
67-
[avatarUrl]="user.avatarUrl"
68-
[size]="26">
69-
</j-avatar>
70-
</div>
71-
</a>
60+
<div nz-tooltip
61+
[nzTooltipTitle]="user.name"
62+
nzTooltipPlacement="right"
63+
class="itemIcon">
64+
<j-avatar class="flex"
65+
[avatarUrl]="user.avatarUrl"
66+
[size]="26">
67+
</j-avatar>
68+
</div>
7269
</div>
7370
<div class="item">
7471
<a target="_blank"

frontend/src/app/project/state/project/project.service.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { of, Subscription } from 'rxjs';
88
import { catchError, finalize, map } from 'rxjs/operators';
99
import { environment } from 'src/environments/environment';
1010
import { ProjectStore } from './project.store';
11+
import { DateUtil } from '@trungk18/project/utils/date';
1112

1213
@Injectable({
1314
providedIn: 'root'
@@ -55,6 +56,7 @@ export class ProjectService {
5556
}
5657

5758
updateIssue(issue: JIssue) {
59+
issue.updatedAt = DateUtil.getNow();
5860
this._store.update((state) => {
5961
let issues = arrayUpsert(state.issues, issue.id, issue);
6062
return {
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export class DateUtil {
2+
static getNow(): string {
3+
return new Date().toISOString();
4+
}
5+
}

0 commit comments

Comments
 (0)