Fixes found in docs update
This commit is contained in:
parent
0c9b1b00d6
commit
ad37cb2880
@ -29,7 +29,7 @@
|
||||
},
|
||||
"scripts": {
|
||||
"build": "ng b --output-hashing=none",
|
||||
"build:prod": "npm-run-all -s \"build -- --prod\" api-changed package",
|
||||
"build:prod": "npm-run-all -s \"build -- --prod\" api-writeable package",
|
||||
"build:dev": "npm-run-all -s build api-changed",
|
||||
"watch": "npm-run-all -p \"build -- --watch\" dist-watch",
|
||||
"dist-watch": "npm-watch api-changed",
|
||||
|
@ -41,7 +41,7 @@
|
||||
</select>
|
||||
</label>
|
||||
|
||||
<label>
|
||||
<label *ngIf="activeBoard.categories.length">
|
||||
{{ strings['boards_categoryFilter'] }}:
|
||||
|
||||
<select [(ngModel)]="categoryFilter" (change)="filterTasks()">
|
||||
|
@ -145,15 +145,17 @@ export class BoardDisplayComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
|
||||
updateBoards(): void {
|
||||
this.boardService.getBoards().subscribe((response: ApiResponse) => {
|
||||
this.boards = [];
|
||||
this.boardService.refreshToken(() => {
|
||||
this.boardService.getBoards().subscribe((response: ApiResponse) => {
|
||||
this.boards = [];
|
||||
|
||||
if (response.data.length > 1) {
|
||||
this.updateBoardsList(response.data[1]);
|
||||
return;
|
||||
}
|
||||
if (response.data.length > 1) {
|
||||
this.updateBoardsList(response.data[1]);
|
||||
return;
|
||||
}
|
||||
|
||||
this.loading = false;
|
||||
this.loading = false;
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -184,8 +184,8 @@ export class BoardService {
|
||||
)
|
||||
}
|
||||
|
||||
refreshToken(): void {
|
||||
this.http.post('api/refresh', {}).subscribe();
|
||||
refreshToken(callback: any): void {
|
||||
this.http.post('api/refresh', {}).subscribe(() => callback());
|
||||
}
|
||||
|
||||
private async convertBoardData(boardData: any): Promise<Board> {
|
||||
|
@ -188,7 +188,7 @@
|
||||
item.filename"></i>
|
||||
</a>
|
||||
|
||||
<i class="icon icon-trash-empty"
|
||||
<i class="icon icon-trash-empty color-secondary"
|
||||
[title]="strings['settings_remove'] + ' ' + item.filename"
|
||||
(click)="attachmentToRemove = item;
|
||||
modal.open(MODAL_CONFIRM_ATTACHMENT_ID +
|
||||
@ -213,7 +213,16 @@
|
||||
</div>
|
||||
|
||||
<div *ngIf="viewModalProps.comments.length">
|
||||
<h3>{{ strings['boards_taskComments'] }}</h3>
|
||||
<h3>
|
||||
{{ strings['boards_taskComments'] }}
|
||||
|
||||
<div class="right">
|
||||
<select [(ngModel)]="commentOrder" (change)="sortComments()">
|
||||
<option value="oldest">Oldest First</option>
|
||||
<option value="newest">Newest First</option>
|
||||
</select>
|
||||
</div>
|
||||
</h3>
|
||||
|
||||
<div class="comment" *ngFor="let comment of viewModalProps.comments">
|
||||
<div [innerHTML]="comment.html" *ngIf="!comment.isEdit"></div>
|
||||
|
@ -61,6 +61,7 @@ export class ColumnDisplayComponent implements OnInit, OnDestroy {
|
||||
public taskToRemove: number;
|
||||
|
||||
public newComment: string;
|
||||
public commentOrder: string;
|
||||
public sortOption: string;
|
||||
|
||||
public templateElement: any;
|
||||
@ -98,6 +99,7 @@ export class ColumnDisplayComponent implements OnInit, OnDestroy {
|
||||
private sanitizer: DomSanitizer) {
|
||||
this.templateElement = elRef.nativeElement;
|
||||
this.collapseTasks = false;
|
||||
this.commentOrder = "oldest";
|
||||
this.sortOption = 'pos';
|
||||
|
||||
this.MODAL_ID = 'add-task-form-';
|
||||
@ -139,7 +141,6 @@ export class ColumnDisplayComponent implements OnInit, OnDestroy {
|
||||
user.board_access,
|
||||
user.collapsed);
|
||||
this.userOptions = auth.userOptions;
|
||||
this.showActivity = this.activeUser.isAnyAdmin();
|
||||
});
|
||||
this.subs.push(sub);
|
||||
}
|
||||
@ -204,6 +205,16 @@ export class ColumnDisplayComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
}
|
||||
|
||||
sortComments() {
|
||||
this.viewModalProps.comments.sort((a, b) => {
|
||||
if (this.commentOrder === 'oldest') {
|
||||
return a.timestamp - b.timestamp;
|
||||
}
|
||||
|
||||
return b.timestamp - a.timestamp;
|
||||
})
|
||||
}
|
||||
|
||||
toggleCollapsed() {
|
||||
this.templateElement.classList.toggle('collapsed');
|
||||
|
||||
@ -250,7 +261,7 @@ export class ColumnDisplayComponent implements OnInit, OnDestroy {
|
||||
});
|
||||
|
||||
this.boardService.updateActiveBoard(boardData);
|
||||
this.boardService.refreshToken();
|
||||
this.onUpdateBoards.next();
|
||||
this.saving = false;
|
||||
}, err => {
|
||||
this.notes.add({ type: 'error', text: err.toString() });
|
||||
@ -296,9 +307,9 @@ export class ColumnDisplayComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
|
||||
this.boardService.updateActiveBoard(response.data[2][0]);
|
||||
this.onUpdateBoards.next();
|
||||
this.modal.close(this.MODAL_ID + this.columnData?.id + '');
|
||||
|
||||
this.boardService.refreshToken();
|
||||
this.saving = false;
|
||||
});
|
||||
}
|
||||
@ -313,7 +324,7 @@ export class ColumnDisplayComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
|
||||
this.boardService.updateActiveBoard(response.data[1][0]);
|
||||
this.boardService.refreshToken();
|
||||
this.onUpdateBoards.next();
|
||||
});
|
||||
}
|
||||
|
||||
@ -624,10 +635,8 @@ export class ColumnDisplayComponent implements OnInit, OnDestroy {
|
||||
this.viewModalProps = Object.assign({}, viewTask);
|
||||
this.checkDueDate();
|
||||
|
||||
if (this.showActivity) {
|
||||
this.showActivity = false;
|
||||
setTimeout(() => (this.showActivity = true), 500);
|
||||
}
|
||||
this.showActivity = false;
|
||||
setTimeout(() => (this.showActivity = true), 500);
|
||||
|
||||
this.modal.open(this.MODAL_VIEW_ID + this.columnData.id);
|
||||
}
|
||||
@ -732,6 +741,8 @@ export class ColumnDisplayComponent implements OnInit, OnDestroy {
|
||||
comment.task_id, comment.timestamp)
|
||||
);
|
||||
});
|
||||
|
||||
this.sortComments();
|
||||
}
|
||||
|
||||
// Needs anonymous function for proper `this` context.
|
||||
|
@ -461,6 +461,10 @@
|
||||
background: transparent;
|
||||
border: 0;
|
||||
margin: 1em 0 0;
|
||||
|
||||
div {
|
||||
font-size: 1rem;
|
||||
}
|
||||
}
|
||||
|
||||
.activity {
|
||||
|
Reference in New Issue
Block a user