Skip to content

Commit

Permalink
resources: smoother collections closing (fixes #6882) (#7950)
Browse files Browse the repository at this point in the history
Co-authored-by: mutugiii <mutugimutuma@gmail.com>
Co-authored-by: dogi <dogi@users.noreply.github.com>
  • Loading branch information
3 people authored Jan 23, 2025
1 parent f799ef5 commit 28b0a49
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 14 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "planet",
"license": "AGPL-3.0",
"version": "0.16.74",
"version": "0.16.75",
"myplanet": {
"latest": "v0.22.29",
"min": "v0.21.29"
"latest": "v0.22.33",
"min": "v0.21.33"
},
"scripts": {
"ng": "ng",
Expand Down
18 changes: 9 additions & 9 deletions src/app/feedback/feedback.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,22 +84,22 @@ export class FeedbackDirective {
const urlParts = feedbackUrl.split('/');
const firstPart = urlParts[1] || 'home';
const lastPart = urlParts.length > 2 ? urlParts[urlParts.length - 1] : null;
let feedback: any = {
const feedback: any = {
...post,
routerLink: null,
state: firstPart,
};
if (firstPart === 'home') {
feedback.title = $localize`Feedback regarding home`;
feedback.routerLink = ['/home'];
feedback.routerLink = [ '/home' ];
this.updateFeedback(feedback, date, user, feedbackUrl);
} else if (this.feedbackOf?.name) {
feedback.title = $localize`Feedback regarding ${firstPart}/${this.feedbackOf.name}`;
feedback.routerLink = ['/', firstPart, 'view', this.feedbackOf.item];
feedback.routerLink = [ '/', firstPart, 'view', this.feedbackOf.item ];
this.updateFeedback(feedback, date, user, feedbackUrl);
} else if (urlParts.length === 2) {
feedback.title = $localize`Feedback regarding ${firstPart}`;
feedback.routerLink = ['/', firstPart];
feedback.routerLink = [ '/', firstPart ];
this.updateFeedback(feedback, date, user, feedbackUrl);
} else if (lastPart) {
this.couchService.getDocumentByID(firstPart, lastPart).subscribe(
Expand All @@ -108,26 +108,26 @@ export class FeedbackDirective {
? document?.name
: document?.title || document?.courseTitle || document?.name || lastPart;
feedback.title = $localize`Feedback regarding ${firstPart}/${resourceName}`;
feedback.routerLink = ['/', firstPart, 'view', lastPart];
feedback.routerLink = [ '/', firstPart, 'view', lastPart ];
this.updateFeedback(feedback, date, user, feedbackUrl);
},
(error) => {
feedback.title = $localize`Feedback regarding ${firstPart}/${lastPart}`;
feedback.routerLink = ['/', firstPart, 'view', lastPart];
feedback.routerLink = [ '/', firstPart, 'view', lastPart ];
this.updateFeedback(feedback, date, user, feedbackUrl);
}
);
}
}

private updateFeedback(feedback: any, date: Date, user: string, url: string) {
const startingMessage: Message = { message: feedback.message, time: date, user };
const newFeedback: Feedback = {
owner: user,
...feedback,
openTime: date,
status: 'Open',
messages: [startingMessage],
messages: [ startingMessage ],
url,
source: this.stateService.configuration.code,
parentCode: this.stateService.configuration.parentCode,
Expand All @@ -143,7 +143,7 @@ export class FeedbackDirective {
}
);
}

@HostListener('click')
openFeedback() {
const title = $localize`Feedback`;
Expand Down
4 changes: 2 additions & 2 deletions src/app/shared/dialogs/dialogs-images.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ import { deepEqual } from '../utils';

@Component({
templateUrl: './dialogs-images.component.html',
styleUrls: ['./dialogs-images.component.scss']
styleUrls: [ './dialogs-images.component.scss' ]
})
export class DialogsImagesComponent implements OnInit {

images: any[] = [];
urlPrefix = environment.couchAddress + '/resources/';
searchQuery: string = '';
searchQuery = '';

constructor(
@Inject(MAT_DIALOG_DATA) public data,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,4 @@
<button type="button" mat-raised-button i18n color="primary" (click)="resetSelection()" [disabled]="emptySelection()">Reset</button>
<button type="button" [mat-dialog-close]="okClickValue" i18n mat-raised-button color="primary">OK</button>
</mat-dialog-actions>
<mat-dialog-actions *ngIf="!selectMany"><button type="button" mat-dialog-close mat-raised-button i18n>Close</button></mat-dialog-actions>

0 comments on commit 28b0a49

Please sign in to comment.