Skip to content

Commit

Permalink
Merge branch 'master' into 8133-courses-no-snackbar-when-adding-new-c…
Browse files Browse the repository at this point in the history
…ourse1
  • Loading branch information
Mutugiii committed Jan 24, 2025
2 parents d003bdd + eb92089 commit f4729a5
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 14 deletions.
7 changes: 4 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.76",
"myplanet": {
"latest": "v0.22.29",
"min": "v0.21.29"
"latest": "v0.22.33",
"min": "v0.21.33"
},
"scripts": {
"ng": "ng",
Expand Down Expand Up @@ -86,6 +86,7 @@
"@fortawesome/fontawesome-free": "^5.13.0",
"@types/jasmine": "~3.5.0",
"@types/jasminewd2": "~2.0.8",
"@types/ms": "0.7.34",
"@types/node": "^12.11.1",
"@types/pouchdb": "^6.4.0",
"@types/pouchdb-find": "^6.3.4",
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 f4729a5

Please sign in to comment.