Skip to content

Commit 9b97a8d

Browse files
committed
Fix APK set download links not functioning
Since the introduction of CORS in "4b85891: Add CORS support", APK set download links have been broken because they reference the frontend console URL instead of the backend developer service. This commit corrects the URLs to point to the backend service, allowing APK sets to be downloaded again.
1 parent 25de96c commit 9b97a8d

File tree

6 files changed

+27
-9
lines changed

6 files changed

+27
-9
lines changed

frontend/src/app/publish/publisher-draft-card/publisher-draft-card.component.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ <h4>Draft info</h4>
1919
</ul>
2020
</mat-card-content>
2121
<mat-card-actions align="end">
22-
<a [href]="'/api/v1/drafts/' + draft.id + '/apkset'" mat-stroked-button>
22+
<a [href]="apkSetLink" mat-stroked-button>
2323
Download APK set
2424
</a>
2525
<button type="button" (click)="onPublish()" mat-flat-button color="primary">

frontend/src/app/publish/publisher-draft-card/publisher-draft-card.component.ts

+8-2
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,27 @@
22
//
33
// SPDX-License-Identifier: AGPL-3.0-only
44

5-
import { Component, EventEmitter, Input, Output } from '@angular/core';
5+
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
66
import { MatButtonModule } from '@angular/material/button';
77
import { MatCardModule } from '@angular/material/card';
88

99
import { Draft } from '../../draft';
10+
import { environment } from '../../../environments/environment';
1011

1112
@Component({
1213
selector: 'app-publisher-draft-card',
1314
standalone: true,
1415
imports: [MatButtonModule, MatCardModule],
1516
templateUrl: './publisher-draft-card.component.html',
1617
})
17-
export class PublisherDraftCardComponent {
18+
export class PublisherDraftCardComponent implements OnInit {
1819
@Input({ required: true }) draft!: Draft;
1920
@Output() publish = new EventEmitter<string>();
21+
apkSetLink?: string;
22+
23+
ngOnInit(): void {
24+
this.apkSetLink = `${environment.developerApiUrl}/api/v1/drafts/${this.draft.id}/apkset`;
25+
}
2026

2127
onPublish(): void {
2228
this.publish.emit(this.draft.id);

frontend/src/app/review/reviewer-draft-card/reviewer-draft-card.component.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ <h4>Draft info</h4>
1919
</ul>
2020
</mat-card-content>
2121
<mat-card-actions align="end">
22-
<a [href]="'/api/v1/drafts/' + draft.id + '/apkset'" mat-stroked-button>
22+
<a [href]="apkSetLink" mat-stroked-button>
2323
Download APK set
2424
</a>
2525
<button type="button" (click)="onPostReview()" mat-flat-button color="primary">

frontend/src/app/review/reviewer-draft-card/reviewer-draft-card.component.ts

+8-2
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,27 @@
22
//
33
// SPDX-License-Identifier: AGPL-3.0-only
44

5-
import { Component, EventEmitter, Input, Output } from '@angular/core';
5+
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
66
import { MatButtonModule } from '@angular/material/button';
77
import { MatCardModule } from '@angular/material/card';
88

99
import { Draft } from '../../draft';
10+
import { environment } from '../../../environments/environment';
1011

1112
@Component({
1213
selector: 'app-reviewer-draft-card',
1314
standalone: true,
1415
imports: [MatButtonModule, MatCardModule],
1516
templateUrl: './reviewer-draft-card.component.html',
1617
})
17-
export class ReviewerDraftCardComponent {
18+
export class ReviewerDraftCardComponent implements OnInit {
1819
@Input({ required: true }) draft!: Draft;
1920
@Output() postReview = new EventEmitter<string>();
21+
apkSetLink?: string;
22+
23+
ngOnInit(): void {
24+
this.apkSetLink = `${environment.developerApiUrl}/api/v1/drafts/${this.draft.id}/apkset`;
25+
}
2026

2127
onPostReview(): void {
2228
this.postReview.emit(this.draft.id);

frontend/src/app/review/reviewer-update-card/reviewer-update-card.component.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ <h4>Update info</h4>
1717
</ul>
1818
</mat-card-content>
1919
<mat-card-actions align="end">
20-
<a [href]="'/api/v1/updates/' + update.id + '/apkset'" mat-stroked-button>
20+
<a [href]="apkSetLink" mat-stroked-button>
2121
Download APK set
2222
</a>
2323
<button type="button" (click)="onPostReview()" mat-flat-button color="primary">

frontend/src/app/review/reviewer-update-card/reviewer-update-card.component.ts

+8-2
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,27 @@
22
//
33
// SPDX-License-Identifier: AGPL-3.0-only
44

5-
import { Component, EventEmitter, Input, Output } from '@angular/core';
5+
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
66
import { MatButtonModule } from '@angular/material/button';
77
import { MatCardModule } from '@angular/material/card';
88

99
import { Update } from '../../update';
10+
import { environment } from '../../../environments/environment';
1011

1112
@Component({
1213
selector: 'app-reviewer-update-card',
1314
standalone: true,
1415
imports: [MatButtonModule, MatCardModule],
1516
templateUrl: './reviewer-update-card.component.html',
1617
})
17-
export class ReviewerUpdateCardComponent {
18+
export class ReviewerUpdateCardComponent implements OnInit {
1819
@Input({ required: true }) update!: Update;
1920
@Output() postReview = new EventEmitter<string>();
21+
apkSetLink?: string;
22+
23+
ngOnInit(): void {
24+
this.apkSetLink = `${environment.developerApiUrl}/api/v1/updates/${this.update.id}/apkset`;
25+
}
2026

2127
onPostReview(): void {
2228
this.postReview.emit(this.update.id);

0 commit comments

Comments
 (0)