Skip to content

Commit 6624760

Browse files
ui fixes
1 parent 00b97ad commit 6624760

File tree

14 files changed

+351
-331
lines changed

14 files changed

+351
-331
lines changed

src/app/components/admin-app/admin-app-template-export/admin-app-template-export.component.html

Lines changed: 16 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -12,44 +12,36 @@ <h2>Export Application Templates</h2>
1212
<mat-label>Archive Type</mat-label>
1313
<mat-select formControlName="archiveType">
1414
@for (archiveType of archiveTypes; track archiveType) {
15-
<mat-option
16-
[value]="archiveType"
17-
>
15+
<mat-option [value]="archiveType">
1816
{{ archiveType }}
1917
</mat-option>
2018
}
2119
</mat-select>
2220
</mat-form-field>
2321
}
24-
<div>
25-
<mat-form-field floatLabel="always" appearance="none">
26-
<mat-label>Include Icons</mat-label>
27-
<mat-slide-toggle
28-
formControlName="includeIcons"
29-
matTooltip="Include icon files in the exported archive"
30-
></mat-slide-toggle>
31-
<textarea matInput hidden></textarea>
32-
</mat-form-field>
33-
<mat-form-field floatLabel="always" appearance="none">
34-
<mat-label>Embed Icons</mat-label>
35-
<mat-slide-toggle
36-
formControlName="embedIcons"
37-
matTooltip="Embed included Icons into exported JSON as data URIs"
38-
></mat-slide-toggle>
39-
<textarea matInput hidden></textarea>
40-
</mat-form-field>
22+
<div class="d-flex gap-2">
23+
<mat-slide-toggle
24+
formControlName="includeIcons"
25+
matTooltip="Include icon files in the exported archive"
26+
>Include Icons</mat-slide-toggle
27+
>
28+
<mat-slide-toggle
29+
formControlName="embedIcons"
30+
matTooltip="Embed included Icons into exported JSON as data URIs"
31+
>Embed Icons</mat-slide-toggle
32+
>
4133
</div>
4234
<div class="d-flex justify-content-around">
4335
<button
4436
type="submit"
4537
color="primary"
4638
mat-raised-button
4739
[disabled]="!form.valid || loading"
48-
>
40+
>
4941
{{
50-
loading
51-
? 'Exporting....'
52-
: 'Export ' + (ids.length == 0 ? 'All' : '(' + ids.length + ')')
42+
loading
43+
? 'Exporting....'
44+
: 'Export ' + (ids.length == 0 ? 'All' : '(' + ids.length + ')')
5345
}}
5446
</button>
5547
<button type="reset" color="primary" mat-raised-button (click)="cancel()">
Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
/*
2-
Copyright 2021 Carnegie Mellon University. All Rights Reserved.
2+
Copyright 2021 Carnegie Mellon University. All Rights Reserved.
33
Released under a MIT (SEI)-style license. See LICENSE.md in the project root for license information.
44
*/
55

6+
.d-flex.gap-2 {
7+
padding-block: 8px;
8+
}
9+
10+
.d-flex.justify-content-around {
11+
padding-block: 8px;
12+
}

src/app/components/admin-app/admin-app-template-export/admin-app-template-export.component.ts

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ import HttpHeaderUtils from '../../../utilities/http-header-utils';
2121
import { BehaviorSubject, finalize, map } from 'rxjs';
2222

2323
@Component({
24-
selector: 'app-admin-app-template-export',
25-
templateUrl: './admin-app-template-export.component.html',
26-
styleUrls: ['./admin-app-template-export.component.scss'],
27-
changeDetection: ChangeDetectionStrategy.OnPush,
28-
standalone: false
24+
selector: 'app-admin-app-template-export',
25+
templateUrl: './admin-app-template-export.component.html',
26+
styleUrls: ['./admin-app-template-export.component.scss'],
27+
changeDetection: ChangeDetectionStrategy.OnPush,
28+
standalone: false,
2929
})
3030
export class AdminAppTemplateExportComponent {
3131
@Input() ids: string[];
@@ -39,10 +39,11 @@ export class AdminAppTemplateExportComponent {
3939
loading = false;
4040
hasErrors = new BehaviorSubject(false);
4141
hasErrors$ = this.hasErrors.asObservable();
42+
isArchiveable = true;
4243

4344
constructor(
4445
private applicationService: ApplicationService,
45-
formBuilder: UntypedFormBuilder
46+
formBuilder: UntypedFormBuilder,
4647
) {
4748
this.form = formBuilder.group({
4849
archiveType: [this.archiveTypes[0]],
@@ -67,7 +68,7 @@ export class AdminAppTemplateExportComponent {
6768
this.ids,
6869
ArchiveType[this.form.value.archiveType],
6970
this.form.value.includeIcons,
70-
this.includeIcons.value ? this.form.value.embedIcons : false
71+
this.includeIcons.value ? this.form.value.embedIcons : false,
7172
);
7273
}
7374

@@ -79,7 +80,7 @@ export class AdminAppTemplateExportComponent {
7980
ids: string[],
8081
archiveType: ArchiveType,
8182
includeIcons,
82-
embedIcons
83+
embedIcons,
8384
) {
8485
this.loading = true;
8586
this.applicationService
@@ -88,7 +89,7 @@ export class AdminAppTemplateExportComponent {
8889
embedIcons,
8990
archiveType,
9091
ids,
91-
'response'
92+
'response',
9293
)
9394
.pipe(
9495
map((response) => {
@@ -98,7 +99,7 @@ export class AdminAppTemplateExportComponent {
9899
hasErrors: HttpHeaderUtils.hasArchiveErrors(response.headers),
99100
};
100101
}),
101-
finalize(() => (this.loading = false))
102+
finalize(() => (this.loading = false)),
102103
)
103104
.subscribe((result) => {
104105
FileDownloadUtils.downloadFile(result.blob, result.filename);

src/app/components/admin-app/admin-app-template-import/admin-app-template-import.component.html

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ <h2>Import {{ typeString | titlecase }}</h2>
1414
color="primary"
1515
mat-raised-button
1616
(click)="fileInput.click()"
17-
>
17+
>
1818
Choose File
1919
</button>
2020
<input
@@ -23,25 +23,23 @@ <h2>Import {{ typeString | titlecase }}</h2>
2323
#fileInput
2424
type="file"
2525
accept=".zip, .tar.gz, .tgz"
26-
/>
26+
/>
2727
<span class="file-name">{{ this.form.value.archive?.name }}</span>
2828
</div>
29-
<mat-form-field floatLabel="always" appearance="none" fxLayout="row">
30-
<mat-label>Overwrite Existing</mat-label>
29+
<div class="d-flex align-items-center gap-2">
3130
<mat-slide-toggle
3231
formControlName="overwriteExisting"
3332
matTooltip="If an Application Template with a matching Id already exists, overwrite it. Otherwise, report as a failure."
34-
></mat-slide-toggle>
35-
<textarea matInput hidden></textarea>
36-
</mat-form-field>
33+
>Overwrite Existing</mat-slide-toggle>
34+
</div>
3735
</div>
3836
<div class="d-flex justify-content-around">
3937
<button
4038
type="submit"
4139
color="primary"
4240
mat-raised-button
4341
[disabled]="!form.valid || loading"
44-
>
42+
>
4543
{{ loading ? 'Importing...' : 'Import' }}
4644
</button>
4745
<button type="reset" color="primary" mat-raised-button (click)="cancel()">
Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
/*
2-
Copyright 2021 Carnegie Mellon University. All Rights Reserved.
2+
Copyright 2021 Carnegie Mellon University. All Rights Reserved.
33
Released under a MIT (SEI)-style license. See LICENSE.md in the project root for license information.
44
*/
55

6+
.d-flex.gap-2 {
7+
padding-block: 8px;
8+
}
9+
10+
.d-flex.justify-content-around {
11+
padding-block: 8px;
12+
}

src/app/components/admin-app/admin-app-template-search/admin-app-template-search.component.ts

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,13 @@ import {
88
TemplateRef,
99
ViewChild,
1010
} from '@angular/core';
11-
import {
12-
MatPaginator,
13-
PageEvent,
14-
} from '@angular/material/paginator';
11+
import { MatPaginator, PageEvent } from '@angular/material/paginator';
1512
import { MatSort, MatSortable } from '@angular/material/sort';
1613
import { MatTableDataSource } from '@angular/material/table';
1714
import { ApplicationTemplate } from '../../../generated/player-api';
1815
import { ApplicationService } from '../../../generated/player-api/api/application.service';
1916
import { SelectionModel } from '@angular/cdk/collections';
20-
import {
21-
MatDialog,
22-
MatDialogRef,
23-
} from '@angular/material/dialog';
17+
import { MatDialog, MatDialogRef } from '@angular/material/dialog';
2418
import { SafeHtml } from '@angular/platform-browser';
2519

2620
export interface Action {
@@ -29,10 +23,10 @@ export interface Action {
2923
}
3024

3125
@Component({
32-
selector: 'app-admin-app-template-search',
33-
templateUrl: './admin-app-template-search.component.html',
34-
styleUrls: ['./admin-app-template-search.component.scss'],
35-
standalone: false
26+
selector: 'app-admin-app-template-search',
27+
templateUrl: './admin-app-template-search.component.html',
28+
styleUrls: ['./admin-app-template-search.component.scss'],
29+
standalone: false,
3630
})
3731
export class AdminAppTemplateSearchComponent implements OnInit, AfterViewInit {
3832
public appTemplateDataSource: MatTableDataSource<ApplicationTemplate>;
@@ -55,7 +49,7 @@ export class AdminAppTemplateSearchComponent implements OnInit, AfterViewInit {
5549

5650
constructor(
5751
private applicationService: ApplicationService,
58-
private dialog: MatDialog
52+
private dialog: MatDialog,
5953
) {}
6054

6155
/**
@@ -68,7 +62,7 @@ export class AdminAppTemplateSearchComponent implements OnInit, AfterViewInit {
6862

6963
// Initial datasource
7064
this.appTemplateDataSource = new MatTableDataSource<ApplicationTemplate>(
71-
new Array<ApplicationTemplate>()
65+
new Array<ApplicationTemplate>(),
7266
);
7367
this.sort.sort(<MatSortable>{ id: 'name', start: 'asc' });
7468
this.appTemplateDataSource.sort = this.sort;
@@ -152,7 +146,7 @@ export class AdminAppTemplateSearchComponent implements OnInit, AfterViewInit {
152146
this.isAllSelected()
153147
? this.selection.clear()
154148
: this.appTemplateDataSource.filteredData.forEach((row) =>
155-
this.selection.select(row.id)
149+
this.selection.select(row.id),
156150
);
157151
}
158152

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
/*
2-
Copyright 2021 Carnegie Mellon University. All Rights Reserved.
2+
Copyright 2021 Carnegie Mellon University. All Rights Reserved.
33
Released under a MIT (SEI)-style license. See LICENSE.md in the project root for license information.
44
*/
55

6+
.d-flex.gap-2 {
7+
padding-block: 8px;
8+
}
9+
10+
.d-flex.justify-content-around {
11+
padding-block: 8px;
12+
}

src/app/components/admin-app/admin-app-view-import/admin-app-view-import.component.html

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ <h2>Import {{ typeString | titlecase }}</h2>
77

88
@if (!(finished$ | async)) {
99
<form [formGroup]="form" (ngSubmit)="import()">
10-
<div class="d-flex flex-column">
11-
<div class="d-flex align-items-center gap-2 mb-3">
10+
<div class="d-flex flex-column gap-2">
11+
<div class="d-flex align-items-center gap-2">
1212
<button
1313
type="button"
1414
color="primary"
1515
mat-raised-button
1616
(click)="fileInput.click()"
17-
>
17+
>
1818
Choose File
1919
</button>
2020
<input
@@ -23,35 +23,35 @@ <h2>Import {{ typeString | titlecase }}</h2>
2323
#fileInput
2424
type="file"
2525
accept=".zip, .tar.gz, .tgz"
26-
/>
26+
/>
2727
<span class="file-name">{{ this.form.value.archive?.name }}</span>
2828
</div>
29-
<strong>Applications</strong>
30-
<mat-form-field floatLabel="always" appearance="none">
31-
<mat-label>Match Templates By Name</mat-label>
29+
<div class="d-flex align-items-center gap-2">
30+
<strong>Applications</strong>
31+
</div>
32+
<div class="d-flex align-items-center gap-2">
3233
<mat-slide-toggle
3334
formControlName="matchApplicationTemplatesByName"
3435
matTooltip="If an Application Template cannot be found by Id, try to find one with a matching Name"
35-
></mat-slide-toggle>
36-
<textarea matInput hidden></textarea>
37-
</mat-form-field>
38-
<strong>Roles</strong>
39-
<mat-form-field floatLabel="always" appearance="none">
40-
<mat-label>Match By Name</mat-label>
36+
>Match Templates By Name</mat-slide-toggle>
37+
</div>
38+
<div class="d-flex align-items-center gap-2">
39+
<strong>Roles</strong>
40+
</div>
41+
<div class="d-flex align-items-center gap-2">
4142
<mat-slide-toggle
4243
formControlName="matchRolesByName"
4344
matTooltip="If a Role cannot be found by Id, try to find one with a matching Name"
44-
></mat-slide-toggle>
45-
<textarea matInput hidden></textarea>
46-
</mat-form-field>
45+
>Match By Name</mat-slide-toggle>
46+
</div>
4747
</div>
4848
<div class="d-flex justify-content-around">
4949
<button
5050
type="submit"
5151
color="primary"
5252
mat-raised-button
5353
[disabled]="!form.valid || loading"
54-
>
54+
>
5555
{{ loading ? 'Importing...' : 'Import' }}
5656
</button>
5757
<button type="reset" color="primary" mat-raised-button (click)="cancel()">
Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
/*
2-
Copyright 2021 Carnegie Mellon University. All Rights Reserved.
2+
Copyright 2021 Carnegie Mellon University. All Rights Reserved.
33
Released under a MIT (SEI)-style license. See LICENSE.md in the project root for license information.
44
*/
55

6+
.d-flex.gap-2 {
7+
padding-block: 8px;
8+
}
9+
10+
.d-flex.justify-content-around {
11+
padding-block: 8px;
12+
}

0 commit comments

Comments
 (0)