Skip to content

Commit 93ff983

Browse files
committed
Merge branch 'master' into 9863-dialogs-list-service-allow-multiple-popups
2 parents ef0f5fb + a68ab83 commit 93ff983

41 files changed

Lines changed: 324 additions & 336 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.eslintrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686
"@angular-eslint/use-pipe-transform-interface": "error",
8787
"@typescript-eslint/adjacent-overload-signatures": "error",
8888
"@typescript-eslint/array-type": "off",
89-
// "@typescript-eslint/consistent-type-assertions": "error",
89+
"@typescript-eslint/consistent-type-assertions": "error",
9090
// "@typescript-eslint/member-ordering": "error",
9191
// "@typescript-eslint/naming-convention": [
9292
// "error",

eslint.config.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ export default defineConfig([globalIgnores(["projects/**/*", "chatapi/**/*"]), {
8787
"@angular-eslint/use-pipe-transform-interface": "error",
8888
"@typescript-eslint/adjacent-overload-signatures": "error",
8989
"@typescript-eslint/array-type": "off",
90+
"@typescript-eslint/consistent-type-assertions": "error",
9091
"@typescript-eslint/no-empty-function": "off",
9192
"@typescript-eslint/no-empty-interface": "error",
9293
"@typescript-eslint/no-explicit-any": "off",

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"name": "planet",
33
"license": "AGPL-3.0",
4-
"version": "0.22.44",
4+
"version": "0.22.52",
55
"myplanet": {
6-
"latest": "v0.52.96",
7-
"min": "v0.49.69"
6+
"latest": "v0.53.33",
7+
"min": "v0.51.90"
88
},
99
"scripts": {
1010
"ng": "ng",

src/app/community/community.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@ export class CommunityComponent implements OnInit, OnDestroy {
211211
this.userService.userChange$.pipe(takeUntil(this.onDestroy$)).subscribe(() => {
212212
this.user = this.userService.get();
213213
this.isLoggedIn = this.user._id !== undefined;
214+
this.isCommunityLeader = this.user.isUserAdmin || this.user?.roles?.indexOf('leader') > -1;
214215
this.getCommunityData();
215216
});
216217
}

src/app/courses/courses.component.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@
105105
</ng-container>
106106
</ng-template>
107107

108-
<div [ngClass]="{ 'view-container view-full-height view-table': !isForm }">
108+
<div class="card-table" [ngClass]="{ 'view-container view-full-height view-table': !isForm }">
109109
<mat-table #table [dataSource]="courses" matSort [matSortDisableClear]="true" [trackBy]="trackById">
110110
<ng-container matColumnDef="select">
111111
<mat-header-cell *matHeaderCellDef>
@@ -122,9 +122,9 @@
122122
</ng-container>
123123
<ng-container matColumnDef="courseTitle">
124124
<mat-header-cell *matHeaderCellDef mat-sort-header="courseTitle" i18n> Title </mat-header-cell>
125-
<mat-cell *matCellDef="let element" class="list-content-menu" [ngClass]="{'list-content-menu-auto': element.doc.courseTitle.length > 50 }">
125+
<mat-cell *matCellDef="let element" class="list-content-menu">
126126
<h3 class="header">
127-
<ng-container *ngIf="deviceType === deviceTypes.MOBILE">
127+
<ng-container *ngIf="isMobile">
128128
<mat-checkbox (change)="$event ? selection.toggle(element._id) : null"
129129
[checked]="selection.isSelected(element._id)">
130130
</mat-checkbox>

src/app/courses/courses.component.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ export class CoursesComponent implements OnInit, OnChanges, AfterViewInit, OnDes
142142
trackById = trackById;
143143
deviceType: DeviceType;
144144
deviceTypes: typeof DeviceType = DeviceType;
145+
isMobile: boolean;
145146
showFilters = false;
146147
showFiltersRow = false;
147148
expandedElement: any = null;
@@ -176,10 +177,12 @@ export class CoursesComponent implements OnInit, OnChanges, AfterViewInit, OnDes
176177
});
177178
this.dialogsLoadingService.start();
178179
this.deviceType = this.deviceInfoService.getDeviceType();
180+
this.isMobile = this.deviceType === DeviceType.MOBILE || this.deviceType === DeviceType.SMALL_MOBILE;
179181
}
180182

181183
@HostListener('window:resize') OnResize() {
182184
this.deviceType = this.deviceInfoService.getDeviceType();
185+
this.isMobile = this.deviceType === DeviceType.MOBILE || this.deviceType === DeviceType.SMALL_MOBILE;
183186
}
184187

185188
ngOnInit() {

src/app/courses/courses.scss

Lines changed: 20 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -1,130 +1,48 @@
11
@use '../variables' as v;
22
@use './courses-shared' as c;
3-
.mat-mdc-table {
4-
.mat-mdc-row {
5-
border-bottom-width: 1px;
6-
border-bottom-style: solid;
7-
border-bottom-color: rgba(0, 0, 0, 0.12);
8-
}
9-
10-
.mat-mdc-cell {
11-
border: none;
12-
}
133

14-
/* Column Widths */
4+
planet-courses {
155
.mat-column-select {
166
max-width: 44px;
177
padding: 0 0 0 24px;
188
}
199

20-
.mat-column-info {
21-
max-width: 200px;
22-
align-self: start;
23-
padding: 0;
24-
}
25-
2610
.mat-column-createdDate {
2711
max-width: 100px;
28-
align-self: start;
29-
padding: 0;
3012
}
3113

32-
.mat-column-rating {
33-
max-width: 145px;
34-
padding: 0;
35-
}
36-
}
37-
38-
.column {
39-
display: flex;
40-
flex-direction: column;
41-
}
42-
43-
.column > * {
44-
line-height: normal;
45-
}
46-
47-
.course-progress {
48-
margin-top: 0.5rem;
49-
}
50-
51-
.ellipsis-menu {
52-
text-align: center;
53-
}
54-
55-
.created-label {
56-
display: none;
57-
}
58-
59-
.rating-header {
60-
justify-content: center;
61-
}
62-
63-
.margin-tp {
64-
margin-top: 0.75rem;
65-
}
66-
67-
.search-bar {
68-
height: c.$toolbar-height;
69-
}
14+
.column {
15+
display: flex;
16+
flex-direction: column;
7017

71-
.break-word {
72-
word-break: break-word;
73-
}
18+
> * {
19+
line-height: normal;
20+
}
21+
}
7422

75-
planet-courses {
76-
.preview-content {
77-
height: 9rem;
78-
overflow: hidden;
23+
.course-progress {
24+
margin-top: 0.5rem;
7925
}
8026

81-
.preview-toggle {
27+
.ellipsis-menu {
8228
text-align: center;
8329
}
8430

85-
.expanded-row .content {
86-
max-height: none;
31+
.margin-tp {
32+
margin-top: 0.75rem;
8733
}
8834

89-
@media(max-width: v.$screen-md) {
90-
.mat-column-info {
91-
max-width: 120px;
92-
}
93-
94-
.mat-column-createdDate {
95-
max-width: 70px;
96-
}
35+
.search-bar {
36+
height: c.$toolbar-height;
9737
}
9838

99-
@media(max-width: v.$screen-sm) {
100-
.created-label {
101-
display: inline-block;
102-
}
103-
104-
.mat-column-info {
105-
max-width: fit-content;
106-
}
39+
.break-word {
40+
word-break: break-word;
41+
}
10742

43+
@media(max-width: v.$screen-md) {
10844
.mat-column-createdDate {
109-
max-width: fit-content;
110-
}
111-
112-
.mat-mdc-header-row {
113-
display: none;
114-
}
115-
116-
.mat-mdc-row {
117-
flex-direction: column;
118-
align-items: start;
119-
padding: 8px 24px;
120-
}
121-
122-
.table-selection-top {
123-
display: none;
124-
}
125-
126-
.rating-cell {
127-
align-self: flex-end;
45+
max-width: 70px;
12846
}
12947
}
13048
}

src/app/courses/step-view-courses/courses-step-view.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ <h3 class="margin-lr-3 ellipsis-title"><ng-container i18n>Step</ng-container> {{
6666
<span>{{stepNum}}/{{maxStep}}</span>
6767
<button mat-icon-button *ngIf="maxStep !== 1" [disabled]="stepNum === 1 || isLoading" (click)="changeStep(-1)"><mat-icon>navigate_before</mat-icon></button>
6868
<button mat-icon-button *ngIf="stepNum !== maxStep" [disabled]="isLoading || !canProceedToNextStep()" (click)="changeStep(1)"><mat-icon>navigate_next</mat-icon></button>
69-
<button mat-raised-button class="finish-button" *ngIf="stepNum === maxStep" [disabled]="isLoading || !canProceedToNextStep()" (click)="backToCourseDetail()" i18n>Finish</button>
69+
<button mat-raised-button color="accent" class="margin-lr-10" *ngIf="stepNum === maxStep" [disabled]="isLoading || !canProceedToNextStep()" (click)="backToCourseDetail()" i18n>Finish</button>
7070
</div>
7171
</mat-toolbar>
7272
<div class="view-container view-full-height" [ngClass]="{'grid-view': showChat, 'flex-view': !isGridView && !showChat}" *ngIf="stepDetail?.description || resource?._attachments; else emptyRecord">

src/app/courses/step-view-courses/courses-step-view.scss

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,6 @@
5858
text-overflow: ellipsis;
5959
}
6060

61-
.finish-button {
62-
margin-left: 10px;
63-
}
64-
6561
@media (max-width: v.$screen-sm) {
6662
.grid-view {
6763
display: grid;

src/app/exams/exams-add.component.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,9 @@ export class ExamsAddComponent implements OnInit, CanComponentDeactivate {
8989
documentInfo: ExamDocumentInfo = {};
9090
pageType: 'Add' | 'Update' | 'Copy' = 'Add';
9191
courseName = '';
92-
examType: 'exam' | 'survey' = <'exam' | 'survey'>this.route.snapshot.paramMap.get('type') || 'exam';
92+
examType: 'exam' | 'survey';
9393
teamId = this.route.parent?.snapshot.paramMap.get('teamId') || null;
94-
successMessage = this.examType === 'survey' ? $localize`New survey added` : $localize`New test added`;
94+
successMessage: string;
9595
steps = [];
9696
showFormError = false;
9797
showPreviewError = false;
@@ -127,6 +127,9 @@ export class ExamsAddComponent implements OnInit, CanComponentDeactivate {
127127
private dialog: MatDialog,
128128
private submissionsService: SubmissionsService
129129
) {
130+
const typeParam = this.route.snapshot.paramMap.get('type');
131+
this.examType = typeParam === 'exam' || typeParam === 'survey' ? typeParam : 'exam';
132+
this.successMessage = this.examType === 'survey' ? $localize`New survey added` : $localize`New test added`;
130133
this.createForm();
131134
}
132135

0 commit comments

Comments
 (0)