Skip to content

Commit 07cc6ea

Browse files
authored
Merge pull request #262 from PROCOLLAB-github/fix-course
add course navigation from program page & update lesson button texts
2 parents e457292 + d69e73b commit 07cc6ea

11 files changed

Lines changed: 46 additions & 11 deletions

File tree

projects/social_platform/src/app/office/courses/detail/course-detail.component.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ export class CourseDetailComponent implements OnInit {
7777
}
7878

7979
redirectToProgram(): void {
80-
this.router.navigateByUrl(`/office/program/${this.course()?.partnerProgramId}`);
80+
this.router.navigate([`/office/program/${this.course()?.partnerProgramId}`], {
81+
queryParams: { courseId: this.course()?.id },
82+
});
8183
}
8284
}

projects/social_platform/src/app/office/courses/lesson/complete/complete.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<img alt="complete img" src="/assets/images/courses/complete.svg" />
66

77
<div class="complete__text">
8-
<p class="text-body-12-bold">поздравялем!</p>
8+
<p class="text-body-12-bold">поздравляем!</p>
99
<p class="text-body-12">урок пройден</p>
1010
</div>
1111

projects/social_platform/src/app/office/courses/lesson/lesson.component.html

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,13 @@
8989
class="action__button"
9090
(click)="onSubmitAnswer()"
9191
>
92-
{{ isLastTask() ? "завершить тест" : "следующее задание" }}
92+
{{
93+
isLastTask()
94+
? "завершить урок"
95+
: currentTask()?.answerType === null
96+
? "отправить задание"
97+
: "отправить ответ"
98+
}}
9399
</app-button>
94100
</div>
95101
</div>

projects/social_platform/src/app/office/courses/lesson/shared/exclude-task/exclude-task.component.scss

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@
104104

105105
&__body,
106106
&__content {
107-
flex-grow: 1;
108107
min-height: 358px;
109108
padding: 24px;
110109
background-color: var(--light-white);
@@ -113,14 +112,16 @@
113112
}
114113

115114
&__body {
116-
max-width: 422px;
115+
flex: 1;
117116

118117
&--hasContent {
119118
max-width: 333px;
120119
}
121120
}
122121

123122
&__content {
123+
max-width: 350px;
124+
124125
&--hasContent {
125126
min-width: 333px;
126127
}

projects/social_platform/src/app/office/courses/lesson/shared/file-task/file-task.component.scss

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,20 @@
1414

1515
&__header,
1616
&__content {
17-
flex-grow: 1;
1817
min-height: 358px;
1918
padding: 24px;
2019
background: var(--light-white);
2120
border: 0.5px solid var(--medium-grey-for-outline);
2221
border-radius: var(--rounded-lg);
2322
}
2423

24+
&__header {
25+
flex: 1;
26+
}
27+
2528
&__content {
2629
min-width: 333px;
30+
max-width: 350px;
2731
padding: 12px 24px;
2832

2933
::ng-deep {

projects/social_platform/src/app/office/courses/lesson/shared/radio-select-task/radio-select-task.component.scss

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@
110110

111111
&__body,
112112
&__content {
113-
flex-grow: 1;
114113
min-height: 358px;
115114
padding: 24px;
116115
background-color: var(--light-white);
@@ -119,7 +118,7 @@
119118
}
120119

121120
&__body {
122-
max-width: 422px;
121+
flex: 1;
123122

124123
&--hasContent {
125124
display: flex;
@@ -143,6 +142,8 @@
143142
}
144143

145144
&__content {
145+
max-width: 350px;
146+
146147
&--hasContent {
147148
min-width: 333px;
148149
}

projects/social_platform/src/app/office/courses/lesson/shared/write-task/write-task.component.scss

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,20 @@
1313

1414
&__header,
1515
&__content {
16-
flex-grow: 1;
1716
min-height: 358px;
1817
padding: 24px;
1918
background: var(--light-white);
2019
border: 0.5px solid var(--medium-grey-for-outline);
2120
border-radius: var(--rounded-lg);
2221
}
2322

23+
&__header {
24+
flex: 1;
25+
}
26+
2427
&__content {
2528
min-width: 333px;
29+
max-width: 350px;
2630
padding: 12px 24px;
2731
}
2832

projects/social_platform/src/app/office/courses/shared/course/course.component.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
<div class="course">
55
<div class="course__cover">
66
<app-avatar [size]="68" [url]="course.avatarUrl"></app-avatar>
7-
<img src="assets\icons\svg\rocket.svg" class="course__rocket" />
87
<app-button
98
customTypographyClass="text-body-10"
109
[color]="isMember() ? 'primary' : isSubs() ? 'red' : 'green'"

projects/social_platform/src/app/office/features/detail/detail.component.html

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,15 @@
181181
участники
182182
</app-button>
183183
</a>
184+
} @else { @if (info().courseId || queryCourseId()) {
185+
<a
186+
class="info__contacts"
187+
[routerLink]="'/office/courses/' + (info().courseId || queryCourseId())"
188+
>
189+
<app-button appearance="outline" size="medium" customTypographyClass="text-body-12">
190+
перейти в курс
191+
</app-button>
192+
</a>
184193
} @else {
185194
<a class="info__contacts">
186195
<app-button
@@ -193,7 +202,7 @@
193202
информация с ссылок
194203
</app-button>
195204
</a>
196-
} }
205+
} } }
197206

198207
<app-modal
199208
[open]="isAssignProjectToProgramModalOpen()"

projects/social_platform/src/app/office/features/detail/detail.component.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ export class DeatilComponent implements OnInit, OnDestroy {
8080
profile?: User;
8181
profileProjects = signal<User["projects"]>([]);
8282
listType: "project" | "program" | "profile" = "project";
83+
queryCourseId = signal<number | null>(null);
8384

8485
// Переменная для подсказок
8586
isTooltipVisible = false;
@@ -158,6 +159,12 @@ export class DeatilComponent implements OnInit, OnDestroy {
158159
this.listType = data["listType"];
159160
});
160161

162+
const queryParamsSub$ = this.route.queryParams.subscribe(params => {
163+
const courseId = params["courseId"];
164+
this.queryCourseId.set(courseId ? +courseId : null);
165+
});
166+
this.subscriptions.push(queryParamsSub$);
167+
161168
this.initializeBackPath();
162169

163170
this.updatePageStates();

0 commit comments

Comments
 (0)