Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
course-search-enroll-fe
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Scott Berg
course-search-enroll-fe
Commits
4b5bded5
Commit
4b5bded5
authored
6 years ago
by
pnogal
Committed by
Paulina Nogal
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Include active term in user messages
parent
f22389af
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/app/degree-planner/degree-planner.component.ts
+24
-6
24 additions, 6 deletions
src/app/degree-planner/degree-planner.component.ts
with
24 additions
and
6 deletions
src/app/degree-planner/degree-planner.component.ts
+
24
−
6
View file @
4b5bded5
...
...
@@ -4,8 +4,8 @@ import {
withLatestFrom
,
distinctUntilChanged
,
}
from
'
rxjs/operators
'
;
import
{
OnInit
}
from
'
@angular/core
'
;
import
{
Observable
,
of
}
from
'
rxjs
'
;
import
{
OnInit
,
OnDestroy
}
from
'
@angular/core
'
;
import
{
Observable
,
of
,
Subscription
}
from
'
rxjs
'
;
import
{
select
}
from
'
@ngrx/store
'
;
import
{
Component
}
from
'
@angular/core
'
;
import
{
MatSelectChange
}
from
'
@angular/material
'
;
...
...
@@ -34,16 +34,18 @@ import {
CloseCourseSearch
,
}
from
'
./store/actions/ui.actions
'
;
// Pipes
import
{
GetTermDescriptionPipe
}
from
'
@app/shared/pipes/get-term-description.pipe
'
;
@
Component
({
selector
:
'
cse-degree-planner
'
,
templateUrl
:
'
./degree-planner.component.html
'
,
styleUrls
:
[
'
./degree-planner.component.scss
'
],
})
export
class
DegreePlannerComponent
implements
OnInit
{
export
class
DegreePlannerComponent
implements
OnInit
,
OnDestroy
{
public
termsByAcademicYear
:
Object
;
public
mobileView
:
MediaQueryList
;
public
coursesData$
:
any
;
public
degreePlan$
:
Observable
<
DegreePlan
|
undefined
>
;
public
allDegreePlans$
:
Observable
<
DegreePlan
[]
>
;
public
firstActiveTermCode$
:
Observable
<
string
|
undefined
>
;
...
...
@@ -51,6 +53,8 @@ export class DegreePlannerComponent implements OnInit {
public
yearCodes$
:
Observable
<
string
[]
>
;
public
isCourseSearchOpen$
:
Observable
<
boolean
>
;
public
isLoadingPlan$
:
Observable
<
boolean
>
;
public
activeTermSubscription
:
Subscription
;
public
firstActiveTerm
:
string
;
constructor
(
private
store
:
Store
<
GlobalState
>
,
...
...
@@ -85,6 +89,11 @@ export class DegreePlannerComponent implements OnInit {
);
}
// Unsubscribe from subs to prevent memeory leaks
public
ngOnDestroy
()
{
this
.
activeTermSubscription
.
unsubscribe
();
}
public
handleAcademicYearToggle
(
year
:
Year
):
void
{
// this.store.dispatch(
// new ToggleAcademicYear({ year: year.twoDigitYearCode.toString() }),
...
...
@@ -139,13 +148,22 @@ export class DegreePlannerComponent implements OnInit {
}
public
onMakePrimayClick
(
currentPlan
:
DegreePlan
)
{
this
.
activeTermSubscription
=
this
.
store
.
pipe
(
select
(
selectors
.
getActiveTerms
))
.
subscribe
(
terms
=>
{
this
.
firstActiveTerm
=
terms
[
0
];
});
const
currentTerm
:
any
=
new
GetTermDescriptionPipe
().
transform
(
this
.
firstActiveTerm
,
);
this
.
dialog
.
open
(
ConfirmDialogComponent
,
{
data
:
{
title
:
'
Are you sure?
'
,
confirmText
:
'
Change plan
'
,
text
:
"
This will change your primary plan and replace the current courses in your cart with the courses in this plan's active term
"
,
text
:
`This will change your primary plan and replace the current courses in your cart with the courses in this plan's
${
currentTerm
}
term`
,
},
})
.
afterClosed
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment