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
fc70851b
Commit
fc70851b
authored
6 years ago
by
pnogal
Committed by
Paulina Nogal
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Add confirm dialog when moving course with packages
parent
792aa3de
No related branches found
Branches containing commit
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/term-container/term-container.component.ts
+30
-5
30 additions, 5 deletions
...degree-planner/term-container/term-container.component.ts
with
30 additions
and
5 deletions
src/app/degree-planner/term-container/term-container.component.ts
+
30
−
5
View file @
fc70851b
...
...
@@ -24,6 +24,9 @@ import * as utils from '@app/degree-planner/shared/utils';
import
{
findSafariExecutable
}
from
'
selenium-webdriver/safari
'
;
import
{
TermCode
}
from
'
@app/core/models/termcode
'
;
// Dialogs
import
{
ConfirmDialogComponent
}
from
'
@app/shared/dialogs/confirm-dialog/confirm-dialog.component
'
;
const
isntUndefined
=
<
T
>
(
thing
:
T
|
undefined
):
thing
is
T
=>
{
return
thing
!==
undefined
;
};
...
...
@@ -147,11 +150,33 @@ export class TermContainerComponent implements OnInit, OnDestroy {
const
to
=
event
.
container
.
data
;
const
{
id
}
=
event
.
item
.
data
;
const
newIndex
=
event
.
currentIndex
;
// Dispatch a new change request
this
.
store
.
dispatch
(
new
actions
.
MoveCourseBetweenTerms
({
to
,
from
,
id
,
newIndex
}),
);
const
{
classNumber
}
=
event
.
item
.
data
as
Course
;
console
.
log
(
'
classNumber
'
,
classNumber
);
if
(
classNumber
!==
null
)
{
// If moving course with packages to future term
this
.
dialog
.
open
(
ConfirmDialogComponent
,
{
data
:
{
title
:
'
Are you sure?
'
,
confirmText
:
'
Move course
'
,
text
:
`Moving this course to a future term will remove your selected section`
,
},
})
.
afterClosed
()
.
subscribe
((
result
:
{
confirmed
:
true
}
|
undefined
)
=>
{
if
(
result
!==
undefined
&&
result
.
confirmed
===
true
)
{
this
.
store
.
dispatch
(
new
actions
.
MoveCourseBetweenTerms
({
to
,
from
,
id
,
newIndex
}),
);
}
});
}
else
{
// Dispatch a new change request
this
.
store
.
dispatch
(
new
actions
.
MoveCourseBetweenTerms
({
to
,
from
,
id
,
newIndex
}),
);
}
}
else
if
(
previousContainer
===
'
saved-courses
'
)
{
// If moving from saved courses to term
...
...
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