Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
dashboard
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
AURA
dashboard
Commits
35c3005a
Commit
35c3005a
authored
5 years ago
by
jackie / Andrea Ida Malkah Klaura
Browse files
Options
Downloads
Patches
Plain Diff
implements single timeslot deletion for
#30
parent
ba7fc67f
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/components/EmissionManagerModalEdit.vue
+58
-37
58 additions, 37 deletions
src/components/EmissionManagerModalEdit.vue
with
58 additions
and
37 deletions
src/components/EmissionManagerModalEdit.vue
+
58
−
37
View file @
35c3005a
...
...
@@ -72,45 +72,45 @@
</ul>
</div>
<
p>
What do you want to do?
</p
>
<div
align=
"center"
>
<
b-button-group
>
<b-button
variant=
"danger"
size=
"sm
"
@
click=
"deleteFullSchedule(schedule.id)
"
>
<div
v-if=
"loaded.scheduleTimeslots"
>
<span
v-if=
"
schedule.rrule === 1 &&
scheduleTimeslots.length === 1"
>
Delete
</span>
<
div
v-if=
"loaded.scheduleTimeslots"
>
<p>
What do you want to do?
</p
>
<
div
align=
"center"
>
<b-button
-group>
<b-button
variant=
"danger
"
size=
"sm
"
@
click=
"deleteFullSchedule(schedule.id)"
>
<span
v-if=
"scheduleTimeslots.length === 1"
>
Delete
</span>
<span
v-else-if=
"schedule.rrule === 1"
>
Delete both
</span>
<span
v-else
>
Delete schedule + all timeslots
</span>
</
div
>
<div
v-else
>
<img
src=
"../assets/radio.gif
"
alt=
"loading schedule data
"
>
</div>
</b-button
>
<
b-button
v-if=
"schedule.rrule > 1"
variant=
"danger"
size=
"sm
"
@
click=
"notYetImplemented()
"
>
Delete only this
timeslot
</b-button
>
<
b-button
v-if=
"schedule.rrule > 1"
variant=
"danger"
size=
"sm"
@
click=
"notYetImplemented()"
>
Delete this + all future timeslots
</b-button>
</b-button-group
>
</
b-button
>
<b-button
v-if=
"schedule.rrule > 1 && scheduleTimeslots.length > 1
"
variant=
"danger
"
size=
"sm"
@
click=
"deleteSingleTimeslot(schedule.id, timeslot.id)"
>
Delete only this timeslot
</
b-button
>
<b-button
v-if=
"schedule.rrule > 1 && scheduleTimeslots.length > 1
"
variant=
"danger
"
size=
"sm"
@
click=
"deleteAllFutureTimeslots(schedule.id,
timeslot
.id)"
>
Delete this + all future timeslots
</
b-button
>
</b-button-group>
</div>
</div>
<div
v-else
>
<img
src=
"../assets/radio.gif"
alt=
"loading timeslot data"
>
</div>
</div>
<div
v-else
>
...
...
@@ -161,6 +161,27 @@ export default {
})
},
deleteSingleTimeslot
(
scheduleId
,
timeslotId
)
{
let
uri
=
process
.
env
.
VUE_APP_API_STEERING
+
'
shows/
'
+
this
.
show
.
id
+
'
/schedules/
'
+
scheduleId
+
'
/timeslots/
'
+
timeslotId
+
'
/
'
axios
.
delete
(
uri
,
{
withCredentials
:
true
,
headers
:
{
'
Authorization
'
:
'
Bearer
'
+
this
.
$parent
.
$parent
.
user
.
access_token
}
}).
then
(()
=>
{
this
.
$refs
.
modalEmissionManagerEdit
.
hide
()
this
.
$parent
.
renderView
(
null
)
}).
catch
(
error
=>
{
this
.
$log
.
error
(
error
.
response
.
status
+
'
'
+
error
.
response
.
statusText
)
this
.
$log
.
error
(
error
.
response
)
alert
(
'
Error: could not delete full schedule. See console for details.
'
)
})
},
deleteAllFutureTimeslots
(
scheduleId
,
timeslotId
)
{
this
.
$log
.
debug
(
scheduleId
,
timeslotId
)
this
.
notYetImplemented
()
},
loadSchedule
(
id
)
{
this
.
loaded
.
schedule
=
false
let
uri
=
process
.
env
.
VUE_APP_API_STEERING
+
'
shows/
'
+
this
.
show
.
id
+
'
/schedules/
'
+
id
+
'
/
'
...
...
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