Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Stud.IP
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
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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
Jan-Hendrik Willms
Stud.IP
Commits
b5ddb109
Commit
b5ddb109
authored
3 years ago
by
Ron Lucke
Committed by
Elmar Ludwig
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
fixes #342
parent
4047f83c
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
resources/vue/components/courseware/CoursewareDefaultBlock.vue
+30
-3
30 additions, 3 deletions
...rces/vue/components/courseware/CoursewareDefaultBlock.vue
with
30 additions
and
3 deletions
resources/vue/components/courseware/CoursewareDefaultBlock.vue
+
30
−
3
View file @
b5ddb109
...
@@ -135,6 +135,7 @@ export default {
...
@@ -135,6 +135,7 @@ export default {
userId
:
'
userId
'
,
userId
:
'
userId
'
,
viewMode
:
'
viewMode
'
,
viewMode
:
'
viewMode
'
,
getComments
:
'
courseware-block-comments/related
'
,
getComments
:
'
courseware-block-comments/related
'
,
containerById
:
'
courseware-containers/byId
'
,
}),
}),
showEditMode
()
{
showEditMode
()
{
let
show
=
this
.
viewMode
===
'
edit
'
||
this
.
blockedByThisUser
;
let
show
=
this
.
viewMode
===
'
edit
'
||
this
.
blockedByThisUser
;
...
@@ -179,6 +180,7 @@ export default {
...
@@ -179,6 +180,7 @@ export default {
unlockObject
:
'
unlockObject
'
,
unlockObject
:
'
unlockObject
'
,
loadComments
:
'
courseware-block-comments/loadRelated
'
,
loadComments
:
'
courseware-block-comments/loadRelated
'
,
loadContainer
:
'
loadContainer
'
,
loadContainer
:
'
loadContainer
'
,
updateContainer
:
'
updateContainer
'
,
}),
}),
async
displayFeature
(
element
)
{
async
displayFeature
(
element
)
{
if
(
this
.
showEdit
&&
element
===
'
Edit
'
)
{
if
(
this
.
showEdit
&&
element
===
'
Edit
'
)
{
...
@@ -252,11 +254,36 @@ export default {
...
@@ -252,11 +254,36 @@ export default {
}
}
},
},
async
executeDelete
()
{
async
executeDelete
()
{
await
this
.
deleteBlock
({
const
containerId
=
this
.
block
.
relationships
.
container
.
data
.
id
;
await
this
.
loadContainer
(
containerId
);
let
container
=
this
.
containerById
({
id
:
containerId
});
const
structuralElementId
=
container
.
relationships
[
'
structural-element
'
].
data
.
id
;
let
containerBlocks
=
container
.
relationships
.
blocks
.
data
.
map
(
block
=>
{
return
block
.
id
;
});
let
sections
=
container
.
attributes
.
payload
.
sections
;
// lock parent container
await
this
.
lockObject
({
id
:
containerId
,
type
:
'
courseware-containers
'
});
// update container information
for
(
let
i
=
0
;
i
<
sections
.
length
;
i
++
)
{
for
(
let
j
=
0
;
j
<
sections
[
i
].
blocks
.
length
;
j
++
)
{
let
blockId
=
sections
[
i
].
blocks
[
j
];
if
(
!
containerBlocks
.
includes
(
blockId
)
||
blockId
===
this
.
block
.
id
)
{
sections
[
i
].
blocks
.
splice
(
j
,
1
);
j
--
;
}
}
}
// update container
await
this
.
updateContainer
({
container
,
structuralElementId
});
// unlock container
await
this
.
unlockObject
({
id
:
containerId
,
type
:
'
courseware-containers
'
});
await
this
.
loadContainer
(
containerId
);
this
.
deleteBlock
({
blockId
:
this
.
block
.
id
,
blockId
:
this
.
block
.
id
,
containerId
:
this
.
block
.
relationships
.
container
.
data
.
i
d
,
containerId
:
container
I
d
,
});
});
// this.showDeleteDialog = false;
},
},
async
loadComments
()
{
async
loadComments
()
{
...
...
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