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
0fd56511
Commit
0fd56511
authored
3 years ago
by
Farbod Zamani
Committed by
Ron Lucke
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Resolve "early disappearing of notification on insert - (shifting) in courseware", fixes #325
parent
c6e0728a
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/CoursewareManagerElement.vue
+45
-26
45 additions, 26 deletions
...es/vue/components/courseware/CoursewareManagerElement.vue
with
45 additions
and
26 deletions
resources/vue/components/courseware/CoursewareManagerElement.vue
+
45
−
26
View file @
0fd56511
...
...
@@ -47,7 +47,7 @@
:isCurrent=
"isCurrent"
:sortContainers=
"sortContainersActive"
:inserter=
"containerInserterActive && moveSelfChildPossible"
:elementType=
"type"
:elementType=
"type"
:blockInserter=
"blockInserterActive"
:canMoveUp=
"index !== 0"
:canMoveDown=
"index+1 !== sortArrayContainers.length"
...
...
@@ -302,11 +302,33 @@ export default {
selectChapter
(
target
)
{
this
.
$emit
(
'
selectElement
'
,
target
);
},
validateSource
(
source
)
{
return
(
source
===
'
self
'
||
source
===
'
remote
'
||
source
===
'
own
'
);
},
afterInsertCompletion
()
{
this
.
$nextTick
(()
=>
{
// will run after $emit is done
this
.
$store
.
dispatch
(
'
cwManagerFilingData
'
,
{});
setTimeout
(()
=>
{
this
.
insertingInProgress
=
false
;
},
250
);
});
},
async
insertElement
(
data
)
{
let
source
=
data
.
source
;
let
element
=
data
.
element
;
if
(
!
this
.
validateSource
(
source
))
{
console
.
log
(
'
unreliable source:
'
);
console
.
log
(
source
);
console
.
log
(
element
);
return
;
}
if
(
!
this
.
insertingInProgress
)
{
this
.
insertingInProgress
=
true
;
let
source
=
data
.
source
;
let
element
=
data
.
element
;
if
(
source
===
'
self
'
)
{
element
.
relationships
.
parent
.
data
.
id
=
this
.
filingData
.
parentItem
.
id
;
element
.
attributes
.
position
=
this
.
childrenById
(
this
.
filingData
.
parentItem
.
id
).
length
+
1
;
...
...
@@ -318,7 +340,6 @@ export default {
await
this
.
unlockObject
({
id
:
element
.
id
,
type
:
'
courseware-structural-elements
'
});
this
.
loadStructuralElement
(
this
.
currentElement
.
id
);
this
.
$emit
(
'
reloadElement
'
);
this
.
$store
.
dispatch
(
'
cwManagerFilingData
'
,
{});
}
else
if
(
source
===
'
remote
'
||
source
===
'
own
'
)
{
//create Element
let
parentId
=
this
.
filingData
.
parentItem
.
id
;
...
...
@@ -327,20 +348,22 @@ export default {
element
:
element
,
});
this
.
$emit
(
'
loadSelf
'
,
parentId
);
this
.
$store
.
dispatch
(
'
cwManagerFilingData
'
,
{});
}
else
{
console
.
log
(
'
unreliable source:
'
);
console
.
log
(
source
);
console
.
log
(
element
);
}
this
.
insertingInProgress
=
false
;
this
.
afterInsertCompletion
()
;
}
},
async
insertContainer
(
data
)
{
let
source
=
data
.
source
;
let
container
=
data
.
container
;
if
(
!
this
.
validateSource
(
source
))
{
console
.
log
(
'
unreliable source:
'
);
console
.
log
(
source
);
console
.
log
(
container
);
return
;
}
if
(
!
this
.
insertingInProgress
)
{
this
.
insertingInProgress
=
true
;
let
source
=
data
.
source
;
let
container
=
data
.
container
;
if
(
source
===
'
self
'
)
{
container
.
relationships
[
'
structural-element
'
].
data
.
id
=
this
.
filingData
.
parentItem
.
id
;
container
.
attributes
.
position
=
this
.
filingData
.
parentItem
.
relationships
.
containers
.
data
.
length
+
1
;
...
...
@@ -351,7 +374,6 @@ export default {
});
await
this
.
unlockObject
({
id
:
container
.
id
,
type
:
'
courseware-containers
'
});
this
.
$emit
(
'
reloadElement
'
);
this
.
$store
.
dispatch
(
'
cwManagerFilingData
'
,
{});
}
else
if
(
source
===
'
remote
'
||
source
===
'
own
'
)
{
let
parentId
=
this
.
filingData
.
parentItem
.
id
;
await
this
.
copyContainer
({
...
...
@@ -359,21 +381,22 @@ export default {
container
:
container
,
});
this
.
$emit
(
'
loadSelf
'
,
parentId
);
this
.
$store
.
dispatch
(
'
cwManagerFilingData
'
,
{});
}
else
{
console
.
log
(
'
unreliable source:
'
);
console
.
log
(
source
);
console
.
log
(
container
);
}
this
.
insertingInProgress
=
false
;
this
.
afterInsertCompletion
()
;
}
},
async
insertBlock
(
data
)
{
let
source
=
data
.
source
;
let
block
=
data
.
block
;
if
(
!
this
.
validateSource
(
source
))
{
console
.
debug
(
'
unreliable source:
'
,
source
,
block
);
return
;
}
if
(
!
this
.
insertingInProgress
)
{
this
.
insertingInProgress
=
true
;
let
source
=
data
.
source
;
let
block
=
data
.
block
;
if
(
source
===
'
self
'
)
{
let
sourceContainer
=
await
this
.
containerById
({
id
:
block
.
relationships
.
container
.
data
.
id
});
sourceContainer
.
attributes
.
payload
.
sections
.
forEach
(
section
=>
{
...
...
@@ -409,7 +432,6 @@ export default {
await
this
.
loadContainer
(
sourceContainer
.
id
);
await
this
.
loadContainer
(
destinationContainer
.
id
);
this
.
$emit
(
'
reloadElement
'
);
this
.
$store
.
dispatch
(
'
cwManagerFilingData
'
,
{});
}
else
if
(
source
===
'
remote
'
||
source
===
'
own
'
)
{
let
parentId
=
this
.
filingData
.
parentItem
.
id
;
await
this
.
copyBlock
({
...
...
@@ -418,11 +440,8 @@ export default {
});
await
this
.
loadContainer
(
parentId
);
this
.
$emit
(
'
loadSelf
'
,
this
.
filingData
.
parentItem
.
relationships
[
'
structural-element
'
].
data
.
id
);
this
.
$store
.
dispatch
(
'
cwManagerFilingData
'
,
{});
}
else
{
console
.
debug
(
'
unreliable source:
'
,
source
,
block
);
}
this
.
insertingInProgress
=
false
;
this
.
afterInsertCompletion
()
;
}
},
...
...
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