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
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Model registry
Analyze
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
Uni Osnabrück
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
Show 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
...
@@ -302,11 +302,33 @@ export default {
...
@@ -302,11 +302,33 @@ export default {
selectChapter
(
target
)
{
selectChapter
(
target
)
{
this
.
$emit
(
'
selectElement
'
,
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
)
{
async
insertElement
(
data
)
{
if
(
!
this
.
insertingInProgress
)
{
this
.
insertingInProgress
=
true
;
let
source
=
data
.
source
;
let
source
=
data
.
source
;
let
element
=
data
.
element
;
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
;
if
(
source
===
'
self
'
)
{
if
(
source
===
'
self
'
)
{
element
.
relationships
.
parent
.
data
.
id
=
this
.
filingData
.
parentItem
.
id
;
element
.
relationships
.
parent
.
data
.
id
=
this
.
filingData
.
parentItem
.
id
;
element
.
attributes
.
position
=
this
.
childrenById
(
this
.
filingData
.
parentItem
.
id
).
length
+
1
;
element
.
attributes
.
position
=
this
.
childrenById
(
this
.
filingData
.
parentItem
.
id
).
length
+
1
;
...
@@ -318,7 +340,6 @@ export default {
...
@@ -318,7 +340,6 @@ export default {
await
this
.
unlockObject
({
id
:
element
.
id
,
type
:
'
courseware-structural-elements
'
});
await
this
.
unlockObject
({
id
:
element
.
id
,
type
:
'
courseware-structural-elements
'
});
this
.
loadStructuralElement
(
this
.
currentElement
.
id
);
this
.
loadStructuralElement
(
this
.
currentElement
.
id
);
this
.
$emit
(
'
reloadElement
'
);
this
.
$emit
(
'
reloadElement
'
);
this
.
$store
.
dispatch
(
'
cwManagerFilingData
'
,
{});
}
else
if
(
source
===
'
remote
'
||
source
===
'
own
'
)
{
}
else
if
(
source
===
'
remote
'
||
source
===
'
own
'
)
{
//create Element
//create Element
let
parentId
=
this
.
filingData
.
parentItem
.
id
;
let
parentId
=
this
.
filingData
.
parentItem
.
id
;
...
@@ -327,20 +348,22 @@ export default {
...
@@ -327,20 +348,22 @@ export default {
element
:
element
,
element
:
element
,
});
});
this
.
$emit
(
'
loadSelf
'
,
parentId
);
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
)
{
async
insertContainer
(
data
)
{
if
(
!
this
.
insertingInProgress
)
{
this
.
insertingInProgress
=
true
;
let
source
=
data
.
source
;
let
source
=
data
.
source
;
let
container
=
data
.
container
;
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
;
if
(
source
===
'
self
'
)
{
if
(
source
===
'
self
'
)
{
container
.
relationships
[
'
structural-element
'
].
data
.
id
=
this
.
filingData
.
parentItem
.
id
;
container
.
relationships
[
'
structural-element
'
].
data
.
id
=
this
.
filingData
.
parentItem
.
id
;
container
.
attributes
.
position
=
this
.
filingData
.
parentItem
.
relationships
.
containers
.
data
.
length
+
1
;
container
.
attributes
.
position
=
this
.
filingData
.
parentItem
.
relationships
.
containers
.
data
.
length
+
1
;
...
@@ -351,7 +374,6 @@ export default {
...
@@ -351,7 +374,6 @@ export default {
});
});
await
this
.
unlockObject
({
id
:
container
.
id
,
type
:
'
courseware-containers
'
});
await
this
.
unlockObject
({
id
:
container
.
id
,
type
:
'
courseware-containers
'
});
this
.
$emit
(
'
reloadElement
'
);
this
.
$emit
(
'
reloadElement
'
);
this
.
$store
.
dispatch
(
'
cwManagerFilingData
'
,
{});
}
else
if
(
source
===
'
remote
'
||
source
===
'
own
'
)
{
}
else
if
(
source
===
'
remote
'
||
source
===
'
own
'
)
{
let
parentId
=
this
.
filingData
.
parentItem
.
id
;
let
parentId
=
this
.
filingData
.
parentItem
.
id
;
await
this
.
copyContainer
({
await
this
.
copyContainer
({
...
@@ -359,21 +381,22 @@ export default {
...
@@ -359,21 +381,22 @@ export default {
container
:
container
,
container
:
container
,
});
});
this
.
$emit
(
'
loadSelf
'
,
parentId
);
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
)
{
async
insertBlock
(
data
)
{
if
(
!
this
.
insertingInProgress
)
{
this
.
insertingInProgress
=
true
;
let
source
=
data
.
source
;
let
source
=
data
.
source
;
let
block
=
data
.
block
;
let
block
=
data
.
block
;
if
(
!
this
.
validateSource
(
source
))
{
console
.
debug
(
'
unreliable source:
'
,
source
,
block
);
return
;
}
if
(
!
this
.
insertingInProgress
)
{
this
.
insertingInProgress
=
true
;
if
(
source
===
'
self
'
)
{
if
(
source
===
'
self
'
)
{
let
sourceContainer
=
await
this
.
containerById
({
id
:
block
.
relationships
.
container
.
data
.
id
});
let
sourceContainer
=
await
this
.
containerById
({
id
:
block
.
relationships
.
container
.
data
.
id
});
sourceContainer
.
attributes
.
payload
.
sections
.
forEach
(
section
=>
{
sourceContainer
.
attributes
.
payload
.
sections
.
forEach
(
section
=>
{
...
@@ -409,7 +432,6 @@ export default {
...
@@ -409,7 +432,6 @@ export default {
await
this
.
loadContainer
(
sourceContainer
.
id
);
await
this
.
loadContainer
(
sourceContainer
.
id
);
await
this
.
loadContainer
(
destinationContainer
.
id
);
await
this
.
loadContainer
(
destinationContainer
.
id
);
this
.
$emit
(
'
reloadElement
'
);
this
.
$emit
(
'
reloadElement
'
);
this
.
$store
.
dispatch
(
'
cwManagerFilingData
'
,
{});
}
else
if
(
source
===
'
remote
'
||
source
===
'
own
'
)
{
}
else
if
(
source
===
'
remote
'
||
source
===
'
own
'
)
{
let
parentId
=
this
.
filingData
.
parentItem
.
id
;
let
parentId
=
this
.
filingData
.
parentItem
.
id
;
await
this
.
copyBlock
({
await
this
.
copyBlock
({
...
@@ -418,11 +440,8 @@ export default {
...
@@ -418,11 +440,8 @@ export default {
});
});
await
this
.
loadContainer
(
parentId
);
await
this
.
loadContainer
(
parentId
);
this
.
$emit
(
'
loadSelf
'
,
this
.
filingData
.
parentItem
.
relationships
[
'
structural-element
'
].
data
.
id
);
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