Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Knowledge Space WP Plugin
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
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
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
alg
Knowledge Space WP Plugin
Commits
2c21530e
Commit
2c21530e
authored
2 years ago
by
Maximilian Giller
Browse files
Options
Downloads
Patches
Plain Diff
Implements proper multilayerd use of storage disabling
parent
9b55f554
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#56940
passed
2 years ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/editor/js/structures/manageddata.ts
+8
-5
8 additions, 5 deletions
src/editor/js/structures/manageddata.ts
with
8 additions
and
5 deletions
src/editor/js/structures/manageddata.ts
+
8
−
5
View file @
2c21530e
...
...
@@ -16,7 +16,7 @@ export default class ManagedData extends SerializableItem {
public
history
:
SavePoint
[];
// All save points of the data.
public
historyPosition
:
number
;
// Currently selected save point in history. Latest always at index 0.
private
savedHistoryId
:
number
;
// Id of save point that is considered saved.
private
storing
En
abled
:
boolean
;
// To internally disable saving of objects on save call
.
private
storing
Dis
abled
:
number
;
// Storing is only enabled if this is 0 (or below)
.
/**
* Sets initial states.
...
...
@@ -28,7 +28,7 @@ export default class ManagedData extends SerializableItem {
this
.
history
=
[];
// Newest state is always at 0
this
.
historyPosition
=
0
;
this
.
savedHistoryId
=
0
;
this
.
storing
En
abled
=
true
;
this
.
storing
Dis
abled
=
0
;
}
/**
...
...
@@ -88,14 +88,17 @@ export default class ManagedData extends SerializableItem {
* Setter to disable storing save points.
*/
public
disableStoring
()
{
this
.
storing
En
abled
=
false
;
this
.
storing
Dis
abled
+
=
1
;
}
/**
* Setter to enable storing save points.
*/
public
enableStoring
()
{
this
.
storingEnabled
=
true
;
this
.
storingDisabled
-=
1
;
if
(
this
.
storingDisabled
<
0
)
{
this
.
storingDisabled
=
0
;
}
}
/**
...
...
@@ -217,7 +220,7 @@ export default class ManagedData extends SerializableItem {
* @param relevantChanges Indicates major or minor changes. Major changes get a new id to indicate an actual changed state. Should usually be true.
*/
public
storeCurrentData
(
description
:
string
,
relevantChanges
=
true
)
{
if
(
this
.
storing
En
abled
===
false
)
{
if
(
this
.
storing
Dis
abled
)
{
return
;
}
...
...
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