Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
N
nodenogg-duplicate
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
Adam Procter
nodenogg-duplicate
Commits
afbb54a4
Commit
afbb54a4
authored
4 years ago
by
Adam Procter
Browse files
Options
Downloads
Patches
Plain Diff
bug fix for blank nodes on initial onboarding microcosm
parent
70cf5c80
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CHANGELOG.md
+1
-0
1 addition, 0 deletions
CHANGELOG.md
app/src/store/index.js
+77
-74
77 additions, 74 deletions
app/src/store/index.js
with
78 additions
and
74 deletions
CHANGELOG.md
+
1
−
0
View file @
afbb54a4
...
...
@@ -9,6 +9,7 @@ _17th December 2020_
### Fixed
-
Some sync bug fixes.
-
The initial onboarding microcosm should not longer allow you to save nodes.
-
You can now colour nodes in Collect and Card views.
-
initial node creation failed on new microcosm without switching views.
-
Force load on Collect view.
...
...
This diff is collapsed.
Click to expand it.
app/src/store/index.js
+
77
−
74
View file @
afbb54a4
...
...
@@ -451,87 +451,90 @@ const store = new Vuex.Store({
Math
.
random
().
toString
(
36
).
substring
(
2
,
15
)
+
Math
.
random
().
toString
(
36
).
substring
(
2
,
15
)
state
.
localnodeid
=
uniqueid
pouchdb
.
get
(
state
.
myclient
).
then
(
function
(
doc
)
{
doc
.
nodes
.
push
({
node_id
:
uniqueid
,
node_text
:
''
,
node_owner
:
state
.
myclient
,
content_type
:
'
sheet
'
,
deleted
:
false
,
read_mode
:
false
,
color
:
'
#9bc2d8
'
,
})
return
pouchdb
.
put
({
_id
:
state
.
myclient
,
_rev
:
doc
.
_rev
,
_attachments
:
doc
.
_attachments
,
nodes
:
doc
.
nodes
,
if
(
state
.
microcosm
==
'
firstvisit
'
)
{
console
.
log
(
'
not allowed on this microcosm
'
)
}
else
{
pouchdb
.
get
(
state
.
myclient
).
then
(
function
(
doc
)
{
doc
.
nodes
.
push
({
node_id
:
uniqueid
,
node_text
:
''
,
node_owner
:
state
.
myclient
,
content_type
:
'
sheet
'
,
deleted
:
false
,
read_mode
:
false
,
color
:
'
#9bc2d8
'
,
})
.
then
(
function
()
{
return
pouchdb
.
get
(
state
.
myclient
).
then
(
function
(
doc
)
{
state
.
myNodes
=
doc
.
nodes
var
end
=
Object
.
keys
(
state
.
myNodes
).
length
-
1
const
newNode
=
{
nodeid
:
state
.
myNodes
[
end
].
id
,
nodetext
:
state
.
myNodes
[
end
].
text
,
// content_type: state.notes[end].content_type
return
pouchdb
.
put
({
_id
:
state
.
myclient
,
_rev
:
doc
.
_rev
,
_attachments
:
doc
.
_attachments
,
nodes
:
doc
.
nodes
,
})
.
then
(
function
()
{
return
pouchdb
.
get
(
state
.
myclient
).
then
(
function
(
doc
)
{
state
.
myNodes
=
doc
.
nodes
var
end
=
Object
.
keys
(
state
.
myNodes
).
length
-
1
const
newNode
=
{
nodeid
:
state
.
myNodes
[
end
].
id
,
nodetext
:
state
.
myNodes
[
end
].
text
,
// content_type: state.notes[end].content_type
}
state
.
activeNode
=
newNode
})
})
.
catch
(
function
(
err
)
{
if
(
err
.
status
==
404
)
{
// pouchdb.put({ })
}
state
.
activeNode
=
newNode
})
})
.
catch
(
function
(
err
)
{
if
(
err
.
status
==
404
)
{
// pouchdb.put({ })
})
pouchdb
.
get
(
state
.
global_pos_name
).
then
(
function
(
doc
)
{
//console.log(doc.positions[doc.positions.length - 1].z_index)
var
i
localxpos
=
50
localypos
=
50
for
(
i
=
0
;
i
<
Object
.
keys
(
doc
.
positions
).
length
;
i
++
)
{
if
(
doc
.
positions
[
i
].
x_pos
==
50
)
{
localxpos
=
70
localypos
=
70
}
if
(
doc
.
positions
[
i
].
x_pos
==
70
)
{
localxpos
=
90
localypos
=
90
}
if
(
doc
.
positions
[
i
].
x_pos
==
90
)
{
localxpos
=
110
localypos
=
110
}
if
(
doc
.
positions
[
i
].
x_pos
==
110
)
{
localxpos
=
50
localypos
=
50
}
})
})
pouchdb
.
get
(
state
.
global_pos_name
).
then
(
function
(
doc
)
{
//console.log(doc.positions[doc.positions.length - 1].z_index)
var
i
localxpos
=
50
localypos
=
50
for
(
i
=
0
;
i
<
Object
.
keys
(
doc
.
positions
).
length
;
i
++
)
{
if
(
doc
.
positions
[
i
].
x_pos
==
50
)
{
localxpos
=
70
localypos
=
70
}
if
(
doc
.
positions
[
i
].
x_pos
==
70
)
{
localxpos
=
90
localypos
=
90
}
if
(
doc
.
positions
[
i
].
x_pos
==
90
)
{
localxpos
=
110
localypos
=
110
}
if
(
doc
.
positions
[
i
].
x_pos
==
110
)
{
localxpos
=
50
localypos
=
50
}
}
doc
.
positions
.
push
({
node_id
:
uniqueid
,
x_pos
:
localxpos
,
y_pos
:
localypos
,
width
:
200
,
height
:
370
,
z_index
:
zindex
,
read_mode
:
false
,
node_sort
:
0
,
})
return
pouchdb
.
put
({
_id
:
state
.
global_pos_name
,
_rev
:
doc
.
_rev
,
positions
:
doc
.
positions
,
doc
.
positions
.
push
({
node_id
:
uniqueid
,
x_pos
:
localxpos
,
y_pos
:
localypos
,
width
:
200
,
height
:
370
,
z_index
:
zindex
,
read_mode
:
false
,
node_sort
:
0
,
})
.
catch
(
function
(
err
)
{
console
.
log
(
err
)
})
})
return
pouchdb
.
put
({
_id
:
state
.
global_pos_name
,
_rev
:
doc
.
_rev
,
positions
:
doc
.
positions
,
})
.
catch
(
function
(
err
)
{
console
.
log
(
err
)
})
})
}
},
EDIT_NODE
(
state
,
e
)
{
...
...
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