Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Angella Naigaga
Schema
Commits
beab1079
Commit
beab1079
authored
4 years ago
by
Ruben Seggers
Browse files
Options
Download
Email Patches
Plain Diff
sort export iOS, bugfix Edge inherits from Item
parent
d3cbcc82
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tools/export_schema_ios_application.js
+11
-6
tools/export_schema_ios_application.js
with
11 additions
and
6 deletions
+11
-6
tools/export_schema_ios_application.js
+
11
-
6
View file @
beab1079
...
...
@@ -8,7 +8,7 @@ const outputFile = './schema.swift';
function
getItemFamily
()
{
let
itemFamily
=
[],
bgColors
=
[],
fgColors
=
[],
typeFunctions
=
[];
for
(
const
entity
of
Object
.
keys
(
entityHierarchy
))
{
for
(
const
entity
of
Object
.
keys
(
entityHierarchy
)
.
sort
()
)
{
if
(
entity
===
'
Item
'
)
continue
;
itemFamily
.
push
(
`case type
${
entity
}
= "
${
entity
}
"`
);
bgColors
.
push
(
`case .type
${
entity
}
: return Color(hex: "
${
entityHierarchy
[
entity
][
'
backgroundColor
'
]}
")`
);
...
...
@@ -21,7 +21,7 @@ function getItemFamily() {
function
getDataItemClasses
()
{
let
propertiesAndRelationsItem
=
entityHierarchy
[
'
Item
'
][
'
properties
'
].
concat
(
Object
.
keys
(
entityHierarchy
[
'
Item
'
][
'
relations
'
]));
let
dataItemClasses
=
[];
for
(
const
entity
of
Object
.
keys
(
entityHierarchy
))
{
for
(
const
entity
of
Object
.
keys
(
entityHierarchy
)
.
sort
()
)
{
if
([
'
Datasource
'
,
'
UserState
'
,
'
ViewArguments
'
,
'
CVUStateDefinition
'
].
includes
(
entity
))
continue
;
let
classDescription
=
`\n///
${
entityHierarchy
[
entity
][
'
description
'
]}
\n`
;
...
...
@@ -44,9 +44,14 @@ function getDataItemClasses() {
let
ancestry
=
helpers
.
getAncestry
(
entityHierarchy
[
entity
][
'
path
'
].
split
(
'
/
'
));
let
propertiesAndRelations
=
[];
for
(
const
_item
in
ancestry
)
{
propertiesAndRelations
=
propertiesAndRelations
.
concat
(
entityHierarchy
[
_item
][
'
properties
'
]);
propertiesAndRelations
=
propertiesAndRelations
.
concat
(
Object
.
keys
(
entityHierarchy
[
_item
][
'
relations
'
]));
if
(
entity
===
'
Edge
'
)
{
propertiesAndRelations
=
propertiesAndRelations
.
concat
(
entityHierarchy
[
entity
][
'
properties
'
]);
propertiesAndRelations
=
propertiesAndRelations
.
concat
(
Object
.
keys
(
entityHierarchy
[
entity
][
'
relations
'
]));
}
else
{
for
(
const
_item
in
ancestry
)
{
propertiesAndRelations
=
propertiesAndRelations
.
concat
(
entityHierarchy
[
_item
][
'
properties
'
]);
propertiesAndRelations
=
propertiesAndRelations
.
concat
(
Object
.
keys
(
entityHierarchy
[
_item
][
'
relations
'
]));
}
}
let
properties
=
""
;
...
...
@@ -177,7 +182,7 @@ ${propertiesDecoder}${relationsDecoder}${additionalFunctionality}
function
getDataItemListToArray
()
{
let
dataItems
=
[];
for
(
const
[
index
,
entity
]
of
Object
.
keys
(
entityHierarchy
).
entries
())
{
for
(
const
[
index
,
entity
]
of
Object
.
keys
(
entityHierarchy
).
sort
().
entries
())
{
if
([
'
Datasource
'
,
'
SyncState
'
,
'
UserState
'
,
'
ViewArguments
'
].
includes
(
entity
))
continue
;
if
(
entity
===
'
Edge
'
)
{
dataItems
.
push
(
`else if let list = object as? Results<Edge> { return list.itemsArray() }`
);
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Snippets