Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
rjs_json_form
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
rjs_json_form
Commits
6fa0f582
Commit
6fa0f582
authored
Mar 14, 2019
by
Boris Kocherov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use new version rjs_form
parent
3cd406b7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
41 deletions
+41
-41
demo/xmla_connection/index.js
demo/xmla_connection/index.js
+11
-4
demo/xmla_connection/wizard.js
demo/xmla_connection/wizard.js
+30
-37
No files found.
demo/xmla_connection/index.js
View file @
6fa0f582
...
...
@@ -260,6 +260,8 @@
p
=
arr
[
0
].
path
,
scope
=
arr
[
0
].
scope
,
action
=
arr
[
0
].
action
,
url
=
arr
[
0
].
ref
,
connection_path
,
path
;
function
rerender
(
sub_scope
,
settings_path
)
{
...
...
@@ -286,17 +288,23 @@
});
}
if
(
action
===
"
render
"
)
{
if
(
"
urn:jio:properties_from_xmla.connection.json
"
===
url
)
{
connection_path
=
p
.
split
(
'
/
'
).
slice
(
0
,
-
1
).
join
(
'
/
'
);
g
.
props
.
xmla_connections
[
connection_path
]
=
scope
.
split
(
'
_
'
).
slice
(
0
,
-
1
).
join
(
'
_
'
);
}
// action `render` fake change so do nothing
return
;
}
for
(
path
in
g
.
props
.
xmla_connections
)
{
if
(
g
.
props
.
xmla_connections
.
hasOwnProperty
(
path
))
{
if
(
p
===
path
&&
action
===
"
add
"
)
{
g
.
props
.
xmla_connections
[
path
]
=
scope
;
return
rerender
(
scope
,
path
);
}
s
=
g
.
props
.
xmla_connections
[
path
];
if
(
action
===
"
delete
"
)
{
if
(
s
===
scope
)
{
// xxx memory leak
g
.
props
.
xmla_connections
[
path
]
=
false
;
delete
g
.
props
.
xmla_connections
[
path
];
}
}
else
{
// check if receive message from gadget with scope == s or his sub_gadgets
...
...
@@ -319,7 +327,6 @@
.
push
(
function
()
{
var
connection_path
=
path
.
split
(
'
/
'
).
slice
(
0
,
-
1
).
join
(
'
/
'
),
settings
;
g
.
props
.
xmla_connections
[
connection_path
]
=
false
;
if
(
g
.
props
.
init_value
)
{
settings
=
convertOnMultiLevel
(
g
.
props
.
init_value
,
connection_path
);
}
...
...
demo/xmla_connection/wizard.js
View file @
6fa0f582
...
...
@@ -319,7 +319,7 @@
rJS
(
window
)
.
ready
(
function
(
g
)
{
g
.
props
=
{};
g
.
props
.
xmla_connections
=
{}
;
g
.
props
.
choices
=
[]
;
return
g
.
render
({
schema_url
:
new
URL
(
"
olap_wizard.json
"
,
window
.
location
).
toString
(),
value
:
{}
...
...
@@ -354,16 +354,16 @@
.
declareAcquiredMethod
(
"
notifyChange
"
,
"
notifyChange
"
)
.
allowPublicAcquisition
(
"
notifyChange
"
,
function
(
arr
,
s
)
{
var
g
=
this
,
p
=
arr
[
0
].
path
,
scope
=
arr
[
0
].
scope
,
relPath
=
arr
[
0
].
rel_path
,
action
=
arr
[
0
].
action
,
gadget_settings
,
used_diemensions
,
path
;
url
=
arr
[
0
].
ref
,
y
;
function
rerender
(
sub_scope
,
rerender_path
)
{
var
queue
;
function
rerender
(
sub_scope
)
{
var
queue
,
gadget_settings
;
if
(
!
used_diemensions
)
{
queue
=
get_used_dimensions
(
g
)
.
push
(
function
(
v
)
{
...
...
@@ -381,7 +381,10 @@
gadget_settings
=
gadget
;
return
RSVP
.
all
([
getCurrentConnectionSettings
(
gadget
),
gadget
.
getContent
(
rerender_path
)
gadget
.
getSubGadget
(
sub_scope
)
.
push
(
function
(
z
)
{
return
z
.
getContent
();
})
]);
})
.
push
(
function
(
arr
)
{
...
...
@@ -401,43 +404,36 @@
}
function
allRerender
()
{
var
tasks
=
[],
i
;
for
(
i
in
g
.
props
.
xmla_connections
)
{
if
(
g
.
props
.
xmla_connections
.
hasOwnProperty
(
i
))
{
s
=
g
.
props
.
xmla_connections
[
i
];
if
(
s
)
{
tasks
.
push
(
rerender
(
s
,
i
));
}
}
}
return
get_used_dimensions
(
g
)
.
push
(
function
(
v
)
{
used_diemensions
=
v
;
return
RSVP
.
all
(
tasks
);
return
RSVP
.
all
(
g
.
props
.
choices
.
map
(
function
(
q
)
{
return
rerender
(
q
);
}));
});
}
if
(
p
===
"
/connection_name
"
)
{
if
(
"
urn:jio:remote_connections.json
"
===
url
)
{
return
allRerender
();
}
for
(
path
in
g
.
props
.
xmla_connections
)
{
if
(
g
.
props
.
xmla_connections
.
hasOwnProperty
(
path
))
{
if
(
p
===
path
&&
action
===
"
add
"
)
{
g
.
props
.
xmla_connections
[
path
]
=
scope
;
return
rerender
(
scope
,
path
);
if
(
action
===
"
render
"
)
{
if
(
"
urn:jio:choice.json
"
===
url
)
{
g
.
props
.
choices
.
push
(
scope
);
}
// action `render` fake change so do nothing
return
;
}
for
(
y
=
0
;
y
<
g
.
props
.
choices
.
length
;
y
+=
1
)
{
s
=
g
.
props
.
choices
[
y
];
if
(
scope
.
startsWith
(
s
))
{
if
(
action
===
"
delete
"
)
{
g
.
props
.
choices
.
splice
(
y
,
1
);
return
allRerender
();
}
s
=
g
.
props
.
xmla_connections
[
path
];
if
(
scope
===
s
)
{
if
(
action
===
"
delete
"
)
{
// xxx memory leak
g
.
props
.
xmla_connections
[
path
]
=
false
;
}
if
(
relPath
===
"
/dimension
"
)
{
return
allRerender
();
}
return
rerender
(
s
,
path
);
if
(
relPath
===
"
/dimension
"
)
{
return
allRerender
();
}
return
rerender
(
s
);
}
}
// return g.notifyChange();
...
...
@@ -474,9 +470,6 @@
.
push
(
function
(
connections
)
{
var
connection_settings
,
choice_settings
;
if
(
path
!==
"
/parameters/columns/
"
&&
path
!==
"
/parameters/rows/
"
)
{
g
.
props
.
xmla_connections
[
path
]
=
false
;
}
if
(
g
.
props
.
init_value
)
{
connection_settings
=
connections
[
convertOnMultiLevel
(
g
.
props
.
init_value
,
"
/connection_name
"
)];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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