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
f658464a
Commit
f658464a
authored
Mar 01, 2019
by
Boris Kocherov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use new features rjs_json_form inside xmla demo
parent
2dc7333d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
22 deletions
+50
-22
demo/xmla_connection/index.js
demo/xmla_connection/index.js
+48
-21
demo/xmla_connection/wizard.js
demo/xmla_connection/wizard.js
+2
-1
No files found.
demo/xmla_connection/index.js
View file @
f658464a
...
@@ -63,6 +63,16 @@
...
@@ -63,6 +63,16 @@
});
});
}
}
function
print_content
(
gadget
)
{
return
gadget
.
getDeclaredGadget
(
"
xmla_settings
"
)
.
push
(
function
(
g
)
{
return
g
.
getContent
();
})
.
push
(
function
(
v
)
{
console
.
log
(
JSON
.
stringify
(
v
));
});
}
function
discoverDataSources
(
schema
,
opt
)
{
function
discoverDataSources
(
schema
,
opt
)
{
return
xmla_request_retry
(
"
discoverDataSources
"
,
opt
)
return
xmla_request_retry
(
"
discoverDataSources
"
,
opt
)
.
push
(
undefined
,
function
(
error
)
{
.
push
(
undefined
,
function
(
error
)
{
...
@@ -228,10 +238,14 @@
...
@@ -228,10 +238,14 @@
.
allowPublicAcquisition
(
"
notifyInvalid
"
,
function
(
arr
,
scope
)
{
.
allowPublicAcquisition
(
"
notifyInvalid
"
,
function
(
arr
,
scope
)
{
})
})
.
declareMethod
(
"
render
"
,
function
(
opt
)
{
.
declareMethod
(
"
render
"
,
function
(
opt
)
{
this
.
props
.
init_value
=
opt
.
value
;
var
gadget
=
this
;
return
this
.
getDeclaredGadget
(
"
xmla_settings
"
)
gadget
.
props
.
init_value
=
opt
.
value
;
return
gadget
.
getDeclaredGadget
(
"
xmla_settings
"
)
.
push
(
function
(
g
)
{
.
push
(
function
(
g
)
{
return
g
.
render
(
opt
);
return
g
.
render
(
opt
);
})
.
push
(
function
()
{
delete
gadget
.
props
.
init_value
;
});
});
})
})
.
declareMethod
(
"
getContent
"
,
function
()
{
.
declareMethod
(
"
getContent
"
,
function
()
{
...
@@ -241,13 +255,15 @@
...
@@ -241,13 +255,15 @@
});
});
})
})
.
declareAcquiredMethod
(
"
notifyChange
"
,
"
notifyChange
"
)
.
declareAcquiredMethod
(
"
notifyChange
"
,
"
notifyChange
"
)
.
allowPublicAcquisition
(
"
notifyChange
"
,
function
(
arr
,
s
cope
)
{
.
allowPublicAcquisition
(
"
notifyChange
"
,
function
(
arr
,
s
)
{
var
g
=
this
,
var
g
=
this
,
p
=
arr
[
0
].
path
,
p
=
arr
[
0
].
path
,
gadget_settings
,
scope
=
arr
[
0
].
scope
,
action
=
arr
[
0
].
action
,
path
;
path
;
function
f
(
settings_path
,
rerender_path
)
{
function
rerender
(
sub_scope
,
settings_path
)
{
var
gadget_settings
;
return
g
.
getDeclaredGadget
(
"
xmla_settings
"
)
return
g
.
getDeclaredGadget
(
"
xmla_settings
"
)
.
push
(
function
(
gadget
)
{
.
push
(
function
(
gadget
)
{
gadget_settings
=
gadget
;
gadget_settings
=
gadget
;
...
@@ -258,45 +274,56 @@
...
@@ -258,45 +274,56 @@
})
})
.
push
(
function
(
schema
)
{
.
push
(
function
(
schema
)
{
return
gadget_settings
.
rerender
({
return
gadget_settings
.
rerender
({
path
:
rerender_path
,
scope
:
sub_scope
,
schema
:
schema
path
:
'
/properties
'
,
schema
:
schema
,
ignore_incorrect
:
true
});
});
})
})
.
push
(
function
()
{
.
push
(
function
()
{
// return g.notifyChange();
// return g.notifyChange();
return
print_content
(
g
);
});
});
}
}
for
(
path
in
g
.
props
.
xmla_connections
)
{
for
(
path
in
g
.
props
.
xmla_connections
)
{
if
(
g
.
props
.
xmla_connections
.
hasOwnProperty
(
path
)
&&
if
(
g
.
props
.
xmla_connections
.
hasOwnProperty
(
path
))
{
p
.
startsWith
(
path
))
{
if
(
p
===
path
&&
action
===
"
add
"
)
{
return
f
(
path
,
g
.
props
.
xmla_connections
[
path
]);
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
;
}
}
else
{
// check if receive message from gadget with scope == s or his sub_gadgets
if
(
scope
.
startsWith
(
s
))
{
return
rerender
(
s
,
path
);
}
}
}
}
}
}
// return g.notifyChange();
// return g.notifyChange();
return
print_content
(
g
);
})
})
.
allowPublicAcquisition
(
"
resolveExternalReference
"
,
function
(
arr
)
{
.
allowPublicAcquisition
(
"
resolveExternalReference
"
,
function
(
arr
)
{
var
g
=
this
,
var
g
=
this
,
url
=
arr
[
0
],
url
=
arr
[
0
],
schema_path
=
arr
[
1
],
schema_path
=
arr
[
1
],
path
=
arr
[
2
],
path
=
arr
[
2
];
settings
,
connection_path
;
if
(
"
urn:jio:properties_from_xmla.connection.json
"
===
url
)
{
if
(
"
urn:jio:properties_from_xmla.connection.json
"
===
url
)
{
connection_path
=
path
.
split
(
'
/
'
).
slice
(
0
,
-
1
).
join
(
'
/
'
);
return
new
RSVP
.
Queue
()
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
.
push
(
function
()
{
var
connection_path
=
path
.
split
(
'
/
'
).
slice
(
0
,
-
1
).
join
(
'
/
'
),
settings
;
g
.
props
.
xmla_connections
[
connection_path
]
=
false
;
if
(
g
.
props
.
init_value
)
{
if
(
g
.
props
.
init_value
)
{
settings
=
convertOnMultiLevel
(
g
.
props
.
init_value
,
connection_path
);
settings
=
convertOnMultiLevel
(
g
.
props
.
init_value
,
connection_path
);
if
(
settings
)
{
convertOnMultiLevel
(
g
.
props
.
init_value
,
connection_path
,
[]);
}
}
}
return
generateSchema
(
settings
);
return
generateSchema
(
settings
);
})
.
push
(
function
(
s
)
{
g
.
props
.
xmla_connections
[
connection_path
]
=
path
;
return
s
;
});
});
}
}
throw
new
Error
(
"
urn: '
"
+
url
+
"
' not supported
"
);
throw
new
Error
(
"
urn: '
"
+
url
+
"
' not supported
"
);
...
...
demo/xmla_connection/wizard.js
View file @
f658464a
...
@@ -390,7 +390,8 @@
...
@@ -390,7 +390,8 @@
.
push
(
function
(
schema
)
{
.
push
(
function
(
schema
)
{
return
gadget_settings
.
rerender
({
return
gadget_settings
.
rerender
({
scope
:
sub_scope
,
scope
:
sub_scope
,
schema
:
schema
schema
:
schema
,
ignore_incorrect
:
true
});
});
})
})
.
push
(
function
()
{
.
push
(
function
()
{
...
...
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