Implement caching and dynamic data fetching. (#1466)

* Rename rv => o in the decorator.

* Address comments.

* Permissions cleanup: remove none and duplicates. (#1967)

* Updates

* Rename var and dropdown text

* Cleanup

* Resolve comments.

* Add user to the perm check.
This commit is contained in:
Bogdan
2017-02-13 16:14:55 -08:00
committed by GitHub
parent b16930f35d
commit c564881867
11 changed files with 306 additions and 223 deletions

View File

@@ -213,9 +213,9 @@ export function mergeTable(table, query) {
return { type: MERGE_TABLE, table, query };
}
export function addTable(query, tableName) {
export function addTable(query, tableName, schemaName) {
return function (dispatch) {
let url = `/superset/table/${query.dbId}/${tableName}/${query.schema}/`;
let url = `/superset/table/${query.dbId}/${tableName}/${schemaName}/`;
$.get(url, (data) => {
const dataPreviewQuery = {
id: shortid.generate(),
@@ -232,7 +232,7 @@ export function addTable(query, tableName) {
Object.assign(data, {
dbId: query.dbId,
queryEditorId: query.id,
schema: query.schema,
schema: schemaName,
expanded: true,
}), dataPreviewQuery)
);
@@ -248,12 +248,12 @@ export function addTable(query, tableName) {
);
});
url = `/superset/extra_table_metadata/${query.dbId}/${tableName}/${query.schema}/`;
url = `/superset/extra_table_metadata/${query.dbId}/${tableName}/${schemaName}/`;
$.get(url, (data) => {
const table = {
dbId: query.dbId,
queryEditorId: query.id,
schema: query.schema,
schema: schemaName,
name: tableName,
};
Object.assign(table, data);