Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Metabase
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Engineering Digital Service
Metabase
Commits
ca09ca58
Commit
ca09ca58
authored
9 years ago
by
Tom Robinson
Browse files
Options
Downloads
Patches
Plain Diff
Fix exception when navigating to /admin/metadata
parent
4b5ec811
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
resources/frontend_client/app/admin/metadata/metadata.controllers.js
+23
-21
23 additions, 21 deletions
...rontend_client/app/admin/metadata/metadata.controllers.js
with
23 additions
and
21 deletions
resources/frontend_client/app/admin/metadata/metadata.controllers.js
+
23
−
21
View file @
ca09ca58
...
...
@@ -51,28 +51,30 @@ function($scope, $route, $routeParams, $location, $q, $timeout, databases, Metab
},
true
);
$scope
.
$watch
(
'
databaseId
'
,
Promise
.
coroutine
(
function
*
()
{
try
{
$scope
.
tables
=
{};
var
tables
=
yield
Metabase
.
db_tables
({
'
dbId
'
:
$scope
.
databaseId
}).
$promise
;
yield
Promise
.
all
(
tables
.
map
(
Promise
.
coroutine
(
function
*
(
table
)
{
$scope
.
tables
[
table
.
id
]
=
yield
Metabase
.
table_query_metadata
({
'
tableId
'
:
table
.
id
,
'
include_sensitive_fields
'
:
true
}).
$promise
;
computeMetadataStrength
(
$scope
.
tables
[
table
.
id
]);
})));
var
result
=
yield
Metabase
.
db_idfields
({
'
dbId
'
:
$scope
.
databaseId
}).
$promise
;
if
(
result
&&
!
result
.
error
)
{
$scope
.
idfields
=
result
.
map
(
function
(
field
)
{
field
.
displayName
=
field
.
table
.
display_name
+
"
→
"
+
field
.
display_name
;
return
field
;
});
}
else
{
console
.
warn
(
result
);
$scope
.
tables
=
{};
if
(
$scope
.
databaseId
!=
null
)
{
try
{
var
tables
=
yield
Metabase
.
db_tables
({
'
dbId
'
:
$scope
.
databaseId
}).
$promise
;
yield
Promise
.
all
(
tables
.
map
(
Promise
.
coroutine
(
function
*
(
table
)
{
$scope
.
tables
[
table
.
id
]
=
yield
Metabase
.
table_query_metadata
({
'
tableId
'
:
table
.
id
,
'
include_sensitive_fields
'
:
true
}).
$promise
;
computeMetadataStrength
(
$scope
.
tables
[
table
.
id
]);
})));
var
result
=
yield
Metabase
.
db_idfields
({
'
dbId
'
:
$scope
.
databaseId
}).
$promise
;
if
(
result
&&
!
result
.
error
)
{
$scope
.
idfields
=
result
.
map
(
function
(
field
)
{
field
.
displayName
=
field
.
table
.
display_name
+
"
→
"
+
field
.
display_name
;
return
field
;
});
}
else
{
console
.
warn
(
result
);
}
$timeout
(()
=>
$scope
.
$digest
());
}
catch
(
error
)
{
console
.
warn
(
"
error loading tables
"
,
error
)
}
$timeout
(()
=>
$scope
.
$digest
());
}
catch
(
error
)
{
console
.
warn
(
"
error loading tables
"
,
error
)
}
}),
true
);
...
...
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