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
c0540a6b
Commit
c0540a6b
authored
9 years ago
by
Allen Gilliland
Browse files
Options
Downloads
Patches
Plain Diff
remove old ace editor directive which is no longer used.
parent
4c5965da
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
resources/frontend_client/app/card/card.module.js
+0
-1
0 additions, 1 deletion
resources/frontend_client/app/card/card.module.js
resources/frontend_client/app/directives.js
+0
-66
0 additions, 66 deletions
resources/frontend_client/app/directives.js
with
0 additions
and
67 deletions
resources/frontend_client/app/card/card.module.js
+
0
−
1
View file @
c0540a6b
...
...
@@ -7,7 +7,6 @@ var Card = angular.module('metabase.card', [
'
metabase.filters
'
,
'
metabase.directives
'
,
'
metabase.services
'
,
'
metabase.aceeditor.directives
'
,
'
metabase.card.services
'
,
'
metabase.card.controllers
'
,
'
metabase.card.directives
'
...
...
This diff is collapsed.
Click to expand it.
resources/frontend_client/app/directives.js
+
0
−
66
View file @
c0540a6b
'
use strict
'
;
/*global ace*/
import
{
Provider
}
from
'
react-redux
'
;
import
{
DevTools
,
DebugPanel
}
from
'
redux-devtools/lib/react
'
;
...
...
@@ -232,67 +230,3 @@ NavbarDirectives.directive('mbProfileLink', [function () {
},
};
}]);
var
MetabaseACEEditorDirectives
=
angular
.
module
(
'
metabase.aceeditor.directives
'
,
[
'
ui.ace
'
]);
MetabaseACEEditorDirectives
.
directive
(
'
mbAceSqlEditor
'
,
function
()
{
function
controller
(
$scope
,
Metabase
)
{
$scope
.
aceLoaded
=
function
(
aceEditor
)
{
if
(
$scope
.
onLoad
)
{
var
fn
=
$scope
.
onLoad
();
if
(
fn
)
fn
(
aceEditor
);
}
var
aceLanguageTools
=
ace
.
require
(
'
ace/ext/language_tools
'
);
aceEditor
.
setOptions
({
enableBasicAutocompletion
:
true
,
enableSnippets
:
true
,
enableLiveAutocompletion
:
true
});
aceLanguageTools
.
addCompleter
({
getCompletions
:
function
(
editor
,
session
,
pos
,
prefix
,
callback
)
{
if
(
prefix
.
lengh
===
0
||
!
$scope
.
database
)
{
console
.
log
(
"
$scope.database is not set, unable to perform autocompletions for ACE Editor :'(
"
);
callback
(
null
,
[]);
return
;
}
Metabase
.
db_autocomplete_suggestions
({
dbId
:
$scope
.
database
,
prefix
:
prefix
},
function
(
results
)
{
// transform results of the API call into what ACE expects
var
js_results
=
results
.
map
(
function
(
result
)
{
return
{
name
:
result
[
0
],
value
:
result
[
0
],
meta
:
result
[
1
]
};
});
callback
(
null
,
js_results
);
},
function
(
error
)
{
console
.
log
(
error
);
callback
(
null
,
[]);
});
}
});
// focus the editor on load to allow faster editing of query
aceEditor
.
focus
();
};
}
return
{
restrict
:
'
E
'
,
templateUrl
:
'
/app/components/editor/editor.html
'
,
controller
:
[
'
$scope
'
,
'
Metabase
'
,
controller
],
scope
:
{
sql
:
'
=
'
,
// the text of the editor itself
database
:
'
=
'
,
// int ID of DB to use for autocompletion
onLoad
:
'
&onload
'
// optional callback of the form fn(aceEditor) in case we need a reference to it (e.g. so we can aceEditor.focus())
}
};
});
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