mirror of https://github.com/grafana/grafana
AngularJS: Move angular stuff into app/angular (#41415)
* Moving more angular parts * Moving more angular stuff * Moving components * Move more thingspull/41257/head^2
parent
54de1078c8
commit
d07fa0ce5e
@ -1,5 +1,5 @@ |
||||
import { debounce, find, indexOf, map, isObject, escape, unescape } from 'lodash'; |
||||
import coreModule from '../../core_module'; |
||||
import coreModule from '../../../core/core_module'; |
||||
import { ISCEService } from 'angular'; |
||||
import { promiseToDigest } from 'app/core/utils/promiseToDigest'; |
||||
|
@ -1,7 +1,7 @@ |
||||
import { debounce, each, map, partial, escape, unescape } from 'lodash'; |
||||
import $ from 'jquery'; |
||||
import coreModule from 'app/core/core_module'; |
||||
import { promiseToDigest } from '../../utils/promiseToDigest'; |
||||
import { promiseToDigest } from '../../core/utils/promiseToDigest'; |
||||
|
||||
const template = ` |
||||
<div class="dropdown cascade-open"> |
@ -1,6 +1,6 @@ |
||||
import { isArray, isNull, isObject, isUndefined } from 'lodash'; |
||||
import angular from 'angular'; |
||||
import coreModule from '../core_module'; |
||||
import coreModule from '../../core/core_module'; |
||||
import { getTemplateSrv, TemplateSrv } from 'app/features/templating/template_srv'; |
||||
import { dateTime } from '@grafana/data'; |
||||
|
@ -0,0 +1,33 @@ |
||||
import './panel/all'; |
||||
import './partials'; |
||||
import './filters/filters'; |
||||
import './services/alert_srv'; |
||||
import './services/dynamic_directive_srv'; |
||||
import './services/ng_react'; |
||||
import './services/segment_srv'; |
||||
import './services/popover_srv'; |
||||
import './services/timer'; |
||||
import './dropdown_typeahead'; |
||||
import './autofill_event_fix'; |
||||
import './metric_segment'; |
||||
import './misc'; |
||||
import './ng_model_on_blur'; |
||||
import './tags'; |
||||
import './rebuild_on_change'; |
||||
import './give_focus'; |
||||
import './diff-view'; |
||||
import './array_join'; |
||||
import './angular_wrappers'; |
||||
|
||||
// components
|
||||
import './components/query_part_editor'; |
||||
import './components/form_dropdown/form_dropdown'; |
||||
import './components/scroll'; |
||||
import './components/jsontree'; |
||||
import './components/switch'; |
||||
import './components/info_popover'; |
||||
import './components/spectrum_picker'; |
||||
import './components/code_editor/code_editor'; |
||||
import './components/sql_part/sql_part_editor'; |
||||
|
||||
export { AngularApp } from './AngularApp'; |
@ -1,9 +0,0 @@ |
||||
import './alert_srv'; |
||||
import './util_srv'; |
||||
import './context_srv'; |
||||
import './timer'; |
||||
import './analytics'; |
||||
import './popover_srv'; |
||||
import './segment_srv'; |
||||
import './backend_srv'; |
||||
import './dynamic_directive_srv'; |
@ -1,5 +1,5 @@ |
||||
import angular from 'angular'; |
||||
import coreModule from '../core_module'; |
||||
import coreModule from '../../core/core_module'; |
||||
|
||||
class DynamicDirectiveSrv { |
||||
/** @ngInject */ |
@ -1,5 +1,5 @@ |
||||
import { each, isString, map } from 'lodash'; |
||||
import coreModule from '../core_module'; |
||||
import coreModule from '../../core/core_module'; |
||||
|
||||
/** @ngInject */ |
||||
export function uiSegmentSrv(this: any, $sce: any, templateSrv: any) { |
@ -1,36 +0,0 @@ |
||||
import coreModule from 'app/core/core_module'; |
||||
import { backendSrv } from '../services/backend_srv'; |
||||
|
||||
const template = ` |
||||
<select class="gf-form-input" ng-model="ctrl.model" ng-options="f.value as f.text for f in ctrl.options"></select> |
||||
`;
|
||||
|
||||
export class DashboardSelectorCtrl { |
||||
model: any; |
||||
options: any; |
||||
|
||||
$onInit() { |
||||
this.options = [{ value: 0, text: 'Default' }]; |
||||
|
||||
return backendSrv.search({ starred: true }).then((res) => { |
||||
res.forEach((dash) => { |
||||
this.options.push({ value: dash.id, text: dash.title }); |
||||
}); |
||||
}); |
||||
} |
||||
} |
||||
|
||||
export function dashboardSelector() { |
||||
return { |
||||
restrict: 'E', |
||||
controller: DashboardSelectorCtrl, |
||||
bindToController: true, |
||||
controllerAs: 'ctrl', |
||||
template: template, |
||||
scope: { |
||||
model: '=', |
||||
}, |
||||
}; |
||||
} |
||||
|
||||
coreModule.directive('dashboardSelector', dashboardSelector); |
@ -1,61 +1,24 @@ |
||||
import '../angular/dropdown_typeahead'; |
||||
import '../angular/autofill_event_fix'; |
||||
import '../angular/metric_segment'; |
||||
import '../angular/misc'; |
||||
import '../angular/ng_model_on_blur'; |
||||
import '../angular/tags'; |
||||
import '../angular/rebuild_on_change'; |
||||
import '../angular/give_focus'; |
||||
import '../angular/diff-view'; |
||||
import './jquery_extended'; |
||||
import './components/jsontree/jsontree'; |
||||
import './components/code_editor/code_editor'; |
||||
import './components/colorpicker/spectrum_picker'; |
||||
import './services/search_srv'; |
||||
import './services/ng_react'; |
||||
import { colors, JsonExplorer } from '@grafana/ui/'; |
||||
|
||||
import { infoPopover } from './components/info_popover'; |
||||
import { arrayJoin } from '../angular/array_join'; |
||||
import { switchDirective } from './components/switch'; |
||||
import { dashboardSelector } from './components/dashboard_selector'; |
||||
import { queryPartEditorDirective } from './components/query_part/query_part_editor'; |
||||
import { sqlPartEditorDirective } from './components/sql_part/sql_part_editor'; |
||||
import { formDropdownDirective } from './components/form_dropdown/form_dropdown'; |
||||
import 'app/core/services/all'; |
||||
import './filters/filters'; |
||||
import coreModule from './core_module'; |
||||
import appEvents from './app_events'; |
||||
import { assignModelProperties } from './utils/model_utils'; |
||||
import { contextSrv } from './services/context_srv'; |
||||
import { KeybindingSrv } from './services/keybindingSrv'; |
||||
import { NavModelSrv } from './nav_model_srv'; |
||||
import { geminiScrollbar } from './components/scroll/scroll'; |
||||
import { profiler } from './profiler'; |
||||
import { registerAngularDirectives } from './angular_wrappers'; |
||||
import TimeSeries, { updateLegendValues } from './time_series2'; |
||||
import { NavModel } from '@grafana/data'; |
||||
|
||||
export { |
||||
profiler, |
||||
registerAngularDirectives, |
||||
arrayJoin, |
||||
coreModule, |
||||
switchDirective, |
||||
infoPopover, |
||||
appEvents, |
||||
dashboardSelector, |
||||
queryPartEditorDirective, |
||||
sqlPartEditorDirective, |
||||
colors, |
||||
formDropdownDirective, |
||||
assignModelProperties, |
||||
contextSrv, |
||||
KeybindingSrv, |
||||
JsonExplorer, |
||||
NavModelSrv, |
||||
NavModel, |
||||
geminiScrollbar, |
||||
TimeSeries, |
||||
updateLegendValues, |
||||
}; |
||||
|
Loading…
Reference in new issue