mirror of
https://github.com/grafana/grafana.git
synced 2024-11-25 10:20:29 -06:00
Angular cleanup: Move directives (#35330)
* angular2react: Remove json_editor_ctrl * angular2react: Move directives * Add to angular dir
This commit is contained in:
parent
8a0cef9954
commit
5e7df4cf6a
@ -1,5 +1,5 @@
|
||||
import { isArray } from 'lodash';
|
||||
import coreModule from '../core_module';
|
||||
import coreModule from '../core/core_module';
|
||||
|
||||
export function arrayJoin() {
|
||||
'use strict';
|
@ -1,4 +1,4 @@
|
||||
import coreModule from '../core_module';
|
||||
import coreModule from '../core/core_module';
|
||||
|
||||
/** @ngInject */
|
||||
export function autofillEventFix($compile: any) {
|
@ -1,5 +1,5 @@
|
||||
import angular from 'angular';
|
||||
import coreModule from '../core_module';
|
||||
import coreModule from '../core/core_module';
|
||||
import { GrafanaRootScope } from 'app/routes/GrafanaCtrl';
|
||||
|
||||
export class DeltaCtrl {
|
@ -1,6 +1,6 @@
|
||||
import { each, reduce } from 'lodash';
|
||||
import $ from 'jquery';
|
||||
import coreModule from '../core_module';
|
||||
import coreModule from '../core/core_module';
|
||||
|
||||
/** @ngInject */
|
||||
export function dropdownTypeahead($compile: any) {
|
@ -1,4 +1,4 @@
|
||||
import coreModule from '../core_module';
|
||||
import coreModule from '../core/core_module';
|
||||
|
||||
coreModule.directive('giveFocus', () => {
|
||||
return (scope: any, element: any, attrs: any) => {
|
@ -1,6 +1,6 @@
|
||||
import { debounce, find, indexOf, map, escape, unescape } from 'lodash';
|
||||
import $ from 'jquery';
|
||||
import coreModule from '../core_module';
|
||||
import coreModule from '../core/core_module';
|
||||
import { TemplateSrv } from 'app/features/templating/template_srv';
|
||||
|
||||
/** @ngInject */
|
@ -1,6 +1,6 @@
|
||||
import angular from 'angular';
|
||||
import Clipboard from 'clipboard';
|
||||
import coreModule from '../core_module';
|
||||
import coreModule from '../core/core_module';
|
||||
import kbn from 'app/core/utils/kbn';
|
||||
import { appEvents } from 'app/core/core';
|
||||
import { AppEvents } from '@grafana/data';
|
@ -1,4 +1,4 @@
|
||||
import coreModule from '../core_module';
|
||||
import coreModule from '../core/core_module';
|
||||
import { rangeUtil } from '@grafana/data';
|
||||
|
||||
function ngModelOnBlur() {
|
@ -1,5 +1,5 @@
|
||||
import $ from 'jquery';
|
||||
import coreModule from '../core_module';
|
||||
import coreModule from '../core/core_module';
|
||||
|
||||
function getBlockNodes(nodes: any[]) {
|
||||
let node = nodes[0];
|
9
public/app/angular/services.ts
Normal file
9
public/app/angular/services.ts
Normal file
@ -0,0 +1,9 @@
|
||||
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,7 +1,7 @@
|
||||
import angular from 'angular';
|
||||
import { getTagColorsFromName } from '@grafana/ui';
|
||||
import $ from 'jquery';
|
||||
import coreModule from '../core_module';
|
||||
import coreModule from '../core/core_module';
|
||||
import 'vendor/tagsinput/bootstrap-tagsinput.js';
|
||||
|
||||
function setColor(name: string, element: JQuery) {
|
@ -1 +0,0 @@
|
||||
import './json_editor_ctrl';
|
@ -1,20 +0,0 @@
|
||||
import angular from 'angular';
|
||||
import coreModule from '../core_module';
|
||||
|
||||
export class JsonEditorCtrl {
|
||||
/** @ngInject */
|
||||
constructor($scope: any) {
|
||||
$scope.json = angular.toJson($scope.model.object, true);
|
||||
$scope.canUpdate = $scope.model.updateHandler !== void 0 && $scope.model.canUpdate;
|
||||
$scope.canCopy = $scope.model.enableCopy;
|
||||
|
||||
$scope.update = () => {
|
||||
const newObject = angular.fromJson($scope.json);
|
||||
$scope.model.updateHandler(newObject, $scope.model.object);
|
||||
};
|
||||
|
||||
$scope.getContentForClipboard = () => $scope.json;
|
||||
}
|
||||
}
|
||||
|
||||
coreModule.controller('JsonEditorCtrl', JsonEditorCtrl);
|
@ -1,12 +1,12 @@
|
||||
import './directives/dropdown_typeahead';
|
||||
import './directives/autofill_event_fix';
|
||||
import './directives/metric_segment';
|
||||
import './directives/misc';
|
||||
import './directives/ng_model_on_blur';
|
||||
import './directives/tags';
|
||||
import './directives/rebuild_on_change';
|
||||
import './directives/give_focus';
|
||||
import './directives/diff-view';
|
||||
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 './partials';
|
||||
import './components/jsontree/jsontree';
|
||||
@ -17,13 +17,12 @@ import './services/ng_react';
|
||||
import { colors, JsonExplorer } from '@grafana/ui/';
|
||||
|
||||
import { infoPopover } from './components/info_popover';
|
||||
import { arrayJoin } from './directives/array_join';
|
||||
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/controllers/all';
|
||||
import 'app/core/services/all';
|
||||
import './filters/filters';
|
||||
import coreModule from './core_module';
|
||||
|
Loading…
Reference in New Issue
Block a user