From d07fa0ce5ecaec0ec1fea190a7dbd163c8d0346a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Mon, 8 Nov 2021 18:41:04 +0100 Subject: [PATCH] AngularJS: Move angular stuff into app/angular (#41415) * Moving more angular parts * Moving more angular stuff * Moving components * Move more things --- public/app/angular/AngularApp.ts | 9 ++--- .../app/{core => angular}/angular_wrappers.ts | 12 +++--- .../components/code_editor/brace.d.ts | 0 .../components/code_editor/code_editor.ts | 0 .../code_editor/theme-grafana-dark.js | 0 .../components/form_dropdown/form_dropdown.ts | 2 +- .../components/info_popover.ts | 0 .../components}/jsontree.ts | 0 .../components}/query_part.ts | 0 .../components}/query_part_editor.ts | 2 +- .../scroll => angular/components}/scroll.ts | 0 .../components}/spectrum_picker.ts | 2 +- .../components/sql_part/sql_part.ts | 0 .../components/sql_part/sql_part_editor.ts | 0 .../{core => angular}/components/switch.ts | 0 .../app/{core => angular}/filters/filters.ts | 2 +- public/app/angular/index.ts | 33 +++++++++++++++++ .../{core => angular}/injectorMonkeyPatch.ts | 0 public/app/angular/services.ts | 9 ----- .../{core => angular}/services/alert_srv.ts | 0 .../services/dynamic_directive_srv.ts | 2 +- .../services}/nav_model_srv.ts | 0 .../{core => angular}/services/ng_react.ts | 0 .../{core => angular}/services/popover_srv.ts | 0 .../{core => angular}/services/segment_srv.ts | 2 +- .../app/{core => angular}/services/timer.ts | 0 public/app/app.ts | 2 +- .../app/core/components/dashboard_selector.ts | 36 ------------------ public/app/core/core.ts | 37 ------------------- public/app/core/hooks/useNavModel.ts | 2 +- public/app/core/services/all.ts | 5 --- public/app/core/services/search_srv.ts | 1 - public/app/features/alerting/AlertTabCtrl.ts | 2 +- .../app/features/alerting/state/alertDef.ts | 2 +- public/app/features/org/UserInvitePage.tsx | 3 +- public/app/features/plugins/AppRootPage.tsx | 2 +- public/app/features/plugins/PluginPage.tsx | 2 +- .../app/features/plugins/plugin_page_ctrl.ts | 2 +- .../VisualInfluxQLEditor/partListUtils.tsx | 2 +- .../plugins/datasource/influxdb/query_part.ts | 2 +- .../plugins/datasource/mysql/query_ctrl.ts | 2 +- .../app/plugins/datasource/mysql/sql_part.ts | 2 +- .../plugins/datasource/postgres/query_ctrl.ts | 2 +- .../plugins/datasource/postgres/sql_part.ts | 2 +- 44 files changed, 64 insertions(+), 119 deletions(-) rename public/app/{core => angular}/angular_wrappers.ts (94%) rename public/app/{core => angular}/components/code_editor/brace.d.ts (100%) rename public/app/{core => angular}/components/code_editor/code_editor.ts (100%) rename public/app/{core => angular}/components/code_editor/theme-grafana-dark.js (100%) rename public/app/{core => angular}/components/form_dropdown/form_dropdown.ts (99%) rename public/app/{core => angular}/components/info_popover.ts (100%) rename public/app/{core/components/jsontree => angular/components}/jsontree.ts (100%) rename public/app/{core/components/query_part => angular/components}/query_part.ts (100%) rename public/app/{core/components/query_part => angular/components}/query_part_editor.ts (98%) rename public/app/{core/components/scroll => angular/components}/scroll.ts (100%) rename public/app/{core/components/colorpicker => angular/components}/spectrum_picker.ts (93%) rename public/app/{core => angular}/components/sql_part/sql_part.ts (100%) rename public/app/{core => angular}/components/sql_part/sql_part_editor.ts (100%) rename public/app/{core => angular}/components/switch.ts (100%) rename public/app/{core => angular}/filters/filters.ts (96%) create mode 100644 public/app/angular/index.ts rename public/app/{core => angular}/injectorMonkeyPatch.ts (100%) delete mode 100644 public/app/angular/services.ts rename public/app/{core => angular}/services/alert_srv.ts (100%) rename public/app/{core => angular}/services/dynamic_directive_srv.ts (96%) rename public/app/{core => angular/services}/nav_model_srv.ts (100%) rename public/app/{core => angular}/services/ng_react.ts (100%) rename public/app/{core => angular}/services/popover_srv.ts (100%) rename public/app/{core => angular}/services/segment_srv.ts (98%) rename public/app/{core => angular}/services/timer.ts (100%) delete mode 100644 public/app/core/components/dashboard_selector.ts diff --git a/public/app/angular/AngularApp.ts b/public/app/angular/AngularApp.ts index 7eadf7e83ef..7fab2829548 100644 --- a/public/app/angular/AngularApp.ts +++ b/public/app/angular/AngularApp.ts @@ -7,14 +7,13 @@ import 'vendor/angular-other/angular-strap'; import { config } from 'app/core/config'; import coreModule, { angularModules } from 'app/core/core_module'; import { DashboardLoaderSrv } from 'app/features/dashboard/services/DashboardLoaderSrv'; -import { registerAngularDirectives } from 'app/core/core'; -import { initAngularRoutingBridge } from 'app/angular/bridgeReactAngularRouting'; -import { monkeyPatchInjectorWithPreAssignedBindings } from 'app/core/injectorMonkeyPatch'; +import { registerAngularDirectives } from './angular_wrappers'; +import { initAngularRoutingBridge } from './bridgeReactAngularRouting'; +import { monkeyPatchInjectorWithPreAssignedBindings } from './injectorMonkeyPatch'; import { extend } from 'lodash'; import { getTimeSrv } from 'app/features/dashboard/services/TimeSrv'; import { getTemplateSrv } from '@grafana/runtime'; -import './panel/all'; -import './partials'; + export class AngularApp { ngModuleDependencies: any[]; preBootModules: any[]; diff --git a/public/app/core/angular_wrappers.ts b/public/app/angular/angular_wrappers.ts similarity index 94% rename from public/app/core/angular_wrappers.ts rename to public/app/angular/angular_wrappers.ts index e225e7afa79..c678704635e 100644 --- a/public/app/core/angular_wrappers.ts +++ b/public/app/angular/angular_wrappers.ts @@ -2,10 +2,10 @@ import { react2AngularDirective } from 'app/core/utils/react2angular'; import { QueryEditor as CloudMonitoringQueryEditor } from 'app/plugins/datasource/cloud-monitoring/components/QueryEditor'; import { AnnotationQueryEditor as CloudMonitoringAnnotationQueryEditor } from 'app/plugins/datasource/cloud-monitoring/components/AnnotationQueryEditor'; import { AnnotationQueryEditor as CloudWatchAnnotationQueryEditor } from 'app/plugins/datasource/cloudwatch/components/AnnotationQueryEditor'; -import PageHeader from './components/PageHeader/PageHeader'; -import EmptyListCTA from './components/EmptyListCTA/EmptyListCTA'; -import { TagFilter } from './components/TagFilter/TagFilter'; -import { MetricSelect } from './components/Select/MetricSelect'; +import PageHeader from '../core/components/PageHeader/PageHeader'; +import EmptyListCTA from '../core/components/EmptyListCTA/EmptyListCTA'; +import { TagFilter } from '../core/components/TagFilter/TagFilter'; +import { MetricSelect } from '../core/components/Select/MetricSelect'; import { ColorPicker, DataLinksInlineEditor, @@ -18,8 +18,8 @@ import { UnitPicker, } from '@grafana/ui'; import { LokiAnnotationsQueryEditor } from '../plugins/datasource/loki/components/AnnotationsQueryEditor'; -import { HelpModal } from './components/help/HelpModal'; -import { Footer } from './components/Footer/Footer'; +import { HelpModal } from '../core/components/help/HelpModal'; +import { Footer } from '../core/components/Footer/Footer'; import { FolderPicker } from 'app/core/components/Select/FolderPicker'; import { SearchField, SearchResults, SearchResultsFilter } from '../features/search'; import { TimePickerSettings } from 'app/features/dashboard/components/DashboardSettings/TimePickerSettings'; diff --git a/public/app/core/components/code_editor/brace.d.ts b/public/app/angular/components/code_editor/brace.d.ts similarity index 100% rename from public/app/core/components/code_editor/brace.d.ts rename to public/app/angular/components/code_editor/brace.d.ts diff --git a/public/app/core/components/code_editor/code_editor.ts b/public/app/angular/components/code_editor/code_editor.ts similarity index 100% rename from public/app/core/components/code_editor/code_editor.ts rename to public/app/angular/components/code_editor/code_editor.ts diff --git a/public/app/core/components/code_editor/theme-grafana-dark.js b/public/app/angular/components/code_editor/theme-grafana-dark.js similarity index 100% rename from public/app/core/components/code_editor/theme-grafana-dark.js rename to public/app/angular/components/code_editor/theme-grafana-dark.js diff --git a/public/app/core/components/form_dropdown/form_dropdown.ts b/public/app/angular/components/form_dropdown/form_dropdown.ts similarity index 99% rename from public/app/core/components/form_dropdown/form_dropdown.ts rename to public/app/angular/components/form_dropdown/form_dropdown.ts index 915fe57f08c..fbe0107a7b0 100644 --- a/public/app/core/components/form_dropdown/form_dropdown.ts +++ b/public/app/angular/components/form_dropdown/form_dropdown.ts @@ -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'; diff --git a/public/app/core/components/info_popover.ts b/public/app/angular/components/info_popover.ts similarity index 100% rename from public/app/core/components/info_popover.ts rename to public/app/angular/components/info_popover.ts diff --git a/public/app/core/components/jsontree/jsontree.ts b/public/app/angular/components/jsontree.ts similarity index 100% rename from public/app/core/components/jsontree/jsontree.ts rename to public/app/angular/components/jsontree.ts diff --git a/public/app/core/components/query_part/query_part.ts b/public/app/angular/components/query_part.ts similarity index 100% rename from public/app/core/components/query_part/query_part.ts rename to public/app/angular/components/query_part.ts diff --git a/public/app/core/components/query_part/query_part_editor.ts b/public/app/angular/components/query_part_editor.ts similarity index 98% rename from public/app/core/components/query_part/query_part_editor.ts rename to public/app/angular/components/query_part_editor.ts index 97d886a9fda..9f0c350e287 100644 --- a/public/app/core/components/query_part/query_part_editor.ts +++ b/public/app/angular/components/query_part_editor.ts @@ -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 = `