Skip to content

Commit

Permalink
refactor: import all @/services/* where used
Browse files Browse the repository at this point in the history
  • Loading branch information
arildm committed Aug 28, 2024
1 parent 28c060d commit 3537684
Show file tree
Hide file tree
Showing 20 changed files with 27 additions and 8 deletions.
5 changes: 0 additions & 5 deletions app/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,6 @@ require("./scripts/controllers/word_picture_controller")
require("./scripts/map_controllers.js")
require("./scripts/text_reader_controller.js")
require("./scripts/video_controllers.js")
require("./scripts/services/backend")
require("./scripts/services/compare-searches")
require("./scripts/services/lexicons")
require("./scripts/services/searches")
require("./scripts/services/utils")
require("./scripts/extended.js")
require("./scripts/struct_services.js")
require("./scripts/filter_directives.js")
Expand Down
1 change: 1 addition & 0 deletions app/scripts/components/advanced-search.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/** @format */
import angular from "angular"
import { html } from "@/util"
import "@/services/compare-searches"
import "@/directives/search-submit"

angular.module("korpApp").component("advancedSearch", {
Expand Down
1 change: 1 addition & 0 deletions app/scripts/components/autoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import angular from "angular"
import settings from "@/settings"
import { html, lemgramToString, saldoToString } from "@/util"
import { loc } from "@/i18n"
import "@/services/lexicons"
import "@/directives/typeahead-click-open"

angular.module("korpApp").component("autoc", {
Expand Down
2 changes: 2 additions & 0 deletions app/scripts/components/compare-search.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
import angular from "angular"
import _ from "lodash"
import settings from "@/settings"
import "@/services/backend"
import "@/services/compare-searches"
import { html, valfilter } from "@/util"

angular.module("korpApp").component("compareSearch", {
Expand Down
1 change: 1 addition & 0 deletions app/scripts/components/extended/extended-parallel.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import _ from "lodash"
import settings from "@/settings"
import { expandOperators } from "@/cqp_parser/cqp"
import { html } from "@/util"
import "@/services/searches"
import "@/components/extended/tokens"

angular.module("korpApp").component("extendedParallel", {
Expand Down
1 change: 1 addition & 0 deletions app/scripts/components/extended/extended-standard.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import statemachine from "@/statemachine"
import settings from "@/settings"
import { expandOperators, mergeCqpExprs, parse, stringify, supportsInOrder } from "@/cqp_parser/cqp"
import { html } from "@/util"
import "@/services/compare-searches"
import "@/components/extended/tokens"
import "@/directives/search-submit"

Expand Down
7 changes: 4 additions & 3 deletions app/scripts/components/frontpage.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
/** @format */
import angular from "angular"
import settings from "@/settings"
import { RootScope } from "@/root-scope.types"
import { SearchesService } from "@/services/searches"
import { html } from "@/util"
import { isEnabled } from "@/news-service"
import "@/services/searches"
import "@/components/corpus-updates"
import "@/components/newsdesk"
import "@/components/search-examples"
import settings from "@/settings"
import { RootScope } from "@/root-scope.types"
import { SearchesService } from "@/services/searches"

export default angular.module("korpApp").component("frontpage", {
template: html`
Expand Down
1 change: 1 addition & 0 deletions app/scripts/components/header.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import guLogo from "../../img/gu_logo_sv_head.svg"
import settings from "@/settings"
import currentMode from "@/mode"
import { collatorSort, html } from "@/util"
import "@/services/utils"
import "@/components/corpus_chooser/corpus-chooser"
import "@/components/radio-list"
import "@/directives/popper"
Expand Down
1 change: 1 addition & 0 deletions app/scripts/components/results.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/** @format */
import angular from "angular"
import { html } from "@/util"
import "@/services/searches"
import "@/components/dynamic_tabs/compare-tabs"
import "@/components/dynamic_tabs/graph-tabs"
import "@/components/dynamic_tabs/kwic-tabs"
Expand Down
2 changes: 2 additions & 0 deletions app/scripts/components/searchtabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import angular from "angular"
import _ from "lodash"
import settings from "@/settings"
import { html } from "@/util"
import "@/services/compare-searches"
import "@/services/searches"
import "@/components/simple-search"
import "@/components/extended/extended-standard"
import "@/components/extended/extended-parallel"
Expand Down
1 change: 1 addition & 0 deletions app/scripts/components/sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import settings from "@/settings"
import { stringify } from "@/stringify.js"
import { html, regescape, splitLemgram, safeApply } from "@/util"
import { loc, locAttribute } from "@/i18n"
import "@/services/utils"
import "@/components/deptree/deptree"

let sidebarComponents = {}
Expand Down
3 changes: 3 additions & 0 deletions app/scripts/components/simple-search.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import statemachine from "@/statemachine"
import settings from "@/settings"
import { expandOperators, mergeCqpExprs, parse, stringify, supportsInOrder } from "@/cqp_parser/cqp"
import { html, regescape, saldoToHtml, unregescape } from "@/util"
import "@/services/compare-searches"
import "@/services/lexicons"
import "@/services/searches"
import "@/components/autoc"
import "@/directives/search-submit"

Expand Down
2 changes: 2 additions & 0 deletions app/scripts/components/statistics.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import { html } from "@/util"
import { loc, locObj } from "@/i18n"
import { getCqp } from "../../config/statistics_config.js"
import { expandOperators } from "@/cqp_parser/cqp"
import "@/services/backend"
import "@/services/searches"
import "@/components/corpus-distribution-chart"

angular.module("korpApp").component("statistics", {
Expand Down
1 change: 1 addition & 0 deletions app/scripts/controllers/example_controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { KwicTab, RootScope } from "@/root-scope.types"
import { KorpResponse, ProgressReport } from "@/backend/types"
import { KorpQueryResponse } from "@/backend/kwic-proxy"
import { UtilsService } from "@/services/utils"
import "@/services/utils"

const korpApp = angular.module("korpApp")

Expand Down
1 change: 1 addition & 0 deletions app/scripts/controllers/kwic_controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { RootScope } from "@/root-scope.types"
import { LocationService } from "@/urlparams"
import { KorpResponse, ProgressReport } from "@/backend/types"
import { UtilsService } from "@/services/utils"
import "@/services/utils"

angular.module("korpApp").directive("kwicCtrl", () => ({ controller: KwicCtrl }))

Expand Down
1 change: 1 addition & 0 deletions app/scripts/controllers/statistics_controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { Dataset } from "@/statistics_worker"
import { SearchParams } from "@/statistics.types"
import { SlickgridColumn } from "@/statistics"
import { SearchesService } from "@/services/searches"
import "@/services/searches"

type StatsResultCtrlScope = IScope & {
$parent: any
Expand Down
1 change: 1 addition & 0 deletions app/scripts/controllers/word_picture_controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { LocationService } from "@/urlparams"
import { KorpResponse, ProgressReport } from "@/backend/types"
import { WordPictureDefItem } from "@/settings/app-settings.types"
import { SearchesService } from "@/services/searches"
import "@/services/searches"

type WordpicCtrlScope = IScope & {
$parent: any
Expand Down
1 change: 1 addition & 0 deletions app/scripts/directives/tab-hash.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import _ from "lodash"
import angular, { IScope, ITimeoutService } from "angular"
import { UtilsService } from "@/services/utils"
import { LocationService } from "@/urlparams"
import "@/services/utils"

type TabHashScope = IScope & {
activeTab: number
Expand Down
1 change: 1 addition & 0 deletions app/scripts/services/backend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { httpConfAddMethod, httpConfAddMethodAngular } from "@/util"
import { KorpStatsResponse, normalizeStatsData } from "@/backend/stats-proxy"
import { MapResult, parseMapData } from "@/map_services"
import { KorpQueryResponse } from "@/backend/kwic-proxy"
import "@/services/lexicons"

export type BackendService = {
requestCompare: (cmpObj1: SavedSearch, cmpObj2: SavedSearch, reduce: string[]) => IPromise<CompareResult>
Expand Down
1 change: 1 addition & 0 deletions app/scripts/text_reader_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import _ from "lodash"
import statemachine from "./statemachine"
import settings from "@/settings"
import "@/services/backend"
import "@/components/readingmode"

const korpApp = angular.module("korpApp")
Expand Down

0 comments on commit 3537684

Please sign in to comment.