Skip to content

Commit

Permalink
refactor(*) get rid of globaly injected api (#206)
Browse files Browse the repository at this point in the history
Signed-off-by: Tomasz Wylężek <tomwylezek@gmail.com>
  • Loading branch information
tomaszwylezek committed Aug 17, 2021
1 parent 70829c6 commit 514ff2d
Show file tree
Hide file tree
Showing 27 changed files with 153 additions and 333 deletions.
4 changes: 2 additions & 2 deletions src/dataplane.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,8 @@ export function getDataplaneInsight(dataplaneOverview: DataPlaneOverview) {
}
}

export async function checkKumaDpAndZoneVersionsMismatch(api: Kuma, zoneName: string, dpVersion: string) {
const response = (await api.getZoneOverview(zoneName)) || {}
export async function checkKumaDpAndZoneVersionsMismatch(zoneName: string, dpVersion: string) {
const response = (await Kuma.getZoneOverview(zoneName)) || {}
const { zoneInsight = {} } = response
const { subscriptions = [] } = zoneInsight

Expand Down
7 changes: 1 addition & 6 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,7 @@ am4core.useTheme(am4themesAnimated)

/** the app itself */
function VUE_APP() {
const kuma = new Kuma()

// setup the HTTP API namespace
Vue.prototype.$api = kuma

const store = new Vuex.Store(Store(kuma))
const store = new Vuex.Store(Store())
const router = Router(store)

new Vue({
Expand Down
146 changes: 0 additions & 146 deletions src/mixins/ChartDataController.js

This file was deleted.

4 changes: 3 additions & 1 deletion src/services/kuma.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import RestClient from '@/services/restClient'

export default class Kuma {
class Kuma {
private client: RestClient

public constructor() {
Expand Down Expand Up @@ -399,3 +399,5 @@ export default class Kuma {
return this.client.get('/versions', { params })
}
}

export default new Kuma()
Loading

0 comments on commit 514ff2d

Please sign in to comment.