mirror of
https://github.com/grafana/grafana.git
synced 2024-11-29 20:24:18 -06:00
feat(impressionStore): remove un needed js-ts bridge
This commit is contained in:
parent
e5970e83ff
commit
b79217be1e
@ -16,5 +16,5 @@ define([
|
||||
'./graphiteImportCtrl',
|
||||
'./dynamicDashboardSrv',
|
||||
'./importCtrl',
|
||||
'./impressions',
|
||||
'./impressionStore',
|
||||
], function () {});
|
||||
|
@ -5,9 +5,9 @@ define([
|
||||
'jquery',
|
||||
'app/core/utils/kbn',
|
||||
'app/core/utils/datemath',
|
||||
'./impressions',
|
||||
'./impressionStore',
|
||||
],
|
||||
function (angular, moment, _, $, kbn, dateMath, impressions) {
|
||||
function (angular, moment, _, $, kbn, dateMath, impressionStore) {
|
||||
'use strict';
|
||||
|
||||
var module = angular.module('grafana.services');
|
||||
@ -41,7 +41,7 @@ function (angular, moment, _, $, kbn, dateMath, impressions) {
|
||||
}
|
||||
|
||||
promise.then(function(result) {
|
||||
impressions.addImpression(slug);
|
||||
impressionStore.impressions.addDashboardImpression(slug);
|
||||
return result;
|
||||
});
|
||||
|
||||
|
@ -3,10 +3,10 @@
|
||||
import store from 'app/core/store';
|
||||
import _ from 'lodash';
|
||||
|
||||
export class Impressions {
|
||||
export class ImpressionsStore {
|
||||
constructor() {}
|
||||
|
||||
addImpression(slug) {
|
||||
addDashboardImpression(slug) {
|
||||
var impressions = [];
|
||||
if (store.exists("dashboard_impressions")) {
|
||||
impressions = JSON.parse(store.get("dashboard_impressions"));
|
||||
@ -28,13 +28,13 @@ export class Impressions {
|
||||
store.set("dashboard_impressions", JSON.stringify(impressions));
|
||||
}
|
||||
|
||||
getImpressions() {
|
||||
getDashboardOpened() {
|
||||
var k = store.get("dashboard_impressions");
|
||||
return JSON.parse(k);
|
||||
}
|
||||
}
|
||||
|
||||
var impressions = new Impressions();
|
||||
var impressions = new ImpressionsStore();
|
||||
|
||||
export {
|
||||
impressions
|
@ -1,7 +0,0 @@
|
||||
define([
|
||||
'./impressions2'
|
||||
], function(impressions) {
|
||||
'use strict';
|
||||
// backward compatability hack;
|
||||
return impressions.impressions;
|
||||
});
|
@ -3,7 +3,7 @@
|
||||
import _ from 'lodash';
|
||||
import config from 'app/core/config';
|
||||
import {PanelCtrl} from 'app/plugins/sdk';
|
||||
import {impressions} from 'app/features/dashboard/impressions2';
|
||||
import {impressions} from 'app/features/dashboard/impressionStore';
|
||||
|
||||
// Set and populate defaults
|
||||
var panelDefaults = {
|
||||
@ -43,7 +43,7 @@ class DashListCtrl extends PanelCtrl {
|
||||
var params: any = {limit: this.panel.limit};
|
||||
|
||||
if (this.panel.mode === 'last viewed') {
|
||||
var dashListNames = _.first(impressions.getImpressions(), this.panel.limit).map((dashboard) => {
|
||||
var dashListNames = _.first(impressions.getDashboardOpened(), this.panel.limit).map((dashboard) => {
|
||||
return {
|
||||
title: dashboard,
|
||||
uri: 'db/' + dashboard
|
||||
|
Loading…
Reference in New Issue
Block a user