Explorar o código

feat(playlist): renames timespan to interval

bergquist %!s(int64=10) %!d(string=hai) anos
pai
achega
e8786b0747

+ 1 - 1
pkg/api/playlist.go

@@ -60,7 +60,7 @@ func GetPlaylist(c *middleware.Context) Response {
 	dto := &m.PlaylistDTO{
 	dto := &m.PlaylistDTO{
 		Id:       cmd.Result.Id,
 		Id:       cmd.Result.Id,
 		Title:    cmd.Result.Title,
 		Title:    cmd.Result.Title,
-		Timespan: cmd.Result.Timespan,
+		Interval: cmd.Result.Interval,
 		OrgId:    cmd.Result.OrgId,
 		OrgId:    cmd.Result.OrgId,
 		Items:    playlistDTOs,
 		Items:    playlistDTOs,
 	}
 	}

+ 4 - 4
pkg/models/playlist.go

@@ -14,14 +14,14 @@ var (
 type Playlist struct {
 type Playlist struct {
 	Id       int64  `json:"id"`
 	Id       int64  `json:"id"`
 	Title    string `json:"title"`
 	Title    string `json:"title"`
-	Timespan string `json:"timespan"`
+	Interval string `json:"interval"`
 	OrgId    int64  `json:"-"`
 	OrgId    int64  `json:"-"`
 }
 }
 
 
 type PlaylistDTO struct {
 type PlaylistDTO struct {
 	Id       int64             `json:"id"`
 	Id       int64             `json:"id"`
 	Title    string            `json:"title"`
 	Title    string            `json:"title"`
-	Timespan string            `json:"timespan"`
+	Interval string            `json:"interval"`
 	OrgId    int64             `json:"-"`
 	OrgId    int64             `json:"-"`
 	Items    []PlaylistItemDTO `json:"items"`
 	Items    []PlaylistItemDTO `json:"items"`
 }
 }
@@ -83,7 +83,7 @@ type UpdatePlaylistQuery struct {
 	Id       int64
 	Id       int64
 	Title    string
 	Title    string
 	Type     string
 	Type     string
-	Timespan string
+	Interval string
 	Items    []PlaylistItemDTO
 	Items    []PlaylistItemDTO
 
 
 	Result *PlaylistDTO
 	Result *PlaylistDTO
@@ -92,7 +92,7 @@ type UpdatePlaylistQuery struct {
 type CreatePlaylistQuery struct {
 type CreatePlaylistQuery struct {
 	Title    string
 	Title    string
 	Type     string
 	Type     string
-	Timespan string
+	Interval string
 	Data     []int64
 	Data     []int64
 	OrgId    int64
 	OrgId    int64
 	Items    []PlaylistItemDTO
 	Items    []PlaylistItemDTO

+ 1 - 1
pkg/services/sqlstore/migrations/playlist_mig.go

@@ -8,7 +8,7 @@ func addPlaylistMigrations(mg *Migrator) {
 		Columns: []*Column{
 		Columns: []*Column{
 			{Name: "id", Type: DB_BigInt, IsPrimaryKey: true, IsAutoIncrement: true},
 			{Name: "id", Type: DB_BigInt, IsPrimaryKey: true, IsAutoIncrement: true},
 			{Name: "title", Type: DB_NVarchar, Length: 255, Nullable: false},
 			{Name: "title", Type: DB_NVarchar, Length: 255, Nullable: false},
-			{Name: "timespan", Type: DB_NVarchar, Length: 255, Nullable: false},
+			{Name: "interval", Type: DB_NVarchar, Length: 255, Nullable: false},
 			{Name: "org_id", Type: DB_BigInt, Nullable: false},
 			{Name: "org_id", Type: DB_BigInt, Nullable: false},
 		},
 		},
 	}
 	}

+ 3 - 3
pkg/services/sqlstore/playlist.go

@@ -23,7 +23,7 @@ func CreatePlaylist(query *m.CreatePlaylistQuery) error {
 
 
 	playlist := m.Playlist{
 	playlist := m.Playlist{
 		Title:    query.Title,
 		Title:    query.Title,
-		Timespan: query.Timespan,
+		Interval: query.Interval,
 		OrgId:    query.OrgId,
 		OrgId:    query.OrgId,
 	}
 	}
 
 
@@ -54,7 +54,7 @@ func UpdatePlaylist(query *m.UpdatePlaylistQuery) error {
 	playlist := m.Playlist{
 	playlist := m.Playlist{
 		Id:       query.Id,
 		Id:       query.Id,
 		Title:    query.Title,
 		Title:    query.Title,
-		Timespan: query.Timespan,
+		Interval: query.Interval,
 	}
 	}
 
 
 	existingPlaylist := x.Where("id = ?", query.Id).Find(m.Playlist{})
 	existingPlaylist := x.Where("id = ?", query.Id).Find(m.Playlist{})
@@ -67,7 +67,7 @@ func UpdatePlaylist(query *m.UpdatePlaylistQuery) error {
 		Id:       playlist.Id,
 		Id:       playlist.Id,
 		OrgId:    playlist.OrgId,
 		OrgId:    playlist.OrgId,
 		Title:    playlist.Title,
 		Title:    playlist.Title,
-		Timespan: playlist.Timespan,
+		Interval: playlist.Interval,
 	}
 	}
 
 
 	_, err = x.Id(query.Id).Cols("id", "title", "timespan").Update(&playlist)
 	_, err = x.Id(query.Id).Cols("id", "title", "timespan").Update(&playlist)

+ 0 - 1
public/app/features/dashboard/all.js

@@ -11,7 +11,6 @@ define([
   './dashboardSrv',
   './dashboardSrv',
   './keybindings',
   './keybindings',
   './viewStateSrv',
   './viewStateSrv',
-  './playlistSrv',
   './timeSrv',
   './timeSrv',
   './unsavedChangesSrv',
   './unsavedChangesSrv',
   './directives/dashSearchView',
   './directives/dashSearchView',

+ 1 - 0
public/app/features/playlist/all.js

@@ -1,5 +1,6 @@
 define([
 define([
   './playlists_ctrl',
   './playlists_ctrl',
+  './playlistSrv',
   './playlist_edit_ctrl',
   './playlist_edit_ctrl',
   './playlist_routes'
   './playlist_routes'
 ], function () {});
 ], function () {});

+ 1 - 1
public/app/features/playlist/partials/playlist.html

@@ -26,7 +26,7 @@
               <strong>Interval</strong>
               <strong>Interval</strong>
             </li>
             </li>
             <li>
             <li>
-              <input type="text" required ng-model="playlist.timespan" placeholder="5m" class="input-xlarge tight-form-input">
+              <input type="text" required ng-model="playlist.interval" placeholder="5m" class="input-xlarge tight-form-input">
             </li>
             </li>
           </ul>
           </ul>
           <div class="clearfix"></div>
           <div class="clearfix"></div>

+ 2 - 2
public/app/features/playlist/playlistSrv.js

@@ -28,11 +28,11 @@ function (angular, _, kbn) {
       self.next();
       self.next();
     };
     };
 
 
-    this.start = function(dashboards, timespan) {
+    this.start = function(dashboards, interval) {
       self.stop();
       self.stop();
 
 
       self.index = 0;
       self.index = 0;
-      self.interval = kbn.interval_to_ms(timespan);
+      self.interval = kbn.interval_to_ms(interval);
 
 
       self.dashboards = dashboards;
       self.dashboards = dashboards;
       $rootScope.playlistSrv = this;
       $rootScope.playlistSrv = this;