Icu 9020 move connection channel sorting to model (#217)
* test: 💍 add tests for sorted connection and channels * feat: 🎸 Add sorted property for connections and channels ✅ Closes: ICU-9020
This commit is contained in:
1 parent
05830925d5
commit
1717968e59
6 files changed
+61
-17
No files matched your search
@@ -1,7 +1,12 @@
|
||||
import GeneratedConnectionRecordingModel from '../generated/models/connection-recording';
|
||||
import { belongsTo, hasMany } from '@ember-data/model';
|
||||
import { sort } from '@ember/object/computed';
|
||||
|
||||
export default class ConnectionRecordingModel extends GeneratedConnectionRecordingModel {
|
||||
@belongsTo('session-recording', { async: false }) session_recording;
|
||||
@hasMany('channel-recording', { async: false }) channel_recordings;
|
||||
|
||||
startTimeSortingDesc = ['start_time:desc'];
|
||||
@sort('channel_recordings', 'startTimeSortingDesc')
|
||||
sortedChannelsByStartTimeDesc;
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
import GeneratedSessionRecordingModel from '../generated/models/session-recording';
|
||||
import { hasMany } from '@ember-data/model';
|
||||
import { inject as service } from '@ember/service';
|
||||
import { sort } from '@ember/object/computed';
|
||||
|
||||
export const TYPE_SESSION_RECORDING_SSH = 'ssh';
|
||||
export const TYPES_SESSION_RECORDING = Object.freeze([
|
||||
@@ -12,6 +13,10 @@ export default class SessionRecordingModel extends GeneratedSessionRecordingMode
|
||||
|
||||
@service store;
|
||||
|
||||
startTimeSortingDesc = ['start_time:desc'];
|
||||
@sort('connection_recordings', 'startTimeSortingDesc')
|
||||
sortedConnectionsByStartTimeDesc;
|
||||
|
||||
/**
|
||||
* True if the session recording type is `ssh`.
|
||||
* @type {boolean}
|
||||
|
||||
Reference in new issue
Block a user