diff --git a/app/adapters/device-preference.ts b/app/adapters/device-preference.ts deleted file mode 100644 index bac35352d..000000000 --- a/app/adapters/device-preference.ts +++ /dev/null @@ -1,14 +0,0 @@ -import commondrf from './commondrf'; - -export default class DevicePreferenceAdapter extends commondrf { - urlForQueryRecord(q: { id: string }) { - const url = `${this.namespace}/profiles/${q.id}/device_preference`; - return this.buildURLFromBase(url); - } -} - -declare module 'ember-data/types/registries/adapter' { - export default interface AdapterRegistry { - 'device-preference': DevicePreferenceAdapter; - } -} diff --git a/app/adapters/dynamicscan-mode.ts b/app/adapters/dynamicscan-mode.ts deleted file mode 100644 index e96e47031..000000000 --- a/app/adapters/dynamicscan-mode.ts +++ /dev/null @@ -1,15 +0,0 @@ -import commondrf from './commondrf'; - -export default class DynamicscanModeAdapter extends commondrf { - urlForQueryRecord(q: { id: string }) { - const url = `${this.namespace}/profiles/${q.id}/dynamicscan_mode`; - - return this.buildURLFromBase(url); - } -} - -declare module 'ember-data/types/registries/adapter' { - export default interface AdapterRegistry { - 'dynamicscan-mode': DynamicscanModeAdapter; - } -} diff --git a/app/adapters/dynamicscan-old.ts b/app/adapters/dynamicscan-old.ts deleted file mode 100644 index 55cd0af69..000000000 --- a/app/adapters/dynamicscan-old.ts +++ /dev/null @@ -1,31 +0,0 @@ -import DynamicscanOldModel from 'irene/models/dynamicscan-old'; -import commondrf from './commondrf'; - -export default class DynamicscanOldAdapter extends commondrf { - _buildURL(_: string | null, id: string | number) { - const baseurl = `${this.namespace}/dynamicscan`; - - if (id) { - return this.buildURLFromBase(`${baseurl}/${encodeURIComponent(id)}`); - } - - return this.buildURLFromBase(baseurl); - } - - extendTime(snapshot: DynamicscanOldModel, time: number) { - const id = snapshot.id; - const modelName = 'dynamicscan'; - - const url = this.buildURL(modelName, id) + '/extend'; - - return this.ajax(url, 'POST', { - data: { time }, - }); - } -} - -declare module 'ember-data/types/registries/adapter' { - export default interface AdapterRegistry { - 'dynamicscan-old': DynamicscanOldAdapter; - } -} diff --git a/app/adapters/project-available-device.ts b/app/adapters/project-available-device.ts index 6ea05f001..561663ac4 100644 --- a/app/adapters/project-available-device.ts +++ b/app/adapters/project-available-device.ts @@ -2,8 +2,8 @@ import commondrf from './commondrf'; interface ProjectAvailableDevicesQueryObj { projectId: string | number; - manualDevices?: boolean; } + export default class ProjectAvailableDeviceAdapter extends commondrf { _buildURL( modelName: string | number, @@ -23,37 +23,13 @@ export default class ProjectAvailableDeviceAdapter extends commondrf { modelName: string | number, query: ProjectAvailableDevicesQueryObj ) { - let url = ''; - - if (query.manualDevices) { - url = this.getAvailableManualDevicesURL(query); - - delete query.manualDevices; - } else { - const projectURL = this._buildURL(modelName, query.projectId); - url = [projectURL, 'available-devices'].join('/'); - } - - return url; - } - - urlForQuery( - query: ProjectAvailableDevicesQueryObj, - modelName: K - ) { - return this._buildNestedURL(modelName, query); - } - - getAvailableManualDevicesURL(query: ProjectAvailableDevicesQueryObj) { const projectURL = this._buildURL( 'project', query.projectId, this.namespace_v2 ); - const url = projectURL + '/available_manual_devices'; - - return url; + return projectURL + '/available_manual_devices'; } } diff --git a/app/components/file-details/dynamic-scan/drawer-old/index.hbs b/app/components/file-details/dynamic-scan/drawer-old/index.hbs deleted file mode 100644 index beaaf110e..000000000 --- a/app/components/file-details/dynamic-scan/drawer-old/index.hbs +++ /dev/null @@ -1,237 +0,0 @@ - - - - - - {{t 'modalCard.dynamicScan.title'}} - - - - - - - -
- - - - - {{t 'modalCard.dynamicScan.warning'}} - - - - {{#if @file.minOsVersion}} -
- - {{t 'modalCard.dynamicScan.deviceRequirements'}} - - - - {{#each this.deviceRequirements as |dr|}} - - - {{dr.type}} - - - - - {{dr.boldValue}} - - - {{dr.value}} - - - {{/each}} - -
- {{/if}} - -
- -
- - {{#unless @file.showScheduleAutomatedDynamicScan}} - - {{t 'note'}}: - {{t 'modalCard.dynamicScan.deviceSettingsWarning'}} - - {{/unless}} - -
- -
- -
- - - - - - - {{#if this.showApiScanSettings}} -
- - {{t 'modalCard.dynamicScan.apiScanDescription' htmlSafe=true}} - - - - - -
- {{/if}} - - {{#if @file.showScheduleAutomatedDynamicScan}} -
- - - {{t 'dynamicScanAutomation'}} - - - - <:icon> - - - - - - - {{t 'scheduleDynamicscanDesc'}} - - - - - <:leftIcon> - {{#if this.scheduleDynamicScan.isRunning}} - - {{else}} - - {{/if}} - - - <:default> - {{t 'scheduleDynamicscan'}} - - - -
- {{/if}} -
-
-
- - - - {{t 'cancel'}} - - - - {{t 'modalCard.dynamicScan.start'}} - - -
-
\ No newline at end of file diff --git a/app/components/file-details/dynamic-scan/drawer-old/index.scss b/app/components/file-details/dynamic-scan/drawer-old/index.scss deleted file mode 100644 index 8f439f493..000000000 --- a/app/components/file-details/dynamic-scan/drawer-old/index.scss +++ /dev/null @@ -1,37 +0,0 @@ -.dynamic-scan-drawer-alert { - background-color: var( - --file-details-dynamic-scan-drawer-old-alert-background-color - ); - color: var(--file-details-dynamic-scan-drawer-old-alert-text-color); - border: 1px solid - var(--file-details-dynamic-scan-drawer-old-alert-border-color); - border-radius: var(--file-details-dynamic-scan-drawer-old-border-radius); -} - -.device-settings-warning { - color: var( - --file-details-dynamic-scan-drawer-old-device-settings-warning-text-color - ); - line-height: 1.3; -} - -.bordered-box { - border: 1px solid var(--file-details-dynamic-scan-drawer-old-border-color); - border-radius: var(--file-details-dynamic-scan-drawer-old-border-radius); - box-sizing: border-box; - - .bordered-box-item { - padding: 0.5em 1em; - - &:not(:last-child) { - border-bottom: 1px solid - var(--file-details-dynamic-scan-drawer-old-border-color); - } - } -} - -.dynamic-scan-drawer-cta { - border-top: 1px solid var(--file-details-dynamic-scan-drawer-border-color); - background-color: var(--file-details-dynamic-scan-drawer-background-main); - box-shadow: var(--file-details-dynamic-scan-drawer-cta-box-shadow); -} diff --git a/app/components/file-details/dynamic-scan/drawer-old/index.ts b/app/components/file-details/dynamic-scan/drawer-old/index.ts deleted file mode 100644 index 3793ed6bd..000000000 --- a/app/components/file-details/dynamic-scan/drawer-old/index.ts +++ /dev/null @@ -1,240 +0,0 @@ -import Component from '@glimmer/component'; -import { inject as service } from '@ember/service'; -import { task } from 'ember-concurrency'; -import { action } from '@ember/object'; -import IntlService from 'ember-intl/services/intl'; -import Store from '@ember-data/store'; -import { tracked } from '@glimmer/tracking'; - -import ENV from 'irene/config/environment'; -import ENUMS from 'irene/enums'; -import triggerAnalytics from 'irene/utils/trigger-analytics'; -import type FileModel from 'irene/models/file'; -import type { DevicePreferenceContext } from 'irene/components/project-preferences-old/provider'; - -export interface FileDetailsDynamicScanDrawerOldSignature { - Args: { - onClose: () => void; - pollDynamicStatus: () => void; - file: FileModel; - dpContext: DevicePreferenceContext; - }; -} - -export default class FileDetailsDynamicScanDrawerOldComponent extends Component { - @service declare intl: IntlService; - @service declare ajax: any; - @service declare store: Store; - @service('browser/window') declare window: Window; - @service('notifications') declare notify: NotificationService; - - @tracked showApiScanSettings = false; - @tracked isApiScanEnabled = false; - - get tStartingScan() { - return this.intl.t('startingScan'); - } - - get devicePrefContext() { - return this.args.dpContext; - } - - get tScheduleDynamicscanSuccess() { - return this.intl.t('scheduleDynamicscanSuccess'); - } - - get tPleaseTryAgain() { - return this.intl.t('pleaseTryAgain'); - } - - get projectPlatform() { - return this.args.file.project.get('platform'); - } - - get profileId() { - return this.args.file.profile.get('id'); - } - - get deviceRequirements() { - const file = this.args.file; - - return [ - { - type: this.intl.t('modalCard.dynamicScan.osVersion'), - boldValue: `${file.project.get('platformDisplay')} ${ - file.minOsVersion - } `, - value: this.intl.t('modalCard.dynamicScan.orAbove'), - }, - file.supportedCpuArchitectures && { - type: this.intl.t('modalCard.dynamicScan.processorArchitecture'), - boldValue: file.supportedCpuArchitectures, - }, - file.supportedDeviceTypes && { - type: this.intl.t('modalCard.dynamicScan.deviceTypes'), - boldValue: file.supportedDeviceTypes, - }, - ].filter(Boolean) as { type: string; boldValue: string; value?: string }[]; - } - - @action - enableApiScan(event: Event, checked: boolean) { - this.showApiScanSettings = checked; - this.isApiScanEnabled = !!checked; - } - - startDynamicScan = task(async () => { - try { - const data = { - isApiScanEnabled: this.isApiScanEnabled === true, - }; - - const file = this.args.file; - const dynamicUrl = [ENV.endpoints['dynamic'], file.id].join('/'); - - await this.ajax.put(dynamicUrl, { data }); - - this.args.onClose(); - - file.setBootingStatus(); - - this.args.pollDynamicStatus(); - - this.notify.success(this.tStartingScan); - } catch (error) { - const err = error as AdapterError; - let errMsg = this.tPleaseTryAgain; - - if (err.errors && err.errors.length) { - errMsg = err.errors[0]?.detail || errMsg; - } else if (err.payload.message) { - errMsg = err.payload.message; - } else if (err.message) { - errMsg = err.message; - } - - this.notify.error(errMsg); - - this.args.file.setDynamicStatusNone(); - } - }); - - scheduleDynamicScan = task({ drop: true }, async () => { - try { - const file = this.args.file; - - const scheduleAutomationUrl = [ - ENV.endpoints['dynamic'], - file.id, - ENV.endpoints['scheduleDynamicscanAutomation'], - ].join('/'); - - await this.ajax.post(scheduleAutomationUrl, { - data: { id: file.id }, - }); - - file.setInQueueStatus(); - - this.args.onClose(); - - this.notify.success(this.tScheduleDynamicscanSuccess, { - clearDuration: 5000, - }); - } catch (e) { - const err = e as AdapterError; - let errMsg = this.tPleaseTryAgain; - - if (err.payload) { - Object.keys(err.payload).forEach((p) => { - errMsg = err.payload[p]; - if (typeof errMsg !== 'string') { - errMsg = err.payload[p][0]; - } - - this.notify.error(errMsg); - }); - - return; - } else if (err.errors && err.errors.length) { - errMsg = err.errors[0]?.detail || errMsg; - } else if (err.message) { - errMsg = err.message; - } - - this.notify.error(errMsg); - } - }); - - get currentDevicePref() { - return { - device_type: this.devicePrefContext.selectedDeviceType?.value, - platform_version: this.devicePrefContext.selectedVersion, - }; - } - - get deviceTypeIsAny() { - return ( - this.currentDevicePref.device_type === ENUMS.DEVICE_TYPE.NO_PREFERENCE - ); - } - - get devicePlatformVersionIsAny() { - return this.currentDevicePref.platform_version === '0'; - } - - @action - pickRandomItemFromList(list: T[]) { - return list[Math.floor(Math.random() * list.length)]; // NOSONAR - } - - @action - runDynamicScan() { - if (this.deviceTypeIsAny || this.devicePlatformVersionIsAny) { - this.saveDevicePrefToLocalStorage.perform(); - } - - triggerAnalytics( - 'feature', - ENV.csb['runDynamicScan'] as CsbAnalyticsFeatureData - ); - - this.startDynamicScan.perform(); - } - - saveDevicePrefToLocalStorage = task(async () => { - const modifiedDevicePref = { ...this.currentDevicePref }; - - if (this.deviceTypeIsAny) { - modifiedDevicePref.device_type = ENUMS.DEVICE_TYPE.PHONE_REQUIRED; - } - - if ( - this.devicePlatformVersionIsAny && - this.devicePrefContext.filteredDevices?.length - ) { - const randomDevice = this.pickRandomItemFromList( - this.devicePrefContext.filteredDevices - ); - - modifiedDevicePref.platform_version = - randomDevice?.platformVersion as string; - } - - this.window.localStorage.setItem( - 'actualDevicePrefData', - JSON.stringify({ ...this.currentDevicePref, file_id: this.args.file.id }) - ); - - this.devicePrefContext.updateDevicePref( - modifiedDevicePref.device_type, - modifiedDevicePref.platform_version, - true - ); - }); -} - -declare module '@glint/environment-ember-loose/registry' { - export default interface Registry { - 'FileDetails::DynamicScan::DrawerOld': typeof FileDetailsDynamicScanDrawerOldComponent; - } -} diff --git a/app/components/file-details/dynamic-scan/drawer-old/proxy-settings-view/index.hbs b/app/components/file-details/dynamic-scan/drawer-old/proxy-settings-view/index.hbs deleted file mode 100644 index 7a8c4cfbb..000000000 --- a/app/components/file-details/dynamic-scan/drawer-old/proxy-settings-view/index.hbs +++ /dev/null @@ -1,51 +0,0 @@ -{{#if this.proxy.hasProxyUrl}} - - - - - {{t 'enable'}} - {{t 'proxySettingsTitle'}} - - - - - - - {{t 'edit'}} - - - - - {{t 'proxySettingsRouteVia'}} - {{this.proxy.host}}:{{this.proxy.port}} - - -{{/if}} \ No newline at end of file diff --git a/app/components/file-details/dynamic-scan/drawer-old/proxy-settings-view/index.scss b/app/components/file-details/dynamic-scan/drawer-old/proxy-settings-view/index.scss deleted file mode 100644 index 4ed742f9b..000000000 --- a/app/components/file-details/dynamic-scan/drawer-old/proxy-settings-view/index.scss +++ /dev/null @@ -1,11 +0,0 @@ -.bordered-box { - border: 1px solid - var(--file-details-dynamic-scan-drawer-old-proxy-settings-view-border-color); - padding: 1.25em; - box-sizing: border-box; -} - -.api-proxy-toggle { - margin-left: 0; - margin-right: 0; -} diff --git a/app/components/file-details/dynamic-scan/drawer-old/proxy-settings-view/index.ts b/app/components/file-details/dynamic-scan/drawer-old/proxy-settings-view/index.ts deleted file mode 100644 index bf5c9c49d..000000000 --- a/app/components/file-details/dynamic-scan/drawer-old/proxy-settings-view/index.ts +++ /dev/null @@ -1,85 +0,0 @@ -import Component from '@glimmer/component'; -import ENV from 'irene/config/environment'; -import triggerAnalytics from 'irene/utils/trigger-analytics'; -import { inject as service } from '@ember/service'; -import { task } from 'ember-concurrency'; -import { tracked } from '@glimmer/tracking'; -import type IntlService from 'ember-intl/services/intl'; -import type Store from '@ember-data/store'; -import type { AsyncBelongsTo } from '@ember-data/model'; - -import type ProxySettingModel from 'irene/models/proxy-setting'; -import type ProfileModel from 'irene/models/profile'; -import type ProjectModel from 'irene/models/project'; -import parseError from 'irene/utils/parse-error'; - -export interface FileDetailsDynamicScanDrawerOldProxySettingsViewSignature { - Args: { - profile: AsyncBelongsTo; - project: AsyncBelongsTo; - }; -} - -export default class FileDetailsDynamicScanDrawerOldProxySettingsViewComponent extends Component { - @service declare intl: IntlService; - @service('notifications') declare notify: NotificationService; - @service declare store: Store; - - @tracked proxy?: ProxySettingModel; - - constructor( - owner: unknown, - args: FileDetailsDynamicScanDrawerOldProxySettingsViewSignature['Args'] - ) { - super(owner, args); - - this.fetchProxySetting.perform(); - } - - get projectId() { - return this.args.project.get('id'); - } - - fetchProxySetting = task(async () => { - try { - const profileId = this.args.profile.get('id'); - - if (profileId) { - this.proxy = await this.store.findRecord('proxy-setting', profileId); - } - } catch (error) { - this.notify.error(parseError(error, this.intl.t('somethingWentWrong'))); - } - }); - - /* Proxy enable or disable */ - toggleProxy = task(async (event) => { - try { - const enabled = event.target.checked; - - this.proxy?.set('enabled', enabled); - - await this.proxy?.save(); - - const statusText = enabled ? this.intl.t('on') : this.intl.t('off'); - - this.notify.info( - `${this.intl.t('proxyTurned')} ${statusText.toUpperCase()}` - ); - - const analyticsData = enabled - ? ENV.csb['enableProxy'] - : ENV.csb['disableProxy']; - - triggerAnalytics('feature', analyticsData as CsbAnalyticsFeatureData); - } catch (error) { - this.notify.error(parseError(error, this.intl.t('pleaseTryAgain'))); - } - }); -} - -declare module '@glint/environment-ember-loose/registry' { - export default interface Registry { - 'FileDetails::DynamicScan::DrawerOld::ProxySettingsView': typeof FileDetailsDynamicScanDrawerOldProxySettingsViewComponent; - } -} diff --git a/app/components/file-details/dynamic-scan/expiry-old/index.hbs b/app/components/file-details/dynamic-scan/expiry-old/index.hbs deleted file mode 100644 index 922b7627b..000000000 --- a/app/components/file-details/dynamic-scan/expiry-old/index.hbs +++ /dev/null @@ -1,69 +0,0 @@ -
- - - - - - - - - {{this.timeRemaining.minutes}}:{{this.timeRemaining.seconds}} - - - {{#if this.extendtime.isRunning}} - - {{else}} - - - - - - {{/if}} - - - - {{#each this.extendTimeOptions as |time|}} - - - - {{/each}} - -
\ No newline at end of file diff --git a/app/components/file-details/dynamic-scan/expiry-old/index.scss b/app/components/file-details/dynamic-scan/expiry-old/index.scss deleted file mode 100644 index 0cc114d6e..000000000 --- a/app/components/file-details/dynamic-scan/expiry-old/index.scss +++ /dev/null @@ -1,26 +0,0 @@ -.extend-time-btn { - border-radius: 50%; - background-color: var( - --file-details-dynamic-scan-action-expiry-extend-btn-background - ) !important; - padding: 0 !important; - - :global(.ak-icon) { - color: var( - --file-details-dynamic-scan-action-expiry-extend-btn-icon-color - ) !important; - } -} - -.dynamic-scan-expiry-container { - background-color: var( - --file-details-dynamic-scan-action-expiry-container-background-color - ); - padding: 0.3em 1em; - border-radius: 200px; -} - -.info-btn { - border-radius: 50%; - margin-right: 0.5em; -} diff --git a/app/components/file-details/dynamic-scan/expiry-old/index.ts b/app/components/file-details/dynamic-scan/expiry-old/index.ts deleted file mode 100644 index d47c002f2..000000000 --- a/app/components/file-details/dynamic-scan/expiry-old/index.ts +++ /dev/null @@ -1,158 +0,0 @@ -import Component from '@glimmer/component'; -import { action } from '@ember/object'; -import { tracked } from '@glimmer/tracking'; -import { inject as service } from '@ember/service'; -import { task, timeout } from 'ember-concurrency'; -import dayjs from 'dayjs'; -import Store from '@ember-data/store'; -import FileModel from 'irene/models/file'; -import DatetimeService from 'irene/services/datetime'; -import { Duration } from 'dayjs/plugin/duration'; -import DynamicscanOldModel from 'irene/models/dynamicscan-old'; -import ENV from 'irene/config/environment'; -import parseError from 'irene/utils/parse-error'; - -export interface FileDetailsDynamicScanExpiryOldSignature { - Args: { - file: FileModel; - }; -} - -export default class FileDetailsDynamicScanExpiryOldComponent extends Component { - @service('notifications') declare notify: NotificationService; - @service declare store: Store; - @service declare datetime: DatetimeService; - - @tracked dynamicscan: DynamicscanOldModel | null = null; - @tracked durationRemaining: null | Duration = null; - @tracked extendBtnAnchorRef: HTMLElement | null = null; - - constructor( - owner: unknown, - args: FileDetailsDynamicScanExpiryOldSignature['Args'] - ) { - super(owner, args); - - this.fetchDynamicscan.perform(); - } - - get extendTimeOptions() { - return [5, 15, 30]; - } - - get canExtend() { - const duration = this.durationRemaining; - - if (!duration) { - return false; - } - - return duration.asMinutes() < 15; - } - - get timeRemaining() { - const duration = this.durationRemaining; - - if (!duration) { - return { - seconds: '00', - minutes: '00', - }; - } - - return { - seconds: ('0' + duration.seconds()).slice(-2), - minutes: ('0' + Math.floor(duration.asMinutes())).slice(-2), - }; - } - - @action - setScanDuration(expiresOn: Date | null) { - if (!expiresOn) { - this.durationRemaining = null; - - return; - } - - const mExpiresOn = dayjs(expiresOn); - const mNow = dayjs(Date.now()); - const duration = this.datetime.duration(mExpiresOn.diff(mNow)); - - this.durationRemaining = duration; - } - - @action - handleExtendTimeClick(event: MouseEvent) { - this.extendBtnAnchorRef = event.currentTarget as HTMLElement; - } - - @action - handleExtendTimeMenuClose() { - this.extendBtnAnchorRef = null; - } - - clock = task(async () => { - while (Number(this.durationRemaining?.asSeconds()) > -1) { - if (ENV.environment === 'test') { - break; - } - - const expiresOn = this.dynamicscan ? this.dynamicscan.expiresOn : null; - - this.setScanDuration(expiresOn); - - await timeout(1000); - } - }); - - extendtime = task(async (time: number) => { - const dynamicscan = this.dynamicscan; - - if (!dynamicscan) { - return; - } - - this.handleExtendTimeMenuClose(); - - try { - await dynamicscan.extendTime(time); - } catch (error) { - const err = error as AdapterError; - - if (err.errors && err.errors[0]?.detail) { - this.notify.error(err.errors[0].detail); - - return; - } - - throw err; - } - - await this.fetchDynamicscan.perform(); - }); - - fetchDynamicscan = task(async () => { - try { - const id = this.args.file.id; - const dynamicscan = await this.store.findRecord('dynamicscan-old', id); - const expiresOn = dynamicscan ? dynamicscan.expiresOn : null; - - // Necessary to ensure correct time is updated in store cache before clock is started - // If not reloaded, timer starts with cached timer before store updates record with new details - await dynamicscan?.reload(); - - this.dynamicscan = dynamicscan; - - this.setScanDuration(expiresOn); - this.clock.perform(); - } catch (error) { - this.notify.error(parseError(error)); - } - }); -} - -declare module '@glint/environment-ember-loose/registry' { - export default interface Registry { - 'FileDetails::DynamicScan::ExpiryOld': typeof FileDetailsDynamicScanExpiryOldComponent; - } -} diff --git a/app/components/file-details/scan-actions-old/manual-scan/index.scss b/app/components/file-details/scan-actions-old/manual-scan/index.scss deleted file mode 100644 index 6f9e591d4..000000000 --- a/app/components/file-details/scan-actions-old/manual-scan/index.scss +++ /dev/null @@ -1,16 +0,0 @@ -.textarea-input { - border: 1px solid - var( - --file-details-scan-actions-old-manual-scan-textarea-border-color - ); - border-radius: var( - --file-details-scan-actions-old-manual-scan-textarea-border-radius - ); - color: var(--file-details-scan-actions-old-manual-scan-textarea-color); - display: inline-flex; - justify-content: flex-start; - align-items: center; - padding: 0.75em; - max-width: 100%; - width: 100%; -} \ No newline at end of file diff --git a/app/components/project-preferences-old/device-preference/index.hbs b/app/components/project-preferences-old/device-preference/index.hbs deleted file mode 100644 index 1a74d33de..000000000 --- a/app/components/project-preferences-old/device-preference/index.hbs +++ /dev/null @@ -1,74 +0,0 @@ - - {{#if (has-block 'title')}} - {{yield to='title'}} - {{else}} - - {{t 'devicePreferences'}} - - {{/if}} - - - {{t 'otherTemplates.selectPreferredDevice'}} - - - - -
- - {{t (device-type aks.value)}} - -
- -
- - {{#if (eq version '0')}} - {{t 'anyVersion'}} - {{else}} - {{version}} - {{/if}} - -
-
- -{{#if this.isPreferredDeviceNotAvailable}} - - - - - {{#if this.minOsVersionUnsupported}} - {{t 'modalCard.dynamicScan.minOSVersionUnsupported'}} - {{else if this.isAllDevicesAllocated}} - {{t 'modalCard.dynamicScan.allDevicesAreAllocated'}} - {{else}} - {{t 'modalCard.dynamicScan.preferredDeviceNotAvailable'}} - {{/if}} - - -{{/if}} \ No newline at end of file diff --git a/app/components/project-preferences-old/device-preference/index.ts b/app/components/project-preferences-old/device-preference/index.ts deleted file mode 100644 index 59531dc82..000000000 --- a/app/components/project-preferences-old/device-preference/index.ts +++ /dev/null @@ -1,64 +0,0 @@ -import Component from '@glimmer/component'; - -import ENUMS from 'irene/enums'; -import type FileModel from 'irene/models/file'; -import type { DevicePreferenceContext } from '../provider'; - -export interface ProjectPreferencesOldDevicePreferenceSignature { - Args: { - file?: FileModel | null; - dpContext: DevicePreferenceContext; - }; - Blocks: { - title: []; - }; -} - -export default class ProjectPreferencesOldDevicePreferenceComponent extends Component { - // TODO: Remove when information is provided from the backend - maxSupportedIOSDeviceVersion = '17'; - maxSupportedAndroidDeviceVersion = '14'; - - get isPreferredDeviceNotAvailable() { - return this.args.dpContext.isPreferredDeviceAvailable === false; - } - - get noDevicePlatformVersions() { - return this.args.dpContext.devicePlatformVersions.length === 1; - } - - get minOsVersionUnsupported() { - const file = this.args.file; - const project = file?.get('project'); - - if (project) { - const platform = project.get('platform'); - - const maxSupportedDeviceVersion = - platform === ENUMS.PLATFORM.IOS - ? this.maxSupportedIOSDeviceVersion - : this.maxSupportedAndroidDeviceVersion; - - return ( - this.noDevicePlatformVersions && - this.args.dpContext.compareVersions( - maxSupportedDeviceVersion, - file?.get('minOsVersion') as string - ) <= 0 - ); - } - - return false; - } - - get isAllDevicesAllocated() { - return this.isPreferredDeviceNotAvailable && this.noDevicePlatformVersions; - } -} - -declare module '@glint/environment-ember-loose/registry' { - export default interface Registry { - 'ProjectPreferencesOld::DevicePreference': typeof ProjectPreferencesOldDevicePreferenceComponent; - 'project-preferences-old/device-preference': typeof ProjectPreferencesOldDevicePreferenceComponent; - } -} diff --git a/app/components/project-preferences-old/index.hbs b/app/components/project-preferences-old/index.hbs deleted file mode 100644 index 5dfda2f85..000000000 --- a/app/components/project-preferences-old/index.hbs +++ /dev/null @@ -1,16 +0,0 @@ - - {{yield - (hash - DevicePreferenceComponent=(component - 'project-preferences-old/device-preference' - file=this.projectLastFile - dpContext=dpContext - ) - ) - }} - \ No newline at end of file diff --git a/app/components/project-preferences-old/index.ts b/app/components/project-preferences-old/index.ts deleted file mode 100644 index 177e53103..000000000 --- a/app/components/project-preferences-old/index.ts +++ /dev/null @@ -1,37 +0,0 @@ -import Component from '@glimmer/component'; -import { WithBoundArgs } from '@glint/template'; - -import ProjectModel from 'irene/models/project'; -import ProjectPreferencesDevicePreferenceComponent from './device-preference'; -import FileModel from 'irene/models/file'; - -export interface ProjectPreferencesOldSignature { - Args: { - file?: FileModel | null; - project?: ProjectModel | null; - profileId?: number | string; - platform?: number; - }; - Blocks: { - default: [ - { - DevicePreferenceComponent: WithBoundArgs< - typeof ProjectPreferencesDevicePreferenceComponent, - 'dpContext' - >; - }, - ]; - }; -} - -export default class ProjectPreferencesOldComponent extends Component { - get projectLastFile() { - return this.args.project?.get('lastFile'); - } -} - -declare module '@glint/environment-ember-loose/registry' { - export default interface Registry { - ProjectPreferencesOld: typeof ProjectPreferencesOldComponent; - } -} diff --git a/app/components/project-preferences-old/provider/index.hbs b/app/components/project-preferences-old/provider/index.hbs deleted file mode 100644 index 5fac49113..000000000 --- a/app/components/project-preferences-old/provider/index.hbs +++ /dev/null @@ -1,14 +0,0 @@ -{{yield - (hash - filteredDevices=this.filteredDevices - deviceTypes=this.filteredDeviceTypes - selectedDeviceType=this.selectedDeviceType - handleSelectDeviceType=this.handleSelectDeviceType - selectedVersion=this.selectedVersion - devicePlatformVersions=this.devicePlatformVersionOptions - handleSelectVersion=this.handleSelectVersion - isPreferredDeviceAvailable=this.isPreferredDeviceAvailable - updateDevicePref=this.updateDevicePref - compareVersions=this.compareVersions - ) -}} \ No newline at end of file diff --git a/app/components/project-preferences-old/provider/index.ts b/app/components/project-preferences-old/provider/index.ts deleted file mode 100644 index 29f92fdca..000000000 --- a/app/components/project-preferences-old/provider/index.ts +++ /dev/null @@ -1,351 +0,0 @@ -import Component from '@glimmer/component'; -import { inject as service } from '@ember/service'; -import IntlService from 'ember-intl/services/intl'; -import { tracked } from '@glimmer/tracking'; -import { action } from '@ember/object'; -import Store from '@ember-data/store'; -import { task } from 'ember-concurrency'; - -// eslint-disable-next-line ember/use-ember-data-rfc-395-imports -import DS from 'ember-data'; - -import ENUMS from 'irene/enums'; -import ENV from 'irene/config/environment'; -import ProjectModel from 'irene/models/project'; -import DevicePreferenceModel from 'irene/models/device-preference'; -import ProjectAvailableDeviceModel from 'irene/models/project-available-device'; -import FileModel from 'irene/models/file'; - -export interface DevicePreferenceContext { - filteredDevices?: ProjectAvailableDeviceModel[]; - deviceTypes: DeviceType[]; - selectedDeviceType?: DeviceType; - handleSelectDeviceType: (deviceType: DeviceType) => void; - selectedVersion: string; - devicePlatformVersions: string[]; - handleSelectVersion: (version: string) => void; - isPreferredDeviceAvailable: boolean | null; - - updateDevicePref( - device_type: string | number | undefined, - platform_version: string, - silentNotifications?: boolean - ): void; - - compareVersions(v1: string, v2: string): number; -} - -export interface ProjectPreferencesOldProviderSignature { - Args: { - file?: FileModel | null; - project?: ProjectModel | null; - profileId?: number | string; - }; - Blocks: { - default: [DevicePreferenceContext]; - }; -} - -type EnumObject = { key: string; value: number | string }; -type DeviceType = EnumObject; - -export default class ProjectPreferencesOldProviderComponent extends Component { - @service declare intl: IntlService; - @service declare ajax: any; - @service('notifications') declare notify: NotificationService; - @service declare store: Store; - - @tracked selectedVersion = '0'; - - @tracked selectedDeviceType?: DeviceType; - - @tracked deviceTypes = ENUMS.DEVICE_TYPE.CHOICES; - @tracked devicePreference?: DevicePreferenceModel; - - @tracked - devices: DS.AdapterPopulatedRecordArray | null = - null; - - constructor( - owner: unknown, - args: ProjectPreferencesOldProviderSignature['Args'] - ) { - super(owner, args); - - this.fetchDevicePreference.perform(); - this.fetchDevices.perform(); - } - - fetchDevicePreference = task(async () => { - try { - this.devicePreference = await this.store.queryRecord( - 'device-preference', - { - id: this.args.profileId, - } - ); - - this.selectedDeviceType = this.deviceTypes.find( - (it) => it.value === this.devicePreference?.deviceType - ); - - this.selectedVersion = this.devicePreference.platformVersion; - } catch (error) { - this.notify.error(this.intl.t('errorFetchingDevicePreferences')); - } - }); - - fetchDevices = task(async () => { - try { - this.devices = await this.store.query('project-available-device', { - projectId: this.args.project?.get('id'), - }); - } catch (error) { - this.notify.error(this.intl.t('errorFetchingDevices')); - } - }); - - get tAnyVersion() { - return this.intl.t('anyVersion'); - } - - get filteredDeviceTypes() { - const supportedTypes = - this.args.file?.supportedDeviceTypes || - this.args.project?.get('lastFile')?.get('supportedDeviceTypes'); - - const platform = this.args.project?.get('platform'); - - return this.deviceTypes.filter((type) => { - switch (type.value) { - // Always filter out unknown device type - case ENUMS.DEVICE_TYPE.UNKNOWN: - return false; - - // Always show "Any Device" option - case ENUMS.DEVICE_TYPE.NO_PREFERENCE: - return true; - - // For iOS, show tablet option only if iPad is supported - case ENUMS.DEVICE_TYPE.TABLET_REQUIRED: - return supportedTypes?.includes('iPad'); - - case ENUMS.DEVICE_TYPE.PHONE_REQUIRED: - // For Android, only show phone options - if (ENUMS.PLATFORM.ANDROID === platform) { - return true; - } - - // For iOS, show phone option only if iPhone is supported - return supportedTypes?.includes('iPhone'); - - default: - return true; - } - }); - } - - get availableDevices() { - return this.devices?.filter( - (d) => d.platform === this.args.project?.get('platform') - ); - } - - get filteredDevices() { - return this.availableDevices?.filter((device) => { - switch (this.selectedDeviceType?.value) { - case ENUMS.DEVICE_TYPE.NO_PREFERENCE: - return true; - - case ENUMS.DEVICE_TYPE.TABLET_REQUIRED: - return device.isTablet; - - case ENUMS.DEVICE_TYPE.PHONE_REQUIRED: - return !device.isTablet; - - default: - return true; - } - }); - } - - get uniqueDevices() { - const devices = this.filteredDevices?.uniqBy('platformVersion'); - - const minOsVersion = - this.args.file?.minOsVersion || - this.args.project?.get('lastFile')?.get('minOsVersion'); - - // Sort the unique devices versions in descending order - const sortedDevices = devices?.sort((a, b) => - this.compareVersions(b.platformVersion, a.platformVersion) - ); - - if (!minOsVersion && sortedDevices) { - return [...sortedDevices]; - } - - return sortedDevices?.filter((d) => { - return ( - this.compareVersions(d.platformVersion, minOsVersion as string) >= 0 - ); - }); - } - - get devicePlatformVersionOptions() { - return ['0', ...(this.uniqueDevices?.map((d) => d.platformVersion) || [])]; - } - - get isPreferredDeviceAvailable() { - // check whether preferences & devices are resolved - if (this.devicePreference && this.uniqueDevices) { - const deviceType = Number(this.devicePreference.deviceType); - const version = this.devicePreference.platformVersion; - - // if all devices are allocated - if (this.uniqueDevices.length === 0) { - return false; - } - - // if both device type and os is any then return true - if (deviceType === 0 && version === '0') { - return true; - } - - // if os is any then return true - if (version === '0') { - return true; - } - - // check if preferred device type & os exists - return this.uniqueDevices.some((d) => { - // if only device type is any then just check version - if (deviceType === 0) { - return d.platformVersion === version; - } - - return ( - d.platformVersion === version && - (d.isTablet - ? deviceType === ENUMS.DEVICE_TYPE.TABLET_REQUIRED - : deviceType === ENUMS.DEVICE_TYPE.PHONE_REQUIRED) - ); - }); - } - - return null; - } - - @action - parseVersion(version: string): number[] { - // Extract version numbers (e.g., "15.8.3 support" -> [15,8,3]) - const match = version.match(/^(\d+)(?:\.(\d+))?(?:\.(\d+))?/); - - if (!match) { - return [0]; - } - - // Convert matched groups to numbers, defaulting to 0 if not present - return [ - parseInt(match[1] || '0', 10), - parseInt(match[2] || '0', 10), - parseInt(match[3] || '0', 10), - ]; - } - - @action - compareVersions(v1: string, v2: string): number { - const v1Parts = this.parseVersion(v1); - const v2Parts = this.parseVersion(v2); - - // Compare each part of the version - for (let i = 0; i < 3; i++) { - const v1Part = v1Parts[i] as number; - const v2Part = v2Parts[i] as number; - - if (v1Part > v2Part) { - return 1; - } - - if (v1Part < v2Part) { - return -1; - } - } - - return 0; - } - - @action - updateDevicePref( - device_type: string | number | undefined, - platform_version: string, - silentNotifications?: boolean - ) { - this.versionSelected.perform( - device_type, - platform_version, - silentNotifications - ); - } - - @action - handleSelectDeviceType(deviceType: DeviceType) { - this.selectedDeviceType = deviceType; - this.selectedVersion = '0'; - - this.updateDevicePref(this.selectedDeviceType?.value, this.selectedVersion); - } - - @action - handleSelectVersion(version: string) { - this.selectedVersion = version; - - this.updateDevicePref(this.selectedDeviceType?.value, this.selectedVersion); - } - - versionSelected = task( - async ( - device_type: string | number | undefined, - platform_version: string, - silentNotifications = false - ) => { - try { - const profileId = this.args.profileId; - - const devicePreferences = [ - ENV.endpoints['profiles'], - profileId, - ENV.endpoints['devicePreferences'], - ].join('/'); - - const data = { - device_type, - platform_version, - }; - - await this.ajax.put(devicePreferences, { data }); - - if (!this.isDestroyed && this.devicePreference) { - this.devicePreference.deviceType = this.selectedDeviceType - ?.value as number; - - this.devicePreference.platformVersion = this.selectedVersion; - - if (!silentNotifications) { - this.notify.success(this.intl.t('savedPreferences')); - } - } - } catch (e) { - if (!silentNotifications) { - this.notify.error(this.intl.t('somethingWentWrong')); - } - } - } - ); -} - -declare module '@glint/environment-ember-loose/registry' { - export default interface Registry { - 'ProjectPreferencesOld::Provider': typeof ProjectPreferencesOldProviderComponent; - } -} diff --git a/app/models/device-preference.ts b/app/models/device-preference.ts deleted file mode 100644 index 61ed8ef5c..000000000 --- a/app/models/device-preference.ts +++ /dev/null @@ -1,39 +0,0 @@ -/* eslint-disable ember/no-computed-properties-in-native-classes */ -import { inject as service } from '@ember/service'; -import { computed } from '@ember/object'; -import Model, { attr } from '@ember-data/model'; -import IntlService from 'ember-intl/services/intl'; - -export default class DevicePreferenceModel extends Model { - @service declare intl: IntlService; - - @attr('number') - declare deviceType: number; - - @attr('string') - declare platformVersion: string; - - get tAnyVersion() { - return this.intl.t('anyVersion'); - } - - @computed('platformVersion', 'tAnyVersion') - get versionText() { - if (this.platformVersion === '0') { - return this.tAnyVersion; - } else { - return this.platformVersion; - } - } - - @computed('platformVersion') - get isAnyVersion() { - return this.platformVersion !== '0'; - } -} - -declare module 'ember-data/types/registries/model' { - export default interface ModelRegistry { - 'device-preference': DevicePreferenceModel; - } -} diff --git a/app/models/dynamicscan-mode.ts b/app/models/dynamicscan-mode.ts deleted file mode 100644 index 1cdf2d231..000000000 --- a/app/models/dynamicscan-mode.ts +++ /dev/null @@ -1,14 +0,0 @@ -import Model, { attr } from '@ember-data/model'; - -export type DynamicScanModeType = 'Manual' | 'Automated'; - -export default class DynamicscanModeModel extends Model { - @attr('string') - declare dynamicscanMode: DynamicScanModeType; -} - -declare module 'ember-data/types/registries/model' { - export default interface ModelRegistry { - 'dynamicscan-mode': DynamicscanModeModel; - } -} diff --git a/app/models/dynamicscan-old.ts b/app/models/dynamicscan-old.ts deleted file mode 100644 index e6dcdf2d0..000000000 --- a/app/models/dynamicscan-old.ts +++ /dev/null @@ -1,48 +0,0 @@ -import Model, { attr } from '@ember-data/model'; - -export default class DynamicscanOldModel extends Model { - @attr('boolean') - declare apiScan: boolean; - - @attr() - declare apiUrls: unknown; - - @attr('date') - declare createdOn: Date; - - @attr('date') - declare updatedOn: Date; - - @attr('date') - declare expiresOn: Date; - - @attr('number') - declare deviceType: number; - - @attr('number') - declare dynamicStatus: number; - - @attr('number') - declare platform: number; - - @attr('string') - declare platformVersion: string; - - @attr('string') - declare proxyHost: string; - - @attr('string') - declare proxyPort: string; - - async extendTime(time: number) { - const adapter = this.store.adapterFor('dynamicscan-old'); - - return await adapter.extendTime(this, time); - } -} - -declare module 'ember-data/types/registries/model' { - export default interface ModelRegistry { - 'dynamicscan-old': DynamicscanOldModel; - } -} diff --git a/app/models/profile.ts b/app/models/profile.ts index f70ea830a..a59c44275 100644 --- a/app/models/profile.ts +++ b/app/models/profile.ts @@ -2,11 +2,6 @@ import Model, { AsyncHasMany, attr, hasMany } from '@ember-data/model'; import type FileModel from './file'; -export enum ProfileDynamicScanMode { - MANUAL = 0, - AUTOMATED = 1, -} - interface ValueObject { value: boolean; is_inherited: boolean; @@ -46,9 +41,6 @@ export default class ProfileModel extends Model { @attr('boolean') declare showUnknownAnalysis: boolean; - @attr - declare dynamicScanMode: ProfileDynamicScanMode; - @hasMany('file', { inverse: 'profile', async: true }) declare files: AsyncHasMany; diff --git a/app/serializers/device-preference.js b/app/serializers/device-preference.js deleted file mode 100644 index b8dacffd1..000000000 --- a/app/serializers/device-preference.js +++ /dev/null @@ -1,17 +0,0 @@ -/* eslint-disable prettier/prettier */ -import DRFSerializer from './drf'; - -export default DRFSerializer.extend({ - normalizeResponse: function (store, primaryModelClass, payload) { - return { - data: { - id: payload.id, - type: 'device-preference', - attributes: { - platformVersion: payload.platform_version, - deviceType: payload.device_type - } - } - }; - } -}); diff --git a/app/styles/_component-variables.scss b/app/styles/_component-variables.scss index 06f06832f..d13625716 100644 --- a/app/styles/_component-variables.scss +++ b/app/styles/_component-variables.scss @@ -1235,18 +1235,6 @@ body { --vnc-viewer-info-border-color: var(--neutral-grey-300); --vnc-viewer-info-background: var(--neutral-grey-100); - // variables for file-details/dynamic-scan/drawer-old - --file-details-dynamic-scan-drawer-old-border-color: var(--border-color-1); - --file-details-dynamic-scan-drawer-old-border-radius: var(--border-radius); - --file-details-dynamic-scan-drawer-old-alert-background-color: var( - --warn-light - ); - --file-details-dynamic-scan-drawer-old-alert-text-color: var(--warn-dark); - --file-details-dynamic-scan-drawer-old-alert-border-color: var(--warn-dark); - --file-details-dynamic-scan-drawer-old-device-settings-warning-text-color: var( - --neutral-grey-500 - ); - // variables for file-list --file-list-selected-file-chip-color: var(--text-primary); --file-list-selected-file-chip-background: var(--primary-main-10); @@ -1993,11 +1981,6 @@ body { --page-not-found-card-box-shadow: var(--box-shadow-2); --page-not-found-border-color: var(--border-color-1); - // variables for file-details/dynamic-scan/drawer-old/proxy-settings-view - --file-details-dynamic-scan-drawer-old-proxy-settings-view-border-color: var( - --border-color-1 - ); - // variables for file-details/static-scan --file-details-static-scan-border-color: var(--border-color-1); --file-details-static-scan-background-color: var(--background-light); diff --git a/config/environment.js b/config/environment.js index 405955cb9..bc59cfeca 100644 --- a/config/environment.js +++ b/config/environment.js @@ -250,7 +250,6 @@ module.exports = function (environment) { invoice: 'invoice', logout: 'logout', devices: 'devices', - devicePreferences: 'device_preference', dynamic: 'dynamicscan', dynamicscans: 'dynamicscans', dynamicShutdown: 'dynamic_shutdown', @@ -299,7 +298,6 @@ module.exports = function (environment) { rescan: 'rescan', personaltokens: 'personaltokens', unknownAnalysisStatus: 'unknown_analysis_status', - dynamicscanMode: 'dynamicscan_mode', uploadAutomationScript: 'upload_automation_script', uploadAutomationScriptSignedUrl: 'upload_automation_script/signed_url', scheduleDynamicscanAutomation: 'schedule_automation', diff --git a/mirage/config.js b/mirage/config.js index d33aed8e1..68b934856 100644 --- a/mirage/config.js +++ b/mirage/config.js @@ -441,14 +441,6 @@ function routes() { return {}; }); - this.put('/dynamicscan/:id', () => { - return {}; - }); - - this.delete('/dynamicscan/:id', () => { - return {}; - }); - this.post('/integrate_jira', () => { return {}; }); @@ -477,12 +469,6 @@ function routes() { return {}; }); - this.put('/profiles/:id/device_preference', () => { - return { - id: '1', - }; - }); - this.post('/namespace_add', () => { return {}; }); diff --git a/mirage/factories/device-preference.ts b/mirage/factories/device-preference.ts deleted file mode 100644 index 1097a3838..000000000 --- a/mirage/factories/device-preference.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { Factory } from 'miragejs'; - -import { faker } from '@faker-js/faker'; -import ENUMS from 'irene/enums'; - -export default Factory.extend({ - device_type: faker.helpers.arrayElement(ENUMS.DEVICE_TYPE.BASE_VALUES), - platform_version: () => faker.system.semver(), -}); diff --git a/tests/unit/adapters/dynamicscan-mode-test.js b/tests/unit/adapters/dynamicscan-mode-test.js deleted file mode 100644 index eafd87d0f..000000000 --- a/tests/unit/adapters/dynamicscan-mode-test.js +++ /dev/null @@ -1,13 +0,0 @@ -/* eslint-disable prettier/prettier */ -import { module, test } from 'qunit'; -import { setupTest } from 'ember-qunit'; - -module('Unit | Adapter | dynamicscan mode', function(hooks) { - setupTest(hooks); - - // Replace this with your real tests. - test('it exists', function(assert) { - let adapter = this.owner.lookup('adapter:dynamicscan-mode'); - assert.ok(adapter); - }); -}); diff --git a/tests/unit/models/device-preference-test.js b/tests/unit/models/device-preference-test.js deleted file mode 100644 index 5a8045e21..000000000 --- a/tests/unit/models/device-preference-test.js +++ /dev/null @@ -1,23 +0,0 @@ -/* eslint-disable prettier/prettier, qunit/require-expect, qunit/no-assert-equal */ -import { module, test } from 'qunit'; -import { setupTest } from 'ember-qunit'; -import { run } from '@ember/runloop'; - -module('Unit | Model | device preference', function(hooks) { - setupTest(hooks); - - hooks.beforeEach(function() { - // set the locale and the config - this.owner.lookup('service:intl').setLocale('en'); - }); - - test('it exists', function(assert) { - const devicePreference = run(() => this.owner.lookup('service:store').createRecord('device-preference')); - run(function() { - devicePreference.set('platformVersion', "1"); - assert.equal(devicePreference.get('versionText'), "1", "Version Text"); - devicePreference.set('platformVersion', "0"); - assert.equal(devicePreference.get('versionText'), "Any Version", "Version Text"); - }); - }); -}); diff --git a/tests/unit/models/dynamicscan-mode-test.js b/tests/unit/models/dynamicscan-mode-test.js deleted file mode 100644 index 5f06dfced..000000000 --- a/tests/unit/models/dynamicscan-mode-test.js +++ /dev/null @@ -1,14 +0,0 @@ -/* eslint-disable prettier/prettier */ -import { module, test } from 'qunit'; -import { setupTest } from 'ember-qunit'; - -module('Unit | Model | dynamicscan mode', function(hooks) { - setupTest(hooks); - - // Replace this with your real tests. - test('it exists', function(assert) { - let store = this.owner.lookup('service:store'); - let model = store.createRecord('dynamicscan-mode', {}); - assert.ok(model); - }); -});