diff --git a/lib/gui/app/pages/main/main.ts b/lib/gui/app/pages/main/main.ts index 30edc184..768313f4 100644 --- a/lib/gui/app/pages/main/main.ts +++ b/lib/gui/app/pages/main/main.ts @@ -30,7 +30,6 @@ import MainPage from './MainPage'; import { MODULE_NAME as flashAnother } from '../../components/flash-another'; import { MODULE_NAME as flashResults } from '../../components/flash-results'; -import * as byteSize from '../../utils/byte-size/byte-size'; export const MODULE_NAME = 'Etcher.Pages.Main'; @@ -38,7 +37,6 @@ const Main = angular.module(MODULE_NAME, [ angularRouter, flashAnother, flashResults, - byteSize, ]); Main.component('mainPage', react2angular(MainPage, [], ['$state'])); diff --git a/lib/gui/app/utils/byte-size/byte-size.js b/lib/gui/app/utils/byte-size/byte-size.js deleted file mode 100644 index 8101cd50..00000000 --- a/lib/gui/app/utils/byte-size/byte-size.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2016 balena.io - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -'use strict' - -/** - * The purpose of this module is to provide utilities - * to work with sizes in bytes. - * - * @module Etcher.Utils.ByteSize - */ - -const angular = require('angular') -const MODULE_NAME = 'Etcher.Utils.ByteSize' -const ByteSize = angular.module(MODULE_NAME, []) - -/* eslint-disable lodash/prefer-lodash-method */ - -ByteSize.filter('closestUnit', require('./filter.js')) - -/* eslint-enable lodash/prefer-lodash-method */ - -module.exports = MODULE_NAME diff --git a/lib/gui/app/utils/byte-size/filter.js b/lib/gui/app/utils/byte-size/filter.js deleted file mode 100644 index f677aeed..00000000 --- a/lib/gui/app/utils/byte-size/filter.js +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2016 balena.io - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -'use strict' - -const units = require('../../../../shared/units') - -module.exports = () => { - /** - * @summary Convert bytes to the closest unit - * @function - * @public - * - * @param {Number} bytes - bytes - * @returns {String} formatted string containing size and unit - * - * @example - * {{ 7801405440 | closestUnit }} - */ - return units.bytesToClosestUnit -} diff --git a/tests/gui/utils/byte-size.spec.js b/tests/gui/utils/byte-size.spec.js deleted file mode 100644 index d5104b5b..00000000 --- a/tests/gui/utils/byte-size.spec.js +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2017 balena.io - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -'use strict' - -const m = require('mochainon') -const angular = require('angular') -const units = require('../../../lib/shared/units') - -describe('Browser: ByteSize', function () { - beforeEach(angular.mock.module( - require('../../../lib/gui/app/utils/byte-size/byte-size') - )) - - describe('ClosestUnitFilter', function () { - let closestUnitFilter - - beforeEach(angular.mock.inject(function (_closestUnitFilter_) { - closestUnitFilter = _closestUnitFilter_ - })) - - it('should expose lib/shared/units.js bytesToGigabytes()', function () { - m.chai.expect(closestUnitFilter).to.equal(units.bytesToClosestUnit) - }) - }) -})