Remove no longer used closestUnit angular filter

Changelog-entry: Remove no longer used closestUnit angular filter
Change-type: patch
This commit is contained in:
Alexis Svinartchouk 2020-01-02 17:48:19 +01:00 committed by Lorenzo Alberto Maria Ambrosi
parent e8b2255be0
commit 05c2f5bebd
4 changed files with 0 additions and 111 deletions

View File

@ -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']));

View File

@ -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

View File

@ -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
}

View File

@ -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)
})
})
})