UI: Updated file units models
This commit is contained in:
parent
df9ec02bbc
commit
99a976b14e
@ -24,10 +24,6 @@ import { ResourcesService } from '@core/services/resources.service';
|
|||||||
|
|
||||||
const unitsModels = '/assets/model/units.json';
|
const unitsModels = '/assets/model/units.json';
|
||||||
|
|
||||||
interface UnitsJson {
|
|
||||||
units: Array<Unit>;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'tb-unit-input',
|
selector: 'tb-unit-input',
|
||||||
templateUrl: './unit-input.component.html',
|
templateUrl: './unit-input.component.html',
|
||||||
@ -151,8 +147,8 @@ export class UnitInputComponent implements ControlValueAccessor, OnInit {
|
|||||||
|
|
||||||
private unitsConstant(): Observable<Array<Unit>> {
|
private unitsConstant(): Observable<Array<Unit>> {
|
||||||
if (this.fetchUnits$ === null) {
|
if (this.fetchUnits$ === null) {
|
||||||
this.fetchUnits$ = this.resourcesService.loadJsonResource<UnitsJson>(unitsModels).pipe(
|
this.fetchUnits$ = this.resourcesService.loadJsonResource<Array<Unit>>(unitsModels).pipe(
|
||||||
map(units => units.units.map(u => ({
|
map(units => units.map(u => ({
|
||||||
symbol: u.symbol,
|
symbol: u.symbol,
|
||||||
name: this.translate.instant(u.name),
|
name: this.translate.instant(u.name),
|
||||||
tags: u.tags
|
tags: u.tags
|
||||||
|
|||||||
@ -1,6 +1,4 @@
|
|||||||
{
|
[{
|
||||||
"units": [
|
|
||||||
{
|
|
||||||
"name": "unit.millimeter",
|
"name": "unit.millimeter",
|
||||||
"symbol": "mm",
|
"symbol": "mm",
|
||||||
"tags": ["level","height","distance","length","width","gap","depth","millimeter","millimeters","rainfall","precipitation",
|
"tags": ["level","height","distance","length","width","gap","depth","millimeter","millimeters","rainfall","precipitation",
|
||||||
@ -2012,6 +2010,4 @@
|
|||||||
"name": "unit.katal-per-cubic-metre",
|
"name": "unit.katal-per-cubic-metre",
|
||||||
"symbol": "kat/m³",
|
"symbol": "kat/m³",
|
||||||
"tags": ["catalytic activity concentration","enzyme concentration","kat/m³"]
|
"tags": ["catalytic activity concentration","enzyme concentration","kat/m³"]
|
||||||
}
|
}]
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user