mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Units: support farenheit (existing misspelling) (#21249)
This commit is contained in:
@@ -123,4 +123,12 @@ describe('valueFormats', () => {
|
||||
expect(str).toBe('186');
|
||||
});
|
||||
});
|
||||
|
||||
describe('Resolve old units', () => {
|
||||
it('resolve farenheit', () => {
|
||||
const fmt0 = getValueFormat('farenheit');
|
||||
const fmt1 = getValueFormat('fahrenheit');
|
||||
expect(fmt0).toEqual(fmt1);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@@ -164,6 +164,14 @@ function buildFormats() {
|
||||
}
|
||||
}
|
||||
|
||||
// Resolve units pointing to old IDs
|
||||
[{ from: 'farenheit', to: 'fahrenheit' }].forEach(alias => {
|
||||
const f = index[alias.to];
|
||||
if (f) {
|
||||
index[alias.from] = f;
|
||||
}
|
||||
});
|
||||
|
||||
hasBuiltIndex = true;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user