debian-mirror-gitlab/app/assets/javascripts/custom_metrics/constants.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

13 lines
337 B
JavaScript
Raw Normal View History

2020-04-22 19:07:51 +05:30
export const queryTypes = {
business: 'business',
response: 'response',
system: 'system',
};
2021-03-08 18:12:59 +05:30
export const formDataValidator = (val) => {
2020-04-22 19:07:51 +05:30
const fieldNames = Object.keys(val);
const requiredFields = ['title', 'query', 'yLabel', 'unit', 'group', 'legend'];
2021-03-08 18:12:59 +05:30
return requiredFields.every((name) => fieldNames.includes(name));
2020-04-22 19:07:51 +05:30
};