Add warning dialog when changes in an employee profile are unsaved. Move schedule preset buttons from side of selector to side of each option in select menu. optimize behavior of selector: will now switch to empty when deleting currently assigned preset, and will assign automatically any new or copied preset to current employee.
14 lines
662 B
TypeScript
14 lines
662 B
TypeScript
import type { EmbeddedValidationRule, EmbeddedValidationRuleFn } from "quasar";
|
|
|
|
export type QuasarRules = Record<EmbeddedValidationRule, EmbeddedValidationRuleFn>;
|
|
type EmployeeProfileValidationRule<T> = EmbeddedValidationRule | ((value: T, rules: QuasarRules, error_message: string) => boolean | string | Promise<boolean | string>);
|
|
|
|
export const useEmployeeProfileRules = () => {
|
|
const isNotEmpty: EmployeeProfileValidationRule<unknown> = (value, _rules, error_message) => (value !== undefined && value !== null && value !== '') || error_message;
|
|
|
|
return {
|
|
isNotEmpty,
|
|
}
|
|
}
|
|
|
|
export const company_options = ['Targo', 'Solucom']; |