limj
2023-10-24 93652435728de839582440eefd5122c281181d35
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import { CheckboxSOP } from '../../libappsop/checkboxsop';
import { DialogSOP } from '../../libappsop/dialogsop';
import { ListSOP } from '../../libappsop/listsop';
import { DialogDummy } from '../dialogs/dialog.dummy';
 
export interface FormTransportationCostsFields {
  FilterByAccounts?: string;
}
 
export class FormTransportationCosts extends DialogSOP<FormTransportationCostsFields> {
  public static readonly title = 'Transportation Costs';
 
  public listTransportationCosts = new ListTransportationCosts();
  public cbFilterByAccounts = new CheckboxSOP('cbFilterByAccounts');
 
  public constructor() {
    super('FormTransportationCosts');
 
    // Set UI element mapping to pair the UI name to the UI element for use in DialogSOP to find the UI object to set value or verify value
    // This prevents each new Dialog to duplicate code just to set/verify UI element value
    this._uiMap.set('FilterByAccounts', this.cbFilterByAccounts);
  }
}
 
export interface ListTransportationCostsColumns {
  Unit?: string;
  Lane?: string;
  Origin?: string;
  Destination?: string;
  Account?: string;
  'Cost driver'?: string;
  Cost?: string;
  UoM?: string;
  Start?: string;
  End?: string;
}
export class ListTransportationCosts extends ListSOP<DialogDummy, ListTransportationCostsColumns> {
  public static readonly title = 'Transportation Costs';
 
  public constructor() {
    super('lsAccountCosts', new DialogDummy());
  }
}
 
const listTransportationCostsContextMenuItem = {
  Copy: { ContextMenu: 'lsContextMenuAccCosts', Name: 'MenuCopy', Label: 'Copy' },
  Delete: { ContextMenu: 'lsContextMenuAccCosts', Name: 'MenuDelete', Label: 'Delete' },
};
 
export { listTransportationCostsContextMenuItem as ListTransportationCostsContextMenuItem };
 
/**
 * Expected tooltip for context menu item disabled.
 */
export const contextMenuDisabledTooltip = {
  copyMultipleCost: (): string => 'Copy one cost at a time.',
};