69 lines
4.6 KiB
JavaScript
69 lines
4.6 KiB
JavaScript
// eslint max-len: ["error", 500]
|
|
// eslint key-spacing: ["error", 500]
|
|
import components from './selector_variables.js';
|
|
|
|
function checkElement(selector, attributeValue) {
|
|
let aux = selector.split(' ');
|
|
if (aux[0] === 'vn-autocomplete') {
|
|
return selector.replace(aux[0], `${aux[0]}[field="${attributeValue}"]`);
|
|
}
|
|
if (aux[0] === 'vn-textfield') {
|
|
return selector.replace(aux[4], `${aux[4]}[name="${attributeValue}"]`);
|
|
}
|
|
}
|
|
|
|
export default {
|
|
login: {
|
|
textFieldInput: `${components.vnTextfield}`,
|
|
submitButton: `${components.vnSubmit}`
|
|
},
|
|
globalItems: {
|
|
topBar: `${components.vnTopbar}`,
|
|
logOutButton: `${components.vnIcon}[icon="exit_to_app"]`,
|
|
snackbarIsActive: '.mdl-snackbar--active > .mdl-snackbar__text',
|
|
applicationsMenuButton: `${components.vnIcon}[icon="apps"]`,
|
|
applicationsMenuVisible: `${components.vnMainMenu} .is-visible > div`,
|
|
clientsButton: `${components.vnMainMenu} > div > ul > li:nth-child(1)`
|
|
},
|
|
moduleAccessView: {
|
|
clientsSectionButton: `${components.vnModuleContainer}[ui-sref="clients"]`
|
|
},
|
|
clientsIndex: {
|
|
searchClientInput: `${components.vnTextfield}`,
|
|
searchButton: `${components.vnSearchBar} > vn-icon-button > button`,
|
|
searchResult: `${components.vnItemClient}:nth-child(1) > a`,
|
|
createClientButton: `${components.vnFloatButton}`
|
|
},
|
|
createClientView: {
|
|
name: `${checkElement(components.vnTextfield, 'name')}`,
|
|
taxNumber: `${checkElement(components.vnTextfield, 'fi')}`,
|
|
socialName: `${checkElement(components.vnTextfield, 'socialName')}`,
|
|
userName: `${checkElement(components.vnTextfield, 'userName')}`,
|
|
email: `${checkElement(components.vnTextfield, 'email')}`,
|
|
createButton: `${components.vnSubmit}`
|
|
},
|
|
basicData: {
|
|
basicDataButton: `${components.vnMenuItem}`,
|
|
nameInput: `${checkElement(components.vnTextfield, 'name')}`,
|
|
taxNumberInput: `${checkElement(components.vnTextfield, 'fi')}`,
|
|
socialNameInput: `${checkElement(components.vnTextfield, 'socialName')}`,
|
|
phoneInput: `${checkElement(components.vnTextfield, 'phone')}`,
|
|
mobileInput: `${checkElement(components.vnTextfield, 'mobile')}`,
|
|
faxInput: `${checkElement(components.vnTextfield, 'fax')}`,
|
|
emailInput: `${checkElement(components.vnTextfield, 'email')}`,
|
|
salesPersonInput: `${checkElement(components.vnAutocomplete, '$ctrl.client.salesPersonFk')}`,
|
|
channelInput: 'body > vn-app > vn-vertical > vn-vertical > vn-client-card > vn-horizontal > vn-auto > vn-vertical > vn-client-basic-data > form > vn-card > div > vn-vertical > vn-horizontal:nth-child(4) > vn-autocomplete:nth-child(3) > vn-vertical > vn-textfield > div > input',
|
|
channelMetropolisOption: 'body > vn-app > vn-vertical > vn-vertical > vn-client-card > vn-horizontal > vn-auto > vn-vertical > vn-client-basic-data > form > vn-card > div > vn-vertical > vn-horizontal:nth-child(4) > vn-autocomplete:nth-child(3) > vn-vertical > vn-drop-down > vn-vertical > vn-one:nth-child(2) > ul > li:nth-child(3)',
|
|
saveButton: 'body > vn-app > vn-vertical > vn-vertical > vn-client-card > vn-horizontal > vn-auto > vn-vertical > vn-client-basic-data > form > vn-button-bar > vn-submit > input'
|
|
},
|
|
fiscalData: {
|
|
fiscalDataButton: 'body > vn-app > vn-vertical > vn-vertical > vn-client-card > vn-horizontal > vn-empty > vn-left-menu > vn-card > div > vn-vertical > vn-actions > vn-horizontal > ul > vn-menu-item:nth-child(2) > li > a',
|
|
addressInput: 'body > vn-app > vn-vertical > vn-vertical > vn-client-card > vn-horizontal > vn-auto > vn-vertical > vn-client-fiscal-data > form > vn-card > div > vn-vertical > vn-horizontal:nth-child(3) > vn-textfield:nth-child(1) > div > input',
|
|
hasToInvoiceCheckboxLabel: 'body > vn-app > vn-vertical > vn-vertical > vn-client-card > vn-horizontal > vn-auto > vn-vertical > vn-client-fiscal-data > form > vn-card > div > vn-vertical > vn-horizontal:nth-child(2) > vn-one:nth-child(1) > vn-check > label',
|
|
hasToInvoiceCheckboxInput: 'body > vn-app > vn-vertical > vn-vertical > vn-client-card > vn-horizontal > vn-auto > vn-vertical > vn-client-fiscal-data > form > vn-card > div > vn-vertical > vn-horizontal:nth-child(2) > vn-one:nth-child(1) > vn-check > label > input',
|
|
// printToInvoiceCheckboxLabel: '',
|
|
// printInvoiceCheckboxInput: '',
|
|
saveButton: 'body > vn-app > vn-vertical > vn-vertical > vn-client-card > vn-horizontal > vn-auto > vn-vertical > vn-client-fiscal-data > form > vn-button-bar > vn-submit > input'
|
|
}
|
|
};
|