-import { ref, toRefs, computed, watch, onMounted } from 'vue';
import CreateNewPostcode from 'src/components/CreateNewPostcodeForm.vue';
import VnSelectDialog from 'components/common/VnSelectDialog.vue';
-import FetchData from 'components/FetchData.vue';
-const emit = defineEmits(['update:modelValue', 'update:options']);
import { useI18n } from 'vue-i18n';
const { t } = useI18n();
-const postcodesOptions = ref([]);
-const postcodesRef = ref(null);
-
-const $props = defineProps({
- modelValue: {
- type: [String, Number, Object],
- default: null,
- },
- options: {
- type: Array,
- default: () => [],
- },
- optionLabel: {
- type: String,
- default: '',
- },
- optionValue: {
- type: String,
- default: '',
- },
- filterOptions: {
- type: Array,
- default: () => [],
- },
- isClearable: {
- type: Boolean,
- default: true,
- },
- defaultFilter: {
- type: Boolean,
- default: true,
- },
-});
-
-const { options } = toRefs($props);
-const myOptions = ref([]);
-const myOptionsOriginal = ref([]);
-
-const value = computed({
- get() {
- return $props.modelValue;
- },
- set(value) {
- emit(
- 'update:modelValue',
- postcodesOptions.value.find((p) => p.code === value)
- );
- },
-});
-
-onMounted(() => {
- locationFilter($props.modelValue);
-});
-
-function setOptions(data) {
- myOptions.value = JSON.parse(JSON.stringify(data));
- myOptionsOriginal.value = JSON.parse(JSON.stringify(data));
-}
-setOptions(options.value);
-
-watch(options, (newValue) => {
- setOptions(newValue);
-});
+const value = defineModel({ type: [String, Number, Object] });
function showLabel(data) {
return `${data.code} - ${data.town}(${data.province}), ${data.country}`;
}
-
-function locationFilter(search = '') {
- if (
- search &&
- (search.includes('undefined') || search.startsWith(`${$props.modelValue} - `))
- )
- return;
- let where = { search };
- postcodesRef.value.fetch({ filter: { where }, limit: 30 });
-}
-
-function handleFetch(data) {
- postcodesOptions.value = data;
-}
-function onDataSaved(newPostcode) {
- postcodesOptions.value.push(newPostcode);
- value.value = newPostcode.code;
-}
- handleFetch(data)"
- />
-
+ (value = newValue)" />
diff --git a/src/components/common/VnSelect.vue b/src/components/common/VnSelect.vue
index d26881ea3..b9d24267c 100644
--- a/src/components/common/VnSelect.vue
+++ b/src/components/common/VnSelect.vue
@@ -25,6 +25,10 @@ const $props = defineProps({
type: String,
default: null,
},
+ optionFilterValue: {
+ type: String,
+ default: null,
+ },
url: {
type: String,
default: null,
@@ -70,7 +74,8 @@ const $props = defineProps({
const { t } = useI18n();
const requiredFieldRule = (val) => val ?? t('globals.fieldRequired');
-const { optionLabel, optionValue, optionFilter, options, modelValue } = toRefs($props);
+const { optionLabel, optionValue, optionFilter, optionFilterValue, options, modelValue } =
+ toRefs($props);
const myOptions = ref([]);
const myOptionsOriginal = ref([]);
const vnSelectRef = ref();
@@ -82,6 +87,7 @@ const value = computed({
return $props.modelValue;
},
set(value) {
+ setOptions(myOptionsOriginal.value);
emit('update:modelValue', value);
},
});
@@ -137,16 +143,19 @@ async function fetchFilter(val) {
if (!$props.url || !dataRef.value) return;
const { fields, sortBy, limit } = $props;
- let key = optionFilter.value ?? optionLabel.value;
-
- if (new RegExp(/\d/g).test(val)) key = optionValue.value;
+ const key =
+ optionFilterValue.value ??
+ (new RegExp(/\d/g).test(val)
+ ? optionValue.value
+ : optionFilter.value ?? optionLabel.value);
const defaultWhere = $props.useLike
? { [key]: { like: `%${val}%` } }
: { [key]: val };
const where = { ...(val ? defaultWhere : {}), ...$props.where };
- const fetchOptions = { where, order: sortBy, limit };
+ const fetchOptions = { where, limit };
if (fields) fetchOptions.fields = fields;
+ if (sortBy) fetchOptions.order = sortBy;
return dataRef.value.fetch(fetchOptions);
}
@@ -177,6 +186,10 @@ async function filterHandler(val, update) {
}
);
}
+
+function nullishToTrue(value) {
+ return value ?? true;
+}
@@ -195,12 +208,12 @@ async function filterHandler(val, update) {
:option-label="optionLabel"
:option-value="optionValue"
v-bind="$attrs"
- emit-value
- map-options
- use-input
@filter="filterHandler"
- :hide-selected="$attrs['hide-selected'] ?? true"
- :fill-input="$attrs['fill-input'] ?? true"
+ :emit-value="nullishToTrue($attrs['emit-value'])"
+ :map-options="nullishToTrue($attrs['map-options'])"
+ :use-input="nullishToTrue($attrs['use-input'])"
+ :hide-selected="nullishToTrue($attrs['hide-selected'])"
+ :fill-input="nullishToTrue($attrs['fill-input'])"
ref="vnSelectRef"
lazy-rules
:class="{ required: $attrs.required }"
diff --git a/src/components/common/VnSelectDialog.vue b/src/components/common/VnSelectDialog.vue
index 3726691af..7f7c29f5d 100644
--- a/src/components/common/VnSelectDialog.vue
+++ b/src/components/common/VnSelectDialog.vue
@@ -1,21 +1,12 @@
-
+ emit('update:modelValue', ...args)"
+ >
@@ -276,7 +286,7 @@ function formatValue(value) {
-
+
-import VnAvatar from 'src/components/ui/VnAvatar.vue';
-import { toDateHourMin } from 'src/filters';
-import { ref } from 'vue';
import axios from 'axios';
+import { ref } from 'vue';
+import { onBeforeRouteLeave } from 'vue-router';
import { useI18n } from 'vue-i18n';
-import VnPaginate from './VnPaginate.vue';
-import VnUserLink from '../ui/VnUserLink.vue';
+import { useQuasar } from 'quasar';
+
+import { toDateHourMin } from 'src/filters';
import { useState } from 'src/composables/useState';
+import VnPaginate from 'components/ui/VnPaginate.vue';
+import VnUserLink from 'components/ui/VnUserLink.vue';
+import VnConfirm from 'components/ui/VnConfirm.vue';
+import VnAvatar from 'components/ui/VnAvatar.vue';
+
const $props = defineProps({
url: { type: String, default: null },
filter: { type: Object, default: () => {} },
@@ -17,6 +22,7 @@ const $props = defineProps({
const { t } = useI18n();
const state = useState();
+const quasar = useQuasar();
const currentUser = ref(state.getUser());
const newNote = ref('');
const vnPaginateRef = ref();
@@ -33,6 +39,19 @@ async function insert() {
await vnPaginateRef.value.fetch();
newNote.value = '';
}
+
+onBeforeRouteLeave((to, from, next) => {
+ if (newNote.value)
+ quasar.dialog({
+ component: VnConfirm,
+ componentProps: {
+ title: t('globals.unsavedPopup.title'),
+ message: t('globals.unsavedPopup.subtitle'),
+ promise: () => next(),
+ },
+ });
+ else next();
+});
diff --git a/src/css/app.scss b/src/css/app.scss
index 401fa8a72..3efe92db4 100644
--- a/src/css/app.scss
+++ b/src/css/app.scss
@@ -194,13 +194,6 @@ select:-webkit-autofill {
justify-content: center;
}
-.q-card,
-.q-table,
-.q-table__bottom,
-.q-drawer {
- background-color: var(--vn-section-color);
-}
-
input[type='number'] {
-moz-appearance: textfield;
}
@@ -254,6 +247,16 @@ input::-webkit-inner-spin-button {
white-space: nowrap;
text-overflow: ellipsis;
}
+ tr {
+ th {
+ font-size: 11pt;
+ }
+ td {
+ font-size: 11pt;
+ border-top: 1px solid var(--vn-page-color);
+ border-collapse: collapse;
+ }
+ }
.shrink {
max-width: 75px;
}
diff --git a/src/i18n/locale/en.yml b/src/i18n/locale/en.yml
index e4e06ffac..78c1fa18d 100644
--- a/src/i18n/locale/en.yml
+++ b/src/i18n/locale/en.yml
@@ -246,6 +246,8 @@ globals:
mailForwarding: Mail forwarding
mailAlias: Mail alias
privileges: Privileges
+ ldap: LDAP
+ samba: Samba
created: Created
worker: Worker
now: Now
diff --git a/src/i18n/locale/es.yml b/src/i18n/locale/es.yml
index 4cdc13f92..0266bd208 100644
--- a/src/i18n/locale/es.yml
+++ b/src/i18n/locale/es.yml
@@ -248,6 +248,8 @@ globals:
components: Componentes
pictures: Fotos
packages: Bultos
+ ldap: LDAP
+ samba: Samba
created: Fecha creación
worker: Trabajador
now: Ahora
diff --git a/src/pages/Account/AccountAccounts.vue b/src/pages/Account/AccountAccounts.vue
index 3d7dda899..9cc282551 100644
--- a/src/pages/Account/AccountAccounts.vue
+++ b/src/pages/Account/AccountAccounts.vue
@@ -1,11 +1,9 @@
@@ -64,82 +124,34 @@ function showFormDialog(data) {
@on-fetch="(data) => (rolesOptions = data)"
auto-load
/>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- deleteAcl(row.id)
- )
- "
- color="primary"
- style="margin-top: 15px"
- />
-
-
-
-
-
-
-
-
-
-
- {{ t('New ACL') }}
-
-
-
+
+
+
+
@@ -148,4 +160,6 @@ es:
ACL removed: ACL eliminado
ACL will be removed: El ACL será eliminado
Are you sure you want to continue?: ¿Seguro que quieres continuar?
+ Remove ACL: Eliminar Acl
+ Do you want to remove this ACL?: ¿Quieres eliminar este ACL?
diff --git a/src/pages/Account/AccountAliasList.vue b/src/pages/Account/AccountAliasList.vue
index 29e8d4d78..b86580017 100644
--- a/src/pages/Account/AccountAliasList.vue
+++ b/src/pages/Account/AccountAliasList.vue
@@ -1,30 +1,13 @@
@@ -52,54 +57,22 @@ const openCreateModal = () => aliasCreateDialogRef.value.show();
/>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ t('mailAlias.newAlias') }}
-
-
-
+
diff --git a/src/pages/Account/AccountConnections.vue b/src/pages/Account/AccountConnections.vue
index 98208e5f2..4d3450665 100644
--- a/src/pages/Account/AccountConnections.vue
+++ b/src/pages/Account/AccountConnections.vue
@@ -2,11 +2,9 @@
import { ref } from 'vue';
import { useRouter } from 'vue-router';
import { useI18n } from 'vue-i18n';
-
import VnPaginate from 'components/ui/VnPaginate.vue';
import CardList from 'src/components/ui/CardList.vue';
import VnLv from 'src/components/ui/VnLv.vue';
-
import { toDateTimeFormat } from 'src/filters/date.js';
import axios from 'axios';
import useNotify from 'src/composables/useNotify.js';
diff --git a/src/pages/Account/AccountCreate.vue b/src/pages/Account/AccountCreate.vue
index 1c0f9fee6..e584a1acd 100644
--- a/src/pages/Account/AccountCreate.vue
+++ b/src/pages/Account/AccountCreate.vue
@@ -2,7 +2,6 @@
import { reactive, ref } from 'vue';
import { useI18n } from 'vue-i18n';
import { useRouter } from 'vue-router';
-
import FormModelPopup from 'components/FormModelPopup.vue';
import VnSelect from 'src/components/common/VnSelect.vue';
import FetchData from 'components/FetchData.vue';
@@ -15,7 +14,6 @@ const newAccountForm = reactive({
active: true,
});
const rolesOptions = ref([]);
-
const redirectToAccountBasicData = (_, { id }) => {
router.push({ name: 'AccountBasicData', params: { id } });
};
diff --git a/src/pages/Account/AccountFilter.vue b/src/pages/Account/AccountFilter.vue
index 784c925bc..1775aa06b 100644
--- a/src/pages/Account/AccountFilter.vue
+++ b/src/pages/Account/AccountFilter.vue
@@ -1,7 +1,6 @@
-
-
-
-
-
-
-
-
- {{ t('globals.collapseMenu') }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ t('account.card.newUser') }}
-
-
-
+
+
+
diff --git a/src/pages/Account/AccountSamba.vue b/src/pages/Account/AccountSamba.vue
index 25428a674..7af9f4364 100644
--- a/src/pages/Account/AccountSamba.vue
+++ b/src/pages/Account/AccountSamba.vue
@@ -1,23 +1,18 @@
-
-
- {{ shouldSyncPassword }}
-
-
- {{ t('account.card.actions.sync.tooltip') }}
-
-
-
-
-
- {{ t('account.card.actions.setPassword') }}
-
- updateStatusAccount(true)
- )
- "
- >
- {{ t('account.card.actions.enableAccount.name') }}
-
-
+
diff --git a/src/pages/Account/InheritedRoles.vue b/src/pages/Account/InheritedRoles.vue
index 41e718bb5..13294cfdf 100644
--- a/src/pages/Account/InheritedRoles.vue
+++ b/src/pages/Account/InheritedRoles.vue
@@ -1,23 +1,17 @@
-
-
-
-
- {{ t('globals.collapseMenu') }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ t('role.newRole') }}
-
-
-
+
diff --git a/src/pages/Account/Role/AccountRolesFilter.vue b/src/pages/Account/Role/AccountRolesFilter.vue
index b1929b1de..8340b965d 100644
--- a/src/pages/Account/Role/AccountRolesFilter.vue
+++ b/src/pages/Account/Role/AccountRolesFilter.vue
@@ -1,6 +1,5 @@
diff --git a/src/pages/Account/Role/Card/RoleForm.vue b/src/pages/Account/Role/Card/RoleForm.vue
index 7f4a1da34..382639beb 100644
--- a/src/pages/Account/Role/Card/RoleForm.vue
+++ b/src/pages/Account/Role/Card/RoleForm.vue
@@ -1,7 +1,6 @@