- altro aggiornamento restying

- Invio RIS aggiornato
- Eventi
- Home Page restyling
This commit is contained in:
Surya Paolo
2025-12-18 16:58:06 +01:00
parent 7c1946debe
commit d1a66ef4ea
38 changed files with 6551 additions and 5676 deletions

View File

@@ -352,6 +352,12 @@ export const useCircuitStore = defineStore('CircuitStore', {
return false;
},
quantiCircuitiSonoDentro() {
const userStore = useUserStore();
return userStore.my.profile.mycircuits.length
},
updateListCircuit(visu: number, sortbyuser?: boolean) {
const userStore = useUserStore();

View File

@@ -800,6 +800,11 @@ export const colmyelems = [
label_trans: 'myelems.parambool4',
fieldtype: costanti.FieldType.boolean,
}),
AddCol({
name: 'parambool5',
label_trans: 'myelems.parambool5',
fieldtype: costanti.FieldType.boolean,
}),
AddCol({
name: 'number',
label_trans: 'myelems.number',

View File

@@ -7461,10 +7461,9 @@ export const tools = {
async sendCoinsByCircuit(
$q: any,
$router: any,
circuit: ICircuit,
sendcoinrec: ISendCoin
): Promise<void> {
): Promise<boolean> {
const userStore = useUserStore();
const notifStore = useNotifStore();
const { username } = userStore.my;
@@ -7473,83 +7472,48 @@ export const tools = {
const orig = sendcoinrec.grouporig || sendcoinrec.contoComOrig || '';
const dest = sendcoinrec.groupdest || sendcoinrec.contoComDest || sendcoinrec.dest;
// Parametri comuni per i messaggi
const msgParams = {
coin: circuit.symbol,
dest,
qty: sendcoinrec.qty,
circuit: circuit.name,
...(orig && { from: orig }), // Aggiunge 'from' solo se esiste
};
try {
const res = await userStore.setCircuitCmd(
$q,
t,
username,
sendcoinrec.circuitname,
shared_consts.CIRCUITCMD.SENDCOINS_REQ,
true,
sendcoinrec
);
// Seleziona il messaggio appropriato
const messageKey = orig
? 'circuit.question_sendcoinsto_from'
: 'circuit.question_sendcoinsto';
console.log('setCircuitCmd', res);
// Mostra dialog di conferma
return new Promise((resolve, reject) => {
$q.dialog({
title: t('db.domanda'),
message: t(messageKey, msgParams),
ok: {
label: t('dialog.yes'),
color: 'primary',
push: true,
},
cancel: {
label: t('dialog.cancel'),
color: 'secondary',
},
})
.onOk(async () => {
try {
const res = await userStore.setCircuitCmd(
$q,
t,
username,
sendcoinrec.circuitname,
shared_consts.CIRCUITCMD.SENDCOINS_REQ,
true,
sendcoinrec
);
if (!res?.cansend) {
tools.showNegativeNotif($q, res?.errormsg || t('errors.generic'));
return false;
}
console.log('setCircuitCmd', res);
// Aggiorna gli account utente se presenti
if (res.useraccounts?.length > 0) {
userStore.my.profile.useraccounts = res.useraccounts;
}
if (!res?.cansend) {
tools.showNegativeNotif($q, res?.errormsg || t('errors.generic'));
return resolve();
}
// Aggiorna dati
tools.updateMyData(res);
notifStore.updateNotification = true;
// Aggiorna gli account utente se presenti
if (res.useraccounts?.length > 0) {
userStore.my.profile.useraccounts = res.useraccounts;
}
// Aggiorna dati e naviga
tools.updateMyData(res);
notifStore.updateNotification = true;
tools.showPositiveNotif(
$q,
t('circuit.coins_sent', {
qty: sendcoinrec.qty,
symbol: circuit.symbol,
dest,
})
);
$router.push('/circuits');
resolve();
} catch (error) {
console.error('Errore invio coins:', error);
tools.showNegativeNotif($q, t('errors.generic'));
reject(error);
}
tools.showPositiveNotif(
$q,
t('circuit.coins_sent', {
qty: sendcoinrec.qty,
symbol: circuit.symbol,
dest,
})
.onCancel(() => resolve())
.onDismiss(() => resolve());
});
);
return true;
} catch (error) {
console.error('Errore invio coins:', error);
tools.showNegativeNotif($q, t('errors.generic'));
return false;
}
},
/* return await new Promise((resolve, reject) => {
resolve(false)

View File

@@ -3643,5 +3643,9 @@ export const useGlobalStore = defineStore('GlobalStore', {
async sendInviteEmail(email: string) {
// ...
},
getMyGroups() {
return this.mygroups.sort((a, b) => (a.title > b.title) ? 1 : -1);
}
},
});