- catalogo

- corretto logica del RefreshToken che non richiedeva il nuovo token, quindi scadeva tutte le volte, richiedendo sempre l'accesso !
This commit is contained in:
Surya Paolo
2025-01-07 17:17:08 +01:00
parent ce86dd51a8
commit 3734762a8b
72 changed files with 2112 additions and 3592650 deletions

View File

@@ -29,7 +29,7 @@ export const costanti = {
'excludeproductTypes',
'misure',
'Categoria',
'Editore',
'editore',
'pdf',
'Printable',
'numschede_perCol',
@@ -473,7 +473,7 @@ export const costanti = {
Nessuno: 0,
Entrata: 1,
Uscita: -1,
},
},
FieldTypeArr: [
{ label: 'Boolean', value: 1 },
@@ -500,8 +500,4 @@ export const costanti = {
TESTO_BORDATO: 5,
},
SORT_DEFAULT: 0,
SORT_PUBDATE: 1,
SORT_BESTSELLER: 2,
}

View File

@@ -103,6 +103,7 @@ function AddCol(params: IColGridTable) {
filter_field: (params.filter_field === undefined) ? '' : params.filter_field,
isadvanced_field: (params.isadvanced_field === undefined) ? false : params.isadvanced_field,
path: (params.path === undefined) ? '' : params.path,
onlyforAdmin: (params.onlyforAdmin === undefined) ? false : params.onlyforAdmin,
}
}
@@ -188,10 +189,13 @@ export const colmyScheda = [
AddCol({ name: 'productTypes', label_trans: 'productTypes', fieldtype: costanti.FieldType.number }),
AddCol({ name: 'excludeproductTypes', label_trans: 'excludeproductTypes', fieldtype: costanti.FieldType.number }),
AddCol({ name: 'Editore', label_trans: 'Editore' }),
AddCol({ name: 'author', label_trans: 'author' }),
AddCol({ name: 'sort', label_trans: 'catalogo.sort', fieldtype: costanti.FieldType.number }),
AddCol({ name: 'arrProdottiSpeciali', label_trans: 'Editore' }),
AddCol({ name: 'editore', label_trans: 'editore' }),
AddCol({ name: 'author', label_trans: 'scheda.author' }),
AddCol({ name: 'argomenti', label_trans: 'scheda.argomenti' }),
AddCol({ name: 'idCollana', label_trans: 'scheda.idCollana' }),
AddCol({ name: 'sort_field', label_trans: 'catalogo.sort_field', fieldtype: costanti.FieldType.string }),
AddCol({ name: 'sort_dir', label_trans: 'catalogo.sort_dir', fieldtype: costanti.FieldType.number }),
AddCol({ name: 'arrProdottiSpeciali', label_trans: 'editore' }),
]
export const colmyelCatalogo = [
@@ -199,7 +203,9 @@ export const colmyelCatalogo = [
AddCol({ name: 'excludeproductTypes', label_trans: 'excludeproductTypes', fieldtype: costanti.FieldType.number }),
AddCol({ name: 'pdf', label_trans: 'pdf' }),
AddCol({ name: 'pdf_filename', label_trans: 'pdf_filename' }),
AddCol({ name: 'Editore', label_trans: 'Editore' }),
AddCol({ name: 'editore', label_trans: 'editore' }),
AddCol({ name: 'argomenti', label_trans: 'scheda.argomenti' }),
AddCol({ name: 'idCollana', label_trans: 'scheda.idCollana' }),
AddCol({ name: 'width', label_trans: 'width', fieldtype: costanti.FieldType.string }),
AddCol({ name: 'height', label_trans: 'height', fieldtype: costanti.FieldType.string }),
AddCol({ name: 'optcatalogo.', label_trans: 'catalogo.optcatalogo.', fieldtype: costanti.FieldType.number }),
@@ -280,6 +286,7 @@ export const colmsg_templates = [
]
export const colmypage = [
AddCol({ name: '_id', label_trans: 'index', fieldtype: costanti.FieldType.string }),
AddCol({ name: 'path', label_trans: 'pages.path' }),
AddCol({ name: 'icon', label_trans: 'pages.icon' }),
AddCol({ name: 'order', label_trans: 'pages.order', fieldtype: costanti.FieldType.number }),
@@ -497,12 +504,20 @@ export const colTablecategories = [
export const colTableCatProd = [
AddCol({ name: 'name', label_trans: 'categories.name' }),
AddCol({ name: 'descr_estesa', label_trans: 'categories.descr_estesa' }),
AddCol({ name: 'img', label_trans: 'categories.img' }),
AddCol({ name: 'icon', label_trans: 'categories.icon' }),
AddCol({ name: 'color', label_trans: 'categories.color' }),
AddCol(DeleteRec),
AddCol(DuplicateRec),
]
export const colTableCollane = [
AddCol({ name: 'idCollana', label_trans: 'collane.idCollana', fieldtype: costanti.FieldType.number }),
AddCol({ name: 'descrizione', label_trans: 'collane.descrizione' }),
AddCol({ name: 'descrizione_estesa', label_trans: 'collane.descrizione_estesa' }),
AddCol(DeleteRec),
AddCol(DuplicateRec),
]
export const colTableCatAI = [
AddCol({ name: 'name', label_trans: 'categories.name' }),
@@ -2317,6 +2332,12 @@ export const colTableProductInfos = [
fieldtype: costanti.FieldType.multiselect,
jointable: 'catprods',
}),
AddCol({
name: 'idCollana',
label_trans: 'products.category',
fieldtype: costanti.FieldType.select,
jointable: 'collanas',
}),
AddCol({ name: 'color', label_trans: 'products.color' }),
AddCol({ name: 'size', label_trans: 'products.size' }),
AddCol({ name: 'weight', label_trans: 'products.weight', fieldtype: costanti.FieldType.number }),
@@ -3600,11 +3621,17 @@ export const colTableCircuitComplete = [
AddCol({ name: 'qta_max_default', label_trans: 'circuit.qta_max_default', fieldtype: costanti.FieldType.currency }),
AddCol({ name: 'fido_scoperto_default_grp', label_trans: 'circuit.fido_scoperto_default_grp', fieldtype: costanti.FieldType.currency }),
AddCol({ name: 'qta_max_default_grp', label_trans: 'circuit.qta_max_default_grp', fieldtype: costanti.FieldType.currency }),
AddCol({ name: 'fido_scoperto_default_contocom', label_trans: 'circuit.fido_scoperto_default_contocom', fieldtype: costanti.FieldType.currency }),
AddCol({ name: 'qta_max_default_contocom', label_trans: 'circuit.qta_max_default_contocom', fieldtype: costanti.FieldType.currency }),
AddCol({ name: 'data_costituz', label_trans: 'circuit.data_costituz', fieldtype: costanti.FieldType.date }),
AddCol({ name: 'deperimento', label_trans: 'circuit.deperimento', fieldtype: costanti.FieldType.boolean }),
AddCol({ name: 'showAlways', label_trans: 'circuit.showAlways', fieldtype: costanti.FieldType.boolean }),
AddCol({ name: 'ignoreLimits', label_trans: 'circuit.ignoreLimits', fieldtype: costanti.FieldType.boolean }),
AddCol({ name: 'transactionsEnabled', label_trans: 'circuit.transactionsEnabled', fieldtype: costanti.FieldType.boolean }),
AddCol({ name: 'showAlways', label_trans: 'circuit.showAlways', fieldtype: costanti.FieldType.boolean, onlyforAdmin: true }),
AddCol({ name: 'ignoreLimits', label_trans: 'circuit.ignoreLimits', fieldtype: costanti.FieldType.boolean, onlyforAdmin: true }),
AddCol({ name: 'transactionsEnabled', label_trans: 'circuit.transactionsEnabled', fieldtype: costanti.FieldType.boolean, onlyforAdmin: true }),
AddCol({ name: 'askManagerToEnter', label_trans: 'circuit.askManagerToEnter', fieldtype: costanti.FieldType.boolean, onlyforAdmin: true }),
AddCol({ name: 'sendEmailAfterAskingToEnter', label_trans: 'circuit.sendEmailAfterAskingToEnter', fieldtype: costanti.FieldType.boolean, onlyforAdmin: true }),
AddCol({ name: 'circuitoIndipendente', label_trans: 'circuit.circuitoIndipendente', fieldtype: costanti.FieldType.boolean, onlyforAdmin: true }),
AddCol({ name: 'creditodiPartenza', label_trans: 'circuit.creditodiPartenza', fieldtype: costanti.FieldType.number }),
AddCol({ name: 'freq_deper', label_trans: 'circuit.freq_deper' }),
AddCol({ name: 'minuto_deper', label_trans: 'circuit.minuto_deper', fieldtype: costanti.FieldType.number }),
AddCol({ name: 'ora_deper', label_trans: 'circuit.ora_deper', fieldtype: costanti.FieldType.number }),
@@ -3641,6 +3668,9 @@ export const colTableCircuitComplete = [
sortable: true,
showWhen: 0
}),
AddCol({ name: 'circuitoIndipendente', label_trans: 'circuit.circuitoIndipendente', fieldtype: costanti.FieldType.boolean, onlyforAdmin: true }),
AddCol({ name: 'askManagerToEnter', label_trans: 'circuit.askManagerToEnter', fieldtype: costanti.FieldType.boolean, onlyforAdmin: true }),
AddCol({ name: 'sendEmailAfterAskingToEnter', label_trans: 'circuit.sendEmailAfterAskingToEnter', fieldtype: costanti.FieldType.boolean, onlyforAdmin: true }),
AddCol(ModifRec),
AddCol(DeleteRec),
AddCol(DuplicateRec),
@@ -3693,10 +3723,12 @@ export const colTableCircuit = [
fieldtype: costanti.FieldType.multiselect,
jointable: 'visibilGroup',
showWhen: costanti.showWhen.NewRec + costanti.showWhen.InPage + costanti.showWhen.InEdit + costanti.showWhen.InView_OnlyifExist,
onlyforAdmin: true,
}),
AddCol({
name: 'systemUserId', label_trans: 'circuit.systemUserId', fieldtype: costanti.FieldType.select, jointable: 'users',
showWhen: costanti.showWhen.InEdit + costanti.showWhen.InView,
onlyforAdmin: true
}),
AddCol({
name: 'createdBy', label_trans: 'circuit.founder', fieldtype: costanti.FieldType.select, jointable: 'users',
@@ -3730,6 +3762,8 @@ export const colTableCircuit = [
}),
AddCol({ name: 'fido_scoperto_default_grp', label_trans: 'circuit.fido_scoperto_default_grp', fieldtype: costanti.FieldType.currency }),
AddCol({ name: 'qta_max_default_grp', label_trans: 'circuit.qta_max_default_grp', fieldtype: costanti.FieldType.currency }),
AddCol({ name: 'fido_scoperto_default_contocom', label_trans: 'circuit.fido_scoperto_default_contocom', fieldtype: costanti.FieldType.currency }),
AddCol({ name: 'qta_max_default_contocom', label_trans: 'circuit.qta_max_default_contocom', fieldtype: costanti.FieldType.currency }),
AddCol({ name: 'valuta_per_euro', label_trans: 'circuit.valuta_per_euro', fieldtype: costanti.FieldType.number }),
AddCol({
name: 'totCircolante', label_trans: 'circuit.totCircolante',
@@ -3743,14 +3777,19 @@ export const colTableCircuit = [
}),
AddCol({ name: 'regulation', label_trans: 'circuit.regulation', fieldtype: costanti.FieldType.html, required: false }),
AddCol({ name: 'deperimento', label_trans: 'circuit.deperimento', fieldtype: costanti.FieldType.boolean, disable: true }),
AddCol({ name: 'showAlways', label_trans: 'circuit.showAlways', fieldtype: costanti.FieldType.boolean }),
AddCol({ name: 'ignoreLimits', label_trans: 'circuit.ignoreLimits', fieldtype: costanti.FieldType.boolean }),
AddCol({ name: 'transactionsEnabled', label_trans: 'circuit.transactionsEnabled', fieldtype: costanti.FieldType.boolean }),
AddCol({ name: 'showAlways', label_trans: 'circuit.showAlways', fieldtype: costanti.FieldType.boolean, onlyforAdmin: true }),
AddCol({ name: 'ignoreLimits', label_trans: 'circuit.ignoreLimits', fieldtype: costanti.FieldType.boolean, onlyforAdmin: true }),
AddCol({ name: 'transactionsEnabled', label_trans: 'circuit.transactionsEnabled', fieldtype: costanti.FieldType.boolean, onlyforAdmin: true }),
AddCol({ name: 'askManagerToEnter', label_trans: 'circuit.askManagerToEnter', fieldtype: costanti.FieldType.boolean, onlyforAdmin: true }),
AddCol({ name: 'sendEmailAfterAskingToEnter', label_trans: 'circuit.sendEmailAfterAskingToEnter', fieldtype: costanti.FieldType.boolean, onlyforAdmin: true }),
AddCol({ name: 'circuitoIndipendente', label_trans: 'circuit.circuitoIndipendente', fieldtype: costanti.FieldType.boolean, onlyforAdmin: true }),
AddCol({ name: 'creditodiPartenza', label_trans: 'circuit.creditodiPartenza', fieldtype: costanti.FieldType.number }),
AddCol({
name: 'status', label_trans: 'circuit.status',
fieldtype: costanti.FieldType.select,
jointable: 'statuscircuit',
showWhen: costanti.showWhen.NewRec + costanti.showWhen.InPage + costanti.showWhen.InEdit + costanti.showWhen.InView_OnlyifExist,
onlyforAdmin: true
}
),
AddCol({ name: 'data_costituz', label_trans: 'circuit.data_costituz', fieldtype: costanti.FieldType.date }),
@@ -4110,6 +4149,13 @@ export const fieldsTable = {
colkey: '_id',
collabel: 'name',
},
{
value: 'collanas',
label: 'Collane',
columns: colTableCollane,
colkey: 'idCollana',
collabel: 'descrizione',
},
{
value: 'catais',
label: 'Categorie AI',

View File

@@ -6616,6 +6616,10 @@ export const tools = {
check = check && tools.isBitActive(col.showWhen, costanti.showWhen.InPage)
}
if (col.onlyforAdmin) {
check = check && tools.isAdmin()
}
return check
@@ -6648,14 +6652,23 @@ export const tools = {
setRequestCircuit($q: any, username: string, circuitname: string, value: boolean, groupname?: string) {
const userStore = useUserStore()
const circuitStore = useCircuitStore()
userStore.setCircuitCmd($q, t, username, circuitname, shared_consts.CIRCUITCMD.REQ, value, { groupname })
.then((res: any) => {
if (res) {
if (value) {
const mycircuit = circuitStore.getCircuitByName(circuitname)
let msg = t('circuit.already_entered', { circuitname })
if (mycircuit?.askManagerToEnter) {
msg = t('circuit.askedto', { circuitname })
}
// ADD to req
userStore.my.profile.asked_circuits.push(res.circuit)
tools.showPositiveNotif($q, t('circuit.askedto', { circuitname }))
tools.showPositiveNotif($q, msg)
} else {
// REMOVE to req
userStore.my.profile.asked_circuits = userStore.my.profile.asked_circuits.filter((rec: ICircuit) => rec.name !== circuitname)
@@ -6744,7 +6757,7 @@ export const tools = {
userStore.my.profile.asked_circuits = userStore.my.profile.asked_circuits.filter((rec: ICircuit) => rec.name !== circuitname)
}
this.updateMyData(res)
tools.showPositiveNotif($q, t('circuit.cancel_req'))
tools.showPositiveNotif($q, t('circuit.cancel_req', { circuitname }))
}
})
})
@@ -7384,6 +7397,8 @@ export const tools = {
qta_max_default: 200,
fido_scoperto_default_grp: shared_consts.CIRCUIT_PARAMS.SCOPERTO_MIN_GRP,
qta_max_default_grp: shared_consts.CIRCUIT_PARAMS.SCOPERTO_MAX_GRP,
fido_scoperto_default_contocom: shared_consts.CIRCUIT_PARAMS.SCOPERTO_MIN_CONTO_COMUNITARIO,
qta_max_default_contocom: shared_consts.CIRCUIT_PARAMS.SCOPERTO_MAX_CONTO_COMUNITARIO,
valuta_per_euro: 1,
totTransato: 0,
totCircolante: 0,