refs #5667 Style fixes, model translations
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Juan Ferrer 2023-05-16 20:06:14 +02:00
parent 1dcce0f3ee
commit 30d6f56c39
26 changed files with 299 additions and 196 deletions

View File

@ -1,3 +1,3 @@
SelectAllRows: Seleccionar las {{rows}} fila(s)
All: Se han seleccionado
row(s) have been selected.: fila(s).
Have been selected: Se han seleccionado
row(s) have been selected.: fila(s).

View File

@ -1,70 +1,73 @@
@import "./variables";
/* Headings */
.text-h1, h1 {
font-size: 2.3rem;
}
.text-h2, h2 {
font-size: 2.25rem;
}
.text-h3, h3 {
font-size: 2rem;
}
.text-h4, h4 {
font-size: 1.6rem;
}
.text-h5, h5 {
font-size: 1.3rem;
}
.text-h6, h6 {
font-size: 1.125rem;
}
.text-subtitle1 {
font-size: 1.06rem;
}
.text-subtitle2 {
font-size: 1rem;
}
.text-body1 {
font-size: .875rem;
}
.text-body2 {
font-size: .875rem;
}
.text-caption {
font-size: .875rem;
}
.text-overline {
font-size: .8rem;
}
h1, h2, h3, h4, h5, h6 {
padding: 0;
margin-top: 0;
margin-bottom: 4px;
}
/* Colors */
.text-primary {
color: $color-main;
}
.text-secondary {
color: $color-font-light;
}
/* Helpers */
.text-uppercase {
text-transform: uppercase;
}
.text-center {
text-align: center;
}
.text-right {
text-align: right;
}
.text-left {
text-align: left;
}
@import "./variables";
/* Headings */
.text-h1, h1 {
font-size: 2.3rem;
}
.text-h2, h2 {
font-size: 2.25rem;
}
.text-h3, h3 {
font-size: 2rem;
}
.text-h4, h4 {
font-size: 1.6rem;
}
.text-h5, h5 {
font-size: 1.3rem;
}
.text-h6, h6 {
font-size: 1.125rem;
}
.text-subtitle1 {
font-size: 1.06rem;
}
.text-subtitle2 {
font-size: 1rem;
}
.text-body1 {
font-size: .875rem;
}
.text-body2 {
font-size: .875rem;
}
.text-caption {
font-size: .875rem;
}
.text-overline {
font-size: .8rem;
}
.text-capitalize {
text-transform: capitalize;
}
h1, h2, h3, h4, h5, h6 {
padding: 0;
margin-top: 0;
margin-bottom: 4px;
}
/* Colors */
.text-primary {
color: $color-main;
}
.text-secondary {
color: $color-font-light;
}
/* Helpers */
.text-uppercase {
text-transform: uppercase;
}
.text-center {
text-align: center;
}
.text-right {
text-align: right;
}
.text-left {
text-align: left;
}

View File

@ -10,7 +10,7 @@
</vn-crud-model>
<vn-crud-model
url="{{$ctrl.url}}/{{$ctrl.originId}}/models"
data="models"
data="$ctrl.models"
order="changedModel"
auto-load="true">
</vn-crud-model>
@ -21,7 +21,7 @@
<div class="left">
<vn-avatar class="vn-mt-xs"
ng-class="::{system: !log.user}"
val="{{::log.user ? log.user.nickname : 'System'}}"
val="{{::log.user ? log.user.nickname : $ctrl.$t('System')}}"
ng-click="$ctrl.showWorkerDescriptor($event, log)">
<img
ng-if="::log.user.image"
@ -31,8 +31,8 @@
<div class="arrow bg-panel"></div>
<div class="line"></div>
</div>
<vn-card class="detail vn-pa-sm">
<div class="header vn-mb-sm">
<vn-card class="detail">
<div class="header vn-pa-sm">
<div
class="date text-secondary text-caption"
title="{{::log.creationDate | date:'dd/MM/yyyy HH:mm:ss'}}">
@ -43,7 +43,7 @@
</span>
</div>
<div
class="model vn-mb-sm"
class="model vn-pb-sm vn-px-sm"
title="{{::log.changedModelValue}}"
ng-if="::log.changedModel || log.changedModelValue">
<span class="model-name"
@ -59,49 +59,47 @@
{{::log.changedModelValue}}
</span>
</div>
<div class="changes"
ng-class="::log.props.length ? 'props' : 'no-props'"
vn-id="changes">
<vn-icon icon="visibility"
class="expand-button"
ng-click="$ctrl.toggleAttributes(log, changes, true)">
</vn-icon>
<vn-icon icon="visibility_off"
class="shrink-button"
ng-click="$ctrl.toggleAttributes(log, changes, false)">
</vn-icon>
<div class="changes-wrapper">
<span ng-if="::log.props.length"
class="attributes">
<span ng-if="!log.expand" ng-repeat="prop in ::log.props"
class="basic-json">
<div class="changes vn-pa-sm" ng-class="{expanded: log.expand}">
<div class="icon vn-ml-sm">
<vn-icon icon="visibility"
class="expand-button"
ng-click="log.expand = true">
</vn-icon>
<vn-icon icon="visibility_off"
class="shrink-button"
ng-click="log.expand = false">
</vn-icon>
</div>
<span ng-if="::log.props.length"
class="attributes">
<span ng-if="!log.expand" ng-repeat="prop in ::log.props"
class="basic-json">
<span class="json-field" title="{{::prop.name}}">
{{::prop.nameI18n}}:
</span>
<vn-json-value value="::$ctrl.mainVal(prop, log.action)"></vn-json-value><span ng-if="::!$last">,</span>
</span>
<div ng-if="log.expand" class="expanded-json">
<div ng-repeat="prop in ::log.props">
<span class="json-field" title="{{::prop.name}}">
{{::prop.nameI18n}}:
</span>
<vn-json-value value="::$ctrl.mainVal(prop, log.action)"></vn-json-value><span ng-if="::!$last">,</span>
</span>
<div ng-if="log.expand" class="expanded-json">
<div ng-repeat="prop in ::log.props">
<span class="json-field" title="{{::prop.name}}">
{{::prop.nameI18n}}:
</span>
<vn-json-value value="::$ctrl.mainVal(prop, log.action)"></vn-json-value>
<span ng-if="::log.action == 'update'">
<vn-json-value value="::prop.old"></vn-json-value>
</span>
</div>
<vn-json-value value="::$ctrl.mainVal(prop, log.action)"></vn-json-value>
<span ng-if="::log.action == 'update'">
<vn-json-value value="::prop.old"></vn-json-value>
</span>
</div>
</span>
<span ng-if="::!log.props.length"
class="description">
{{::log.description}}
</span>
<span ng-if="::!log.description && !log.props.length"
class="no-changes"
translate>
No changes
</span>
</div>
</div>
</span>
<span ng-if="::!log.props.length"
class="description">
{{::log.description}}
</span>
<span ng-if="::!log.description && !log.props.length"
class="no-changes"
translate>
No changes
</span>
</vn-card>
</div>
</div>
@ -110,10 +108,6 @@
<form vn-vertical
ng-model-options="{updateOn: 'change blur'}"
class="vn-pa-md filter">
<vn-textfield
label="Name"
ng-model="filter.changedModelValue">
</vn-textfield>
<vn-vertical>
<vn-radio
label="All"
@ -130,7 +124,7 @@
val="system"
ng-model="filter.who">
</vn-radio>
</div>
</vn-vertical>
<vn-autocomplete
ng-show="filter.who != 'system'"
label="User"
@ -158,17 +152,28 @@
</div>
</tpl-item>
</vn-autocomplete>
<vn-autocomplete
label="Model"
ng-model="filter.changedModel"
value-field="changedModel"
show-field="changedModel"
data="models">
</vn-autocomplete>
<vn-textfield
label="Name"
ng-model="filter.changedModelValue">
</vn-textfield>
<vn-textfield
label="Id"
ng-model="filter.changedModelId">
</vn-textfield>
<vn-autocomplete
label="Model"
ng-model="filter.changedModel"
value-field="changedModel"
show-field="changedModelI18n"
data="$ctrl.models"
class="changed-model">
</vn-autocomplete>
<!-- FIXME: Cannot use LIKE with JSON columns
<vn-textfield
label="Changes"
ng-model="filter.changes">
</vn-textfield>
-->
<vn-vertical>
<vn-check
label="Creates"
@ -186,7 +191,7 @@
label="Views"
ng-model="filter.actions.select">
</vn-check>
</div>
</vn-vertical>
<vn-date-picker
label="Date"
ng-model="filter.from">

View File

@ -55,14 +55,14 @@ export default class Controller extends Section {
set logs(value) {
this._logs = value;
if (!this.logs) return;
if (!value) return;
const empty = {};
const validations = window.validations;
for (const log of value) {
const oldValues = log.oldInstance || empty;
const newValues = log.newInstance || empty;
const locale = validations[log.changedModel]?.locale || empty;
log.changedModelI18n = locale.name || log.changedModel;
log.changedModelI18n = firstUpper(locale.name) || log.changedModel;
let props = Object.keys(oldValues).concat(Object.keys(newValues));
props = [...new Set(props)];
@ -71,7 +71,7 @@ export default class Controller extends Section {
for (const prop of props) {
log.props.push({
name: prop,
nameI18n: locale.columns?.[prop] || prop,
nameI18n: firstUpper(locale.columns?.[prop]) || prop,
old: this.castJsonValue(oldValues[prop]),
new: this.castJsonValue(newValues[prop])
});
@ -79,6 +79,20 @@ export default class Controller extends Section {
}
}
get models() {
return this._models;
}
set models(value) {
this._models = value;
if (!value) return;
for (const model of value) {
const name = model.changedModel;
model.changedModelI18n =
firstUpper(window.validations[name]?.locale?.name) || name;
}
}
get showModelName() {
return !(this.changedModel && this.changedModelId);
}
@ -93,11 +107,6 @@ export default class Controller extends Section {
return action == 'delete' ? prop.old : prop.new;
}
toggleAttributes(log, changesEl, force) {
log.expand = force;
changesEl.classList.toggle('expanded', force);
}
relativeDate(dateVal) {
if (dateVal == null) return '';
const date = new Date(dateVal);
@ -132,6 +141,12 @@ export default class Controller extends Section {
switch (prop) {
case 'changedModelValue':
return {[prop]: {like: `%${value}%`}};
case 'changes':
return {or: [
{oldInstance: {like: `%${value}%`}},
{newInstance: {like: `%${value}%`}},
{description: {like: `%${value}%`}}
]};
case 'who':
switch (value) {
case 'all':
@ -195,6 +210,10 @@ export default class Controller extends Section {
}
}
function firstUpper(str) {
return str && str.charAt(0).toUpperCase() + str.substr(1);
}
ngModule.vnComponent('vnLog', {
controller: Controller,
template: require('./index.html'),

View File

@ -50,9 +50,9 @@ vn-log {
white-space: nowrap;
& > .chip {
padding: 2px 4px;
border-radius: 4px;
display: inline-block;
padding: 1px 5px;
border-radius: 8px;
color: $color-font-bg;
&.notice {
@ -76,17 +76,17 @@ vn-log {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
color: lighten($color-primary, 10%);
& > .model-name {
text-transform: capitalize;
color: $color-font;
}
& > .model-value {
font-style: italic;
color: #c7bd2b;
}
& > .model-id {
color: $color-font-secondary;
font-size: .9em;
font-size: .9rem;
}
}
}
@ -94,56 +94,46 @@ vn-log {
.changes {
overflow: hidden;
background-color: rgba(255, 255, 255, .05);
border-radius: 4px;
color: $color-font-secondary;
transition: max-height 150ms ease-in-out;
max-height: 28px;
position: relative;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
max-height: 34px;
& > .expand-button,
& > .shrink-button {
display: none;
}
&.props {
padding-right: 24px;
& > .icon {
float: right;
position: relative;
cursor: pointer;
& > .expand-button,
& > .shrink-button {
position: absolute;
top: 6px;
right: 8px;
font-size: inherit;
float: right;
cursor: pointer;
& > vn-icon {
font-size: 1.2em;
}
& > .expand-button {
display: block;
}
&.expanded {
max-height: 500px;
padding-right: 0;
& > .shrink-button {
display: none;
}
}
&.expanded {
text-overflow: initial;
white-space: initial;
overflow: auto;
max-height: 600px;
& > .changes-wrapper {
text-overflow: initial;
white-space: initial;
& > .icon {
& > .expand-button {
display: none;
}
& > .shrink-button {
display: block;
}
& > .expand-button {
display: none;
}
}
}
& > .changes-wrapper {
padding: 4px 6px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
& > .no-changes {
font-style: italic;
}
& > .no-changes {
font-style: italic;
}
}
}

View File

@ -0,0 +1,4 @@
name: mail forward
columns:
account: account
forwardTo: forward to

View File

@ -0,0 +1,4 @@
name: reenvio de correo
columns:
account: cuenta
forwardTo: reenviar a

View File

@ -1,4 +1,4 @@
name: mail
name: correo electrónico
columns:
id: id
receiver: receptor

View File

@ -0,0 +1,4 @@
name: subrole
columns:
role: rol
inheritsFrom: inherits

View File

@ -0,0 +1,4 @@
name: subrol
columns:
role: rol
inheritsFrom: hereda

View File

@ -0,0 +1,5 @@
name: role
columns:
id: id
name: name
description: description

View File

@ -0,0 +1,5 @@
name: rol
columns:
id: id
name: nombre
description: descripción

View File

@ -1,4 +1,4 @@
name: account
name: user
columns:
id: id
name: name
@ -6,7 +6,7 @@ columns:
nickname: nickname
lang: lang
password: password
bcryptPassword: bcrypt password
bcryptPassword: BCRYPT password
active: active
email: email
emailVerified: email verified

View File

@ -1,4 +1,4 @@
name: cuenta
name: usuario
columns:
id: id
name: nombre
@ -6,12 +6,12 @@ columns:
nickname: apodo
lang: idioma
password: contraseña
bcryptPassword: contraseña bcrypt
bcryptPassword: contraseña BCRYPT
active: activo
email: email
emailVerified: email verificado
email: correo electrónico
emailVerified: correo verificado
created: creado
updated: actualizado
image: imagen
hasGrant: tiene permiso
hasGrant: puede delegar
userFk: usuario

View File

@ -18,3 +18,4 @@ columns:
addressFk: address
incotermsFk: incoterms
customsAgentFk: customs agent
isDefaultAddress: default

View File

@ -18,3 +18,4 @@ columns:
addressFk: dirección
incotermsFk: incoterms
customsAgentFk: agente adunanas
isDefaultAddress: predeterminada

View File

@ -2,7 +2,7 @@ name: client
columns:
id: id
name: name
fi: fi
fi: tax identifier
socialName: socialName
contact: contact
street: street
@ -14,17 +14,17 @@ columns:
isActive: active
credit: credit
creditInsurance: credit insurance
iban: iban
iban: IBAN
dueDay: due day
isEqualizated: equalizated
isFreezed: freezed
hasToInvoiceByAddress: invoice by address
hasToInvoice: has to invoice
isToBeMailed: be mailed
hasSepaVnl: sepa nnl
isToBeMailed: mailed
hasSepaVnl: sepa VNL
hasLcr: lcr
hasCoreVnl: core vnl
hasCoreVnh: core vnh
hasCoreVnl: core VNL
hasCoreVnh: core VNH
hasIncoterms: incoterms
isTaxDataChecked: tax data checked
eypbc: eypbc
@ -47,4 +47,8 @@ columns:
defaultAddressFk: default address
bankEntityFk: bank entity
transferorFk: transferor
riskCalculated: risk calculated
isCreatedAsServed: created as served
hasInvoiceSimplified: simplified invoice
typeFk: type

View File

@ -2,7 +2,7 @@ name: cliente
columns:
id: id
name: nombre
fi: fi
fi: identificador fiscal
socialName: nombre social
contact: contacto
street: calle
@ -14,17 +14,17 @@ columns:
isActive: activo
credit: crédito
creditInsurance: seguro crédito
iban: iban
iban: IBAN
dueDay: día vencimiento
isEqualizated: igualado
isFreezed: congelado
hasToInvoiceByAddress: factura por dirección
hasToInvoice: tiene que facturar
isToBeMailed: envío por email
hasSepaVnl: sepa nnl
hasSepaVnl: sepa VNL
hasLcr: lcr
hasCoreVnl: centro vnl
hasCoreVnh: cenrto vnh
hasCoreVnl: centro VNL
hasCoreVnh: centro VNH
hasIncoterms: incoterms
isTaxDataChecked: datos fiscales comprobados
eypbc: eypbc
@ -34,7 +34,7 @@ columns:
accountingAccount: cuenta contable
created: creado
sageTaxTypeFk: tipo impuesto sage
sageTransactionTypeFk: tipo transacción sage
sageTransactionTypeFk: tipo transacción Sage
businessTypeFk: tipo negocio
salesPersonFk: comercial
hasElectronicInvoice: factura electrónica
@ -47,4 +47,8 @@ columns:
defaultAddressFk: dirección predeterminada
bankEntityFk: entidad bancaria
transferorFk: cedente
riskCalculated: riesgo calculado
isCreatedAsServed: creado como servido
hasInvoiceSimplified: factura simple
typeFk: tipo

View File

@ -11,3 +11,7 @@ columns:
itemFk: item
ticketFk: ticket
saleFk: sale
priceFixed: price fixed
isPriceFixed: has fixed price
isAdded: added
total: total

View File

@ -11,3 +11,7 @@ columns:
itemFk: artículo
ticketFk: ticket
saleFk: línea
priceFixed: precio fijado
isPriceFixed: tiene precio fijado
isAdded: añadida
total: total

View File

@ -5,3 +5,4 @@ columns:
ticketFk: ticket
stateFk: state
workerFk: worker
failFk: fail

View File

@ -5,3 +5,4 @@ columns:
ticketFk: ticket
stateFk: estado
workerFk: trabajador
failFk: fallo

View File

@ -23,3 +23,11 @@ columns:
agencyModeFk: agency
ticketFk: ticket
mergedTicket: merged ticket
isSigned: signed
isLabeled: labeled
isPrinted: printed
hour: hour
created: created
isBlocked: bloqued
hasPriority: priority
isBoxed: boxed

View File

@ -25,3 +25,11 @@ columns:
mergedTicket: ticket fusionado
withWarningAccept: aviso negativos
isWithoutNegatives: sin negativos
isSigned: firmado
isLabeled: etiquetado
isPrinted: impreso
hour: hora
created: creado
isBlocked: bloqueado
hasPriority: prioritario
isBoxed: encajado

View File

@ -0,0 +1,12 @@
name: contrato
columns:
id: id
companyCodeFk: company
started: started
ended: ended
payedHolidays: payed holidays
workerFk: worker
calendarTypeFk: calendar type
isHourlyLabor: hourly labor
workcenterFk: workcenter
amount: amount

View File

@ -0,0 +1,12 @@
name: contrato
columns:
id: id
companyCodeFk: empresa
started: iniciado
ended: finalizado
payedHolidays: vacaciones pagadas
workerFk: trabajador
calendarTypeFk: tipo calendario
isHourlyLabor: horario laboral
workcenterFk: centro de trabajo
amount: salario