mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-02-24 15:27:43 +01:00
fix: Fix regole ESLint records
This commit is contained in:
parent
2d43ac1235
commit
8f4d5c38b9
1
.idea/php.xml
generated
1
.idea/php.xml
generated
@ -110,7 +110,6 @@
|
|||||||
<path value="$PROJECT_DIR$/vendor/devcode-it/openstamanager-standard-modules" />
|
<path value="$PROJECT_DIR$/vendor/devcode-it/openstamanager-standard-modules" />
|
||||||
<path value="$PROJECT_DIR$/vendor/psr/http-factory" />
|
<path value="$PROJECT_DIR$/vendor/psr/http-factory" />
|
||||||
<path value="$PROJECT_DIR$/vendor/laravel/serializable-closure" />
|
<path value="$PROJECT_DIR$/vendor/laravel/serializable-closure" />
|
||||||
<path value="$PROJECT_DIR$/vendor/openstamanager/standard_modules" />
|
|
||||||
<path value="$PROJECT_DIR$/vendor/maicol07/laravel-json-api-resource" />
|
<path value="$PROJECT_DIR$/vendor/maicol07/laravel-json-api-resource" />
|
||||||
<path value="$PROJECT_DIR$/vendor/maximebf/debugbar" />
|
<path value="$PROJECT_DIR$/vendor/maximebf/debugbar" />
|
||||||
<path value="$PROJECT_DIR$/vendor/barryvdh/laravel-debugbar" />
|
<path value="$PROJECT_DIR$/vendor/barryvdh/laravel-debugbar" />
|
||||||
|
@ -97,29 +97,33 @@ export class RecordsPage extends Page {
|
|||||||
|
|
||||||
recordDialogMaxWidth: string | number = '75%';
|
recordDialogMaxWidth: string | number = '75%';
|
||||||
|
|
||||||
model: Model;
|
model: typeof Model;
|
||||||
|
|
||||||
|
/** @private */
|
||||||
|
data: Model[] = {};
|
||||||
|
|
||||||
async oninit(vnode) {
|
async oninit(vnode) {
|
||||||
// noinspection JSUnresolvedFunction
|
const response = await this.model.all();
|
||||||
vnode.state.data = (await this.model.all()).getData();
|
this.data = response.getData();
|
||||||
if (vnode.state.data) {
|
|
||||||
for (const record of vnode.state.data) {
|
if (this.data.length > 0) {
|
||||||
|
for (const record of this.data) {
|
||||||
this.rows.put(record.id, record);
|
this.rows.put(record.id, record);
|
||||||
}
|
}
|
||||||
m.redraw();
|
m.redraw();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async onupdate(vnode) {
|
onupdate(vnode) {
|
||||||
const rows: Cash = $('.mdc-data-table__row[data-model-id]');
|
const rows: Cash = $('.mdc-data-table__row[data-model-id]');
|
||||||
if (rows.length > 0) {
|
if (rows.length > 0) {
|
||||||
rows.on(
|
rows.on(
|
||||||
'click',
|
'click',
|
||||||
(event: PointerEvent) => {
|
async (event: PointerEvent) => {
|
||||||
if (event.target.tagName === 'MWC-CHECKBOX') {
|
if (event.target.tagName === 'MWC-CHECKBOX') {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.updateRecord($(event.target)
|
await this.updateRecord($(event.target)
|
||||||
.parent('tr')
|
.parent('tr')
|
||||||
.data('model-id'));
|
.data('model-id'));
|
||||||
}
|
}
|
||||||
@ -168,8 +172,8 @@ export class RecordsPage extends Page {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async updateRecord(id: number) {
|
async updateRecord(id: number) {
|
||||||
// noinspection JSUnresolvedFunction
|
const response = await this.model.find(id);
|
||||||
const instance: Model = (await this.model.find(id)).getData();
|
const instance = response.getData();
|
||||||
const dialog = $('mwc-dialog#add-record-dialog');
|
const dialog = $('mwc-dialog#add-record-dialog');
|
||||||
|
|
||||||
// eslint-disable-next-line sonarjs/no-duplicate-string
|
// eslint-disable-next-line sonarjs/no-duplicate-string
|
||||||
@ -190,6 +194,7 @@ export class RecordsPage extends Page {
|
|||||||
|
|
||||||
await instance.delete();
|
await instance.delete();
|
||||||
|
|
||||||
|
// noinspection JSUnresolvedVariable
|
||||||
this.rows.forget(instance.id);
|
this.rows.forget(instance.id);
|
||||||
m.redraw();
|
m.redraw();
|
||||||
await showSnackbar(__('Record eliminato!'), 4000);
|
await showSnackbar(__('Record eliminato!'), 4000);
|
||||||
@ -210,7 +215,7 @@ export class RecordsPage extends Page {
|
|||||||
<mwc-dialog id="add-record-dialog" class="record-dialog"
|
<mwc-dialog id="add-record-dialog" class="record-dialog"
|
||||||
heading={__('Aggiungi nuovo record')}
|
heading={__('Aggiungi nuovo record')}
|
||||||
style={`--mdc-dialog-max-width: ${this.recordDialogMaxWidth}`}>
|
style={`--mdc-dialog-max-width: ${this.recordDialogMaxWidth}`}>
|
||||||
<form method="PUT">
|
<form>
|
||||||
<text-field id="id" name="id" style="display: none;" data-default-value=""/>
|
<text-field id="id" name="id" style="display: none;" data-default-value=""/>
|
||||||
{(() => {
|
{(() => {
|
||||||
const sections = collect(this.sections);
|
const sections = collect(this.sections);
|
||||||
|
1
resources/js/Models/Model.js
vendored
1
resources/js/Models/Model.js
vendored
@ -20,6 +20,7 @@ export default class Model extends BaseModel {
|
|||||||
super();
|
super();
|
||||||
|
|
||||||
// Return a proxy of this object to allow dynamic attributes getters and setters
|
// Return a proxy of this object to allow dynamic attributes getters and setters
|
||||||
|
// eslint-disable-next-line no-constructor-return
|
||||||
return new Proxy(this, {
|
return new Proxy(this, {
|
||||||
get(target: this, property, receiver) {
|
get(target: this, property, receiver) {
|
||||||
const accessor = target[`get${capitalize(property)}Attribute`];
|
const accessor = target[`get${capitalize(property)}Attribute`];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user