Fix NPM issues.

This commit is contained in:
James Cole committed 2026-09-29 21:33:03 +02:00
1 parent 42cde0137b
commit a060d92999
12 files changed
+31 -40

No files matched your search

+2 -16
View File
@@ -64,22 +64,8 @@ class FilterRequest extends ApiRequest
return;
}
});
return;
$validator->after(function (Validator $validator): void {
if (count($validator->failed()) > 0) {
return;
}
$filter = $this->convertToFilter('');
$this->attributes->set('filter', $filter);
});
}
private function convertToFilter(string $value): array {
return [];
// var_dump($value);
// exit;
// private function convertToFilter(string $value): array {
// return [];
}
// }
}
+3 -1
View File
@@ -1,4 +1,6 @@
<?php
declare(strict_types=1);
/*
* IsValidFilterInstructions.php
* Copyright (c) 2026 james@firefly-iii.org
@@ -47,7 +49,7 @@ class IsValidFilterInstruction implements ValidationRule
return;
}
foreach($value as $key => $search) {
if(!in_array($key, $validParameters)) {
if(!in_array($key, $validParameters, true)) {
$fail('validation.no_filter_instructions')->translate(['object' => $shortClass]);
return;
}
+1 -4
View File
@@ -190,9 +190,6 @@ trait ConvertsDataTypes
{
$parameter = request()->query->all($field);
if(!is_array($parameter)) {
return [];
}
if(0 === count($parameter)) {
return [];
}
@@ -200,7 +197,7 @@ trait ConvertsDataTypes
$validParameters = config(sprintf('firefly.allowed_filter_parameters.%s', $shortClass));
$return = [];
foreach($parameter as $key => $search) {
if(in_array($key, $validParameters) && strlen((string)$search) <= 50) {
if(in_array($key, $validParameters, true) && strlen((string)$search) <= 50) {
$return[$key] = trim((string)$search);
}
}
@@ -40,6 +40,7 @@ let index = function () {
accounts: [],
sortDirection: "asc",
page: 1,
i18next:null,
anonymous: false,
totalPages: 1,
loadingPage: true,
@@ -57,7 +58,7 @@ let index = function () {
formatMoney: formatMoney,
objectToQueryString(obj, prefix) {
return Object.keys(obj).map(objKey => {
if (obj.hasOwnProperty(objKey)) {
if (Object.hasOwn(obj, objKey)) {
const key = prefix ? `${prefix}[${objKey}]` : objKey;
const value = obj[objKey];
@@ -72,15 +73,14 @@ let index = function () {
updateHistory() {
if (history.pushState) {
// TODO fix this.
// TODO fix this.
let obj = {
page: this.page,
column: this.sortColumn,
direction: this.sortDirection,
filter: this.filter
};
let string = new URLSearchParams(obj).toString();
string = this.objectToQueryString(obj);
let string = this.objectToQueryString(obj);
let newUrl =
window.location.protocol +
"//" +
@@ -98,6 +98,9 @@ let index = function () {
this.downloadAccounts();
},
init() {
this.$watch('filter.name', (value) => this.updateFilterValue('name', value));
this.i18next = i18next;
this.anonymous = window.store.get("anonymous");
this.handleFunc = this.handlePageClick.bind(this);
const page = window.location.href.split("?")[0].split("/");
@@ -28,6 +28,7 @@ import formatMoney from "../../util/format-money.js";
import { getVariable } from "../../store/get-variable.js";
import { drawMultiCurrencyChart } from "../../shared/draw-chart.js";
import format from "../../util/format.js";
import i18next from "i18next";
let index = function () {
return {
+3 -1
View File
@@ -20,7 +20,9 @@
export default function (amount, currencyCode) {
if ((typeof amount !== "number" && typeof amount !== "string") || isNaN(amount)) {
console.warn("format-money: amount is not a number:", amount);
if(null !== amount) {
console.warn("format-money: amount is not a number:", amount);
}
return "";
}
if (typeof currencyCode !== "string" || currencyCode.length !== 3) {
+3 -3
View File
@@ -31,7 +31,7 @@
<span data-column="name" class="title">{{ trans('list.name') }}</span>
<span data-column="name" class="search-spacer">&nbsp;</span><em data-column="name" class="search-button search-button-name bi bi-search"></em>
<div data-column="name" class="search-filter search-filter-name d-none input-group">
<input type="search" x-model="filter.name" x-init="$watch('filter.name', (value) => updateFilterValue('name', value))" class="filter-input form-control form-control-sm" placeholder="Filter name...">
<input type="search" x-model="filter.name" class="filter-input form-control form-control-sm" placeholder="Filter name...">
<button class="btn btn-outline-secondary btn-sm hide-button" data-column="name" type="button"><em class="bi bi-x text-danger"></em></button>
</div>
</th>
@@ -323,7 +323,7 @@
<p class="text-center"><small>
<em>
<span
x-html="i18next.t('firefly.may_inactive_accounts_link', {url: '{{ route('accounts.inactive.index', $objectType) }}'})"></span>
x-text="i18next.t('firefly.may_inactive_accounts_link', {url: '{{ route('accounts.inactive.index', $objectType) }}'})"></span>
</em>
</small>
</p>
@@ -351,7 +351,7 @@
<p class="text-center"><small>
<em>
<span
x-html="i18next.t('firefly.no_inactive_accounts', {url: '{{ route('accounts.index', $objectType) }}'})"></span>
x-text="i18next.t('firefly.no_inactive_accounts', {url: '{{ route('accounts.index', $objectType) }}'})"></span>
</em>
</small>
</p>
@@ -19,7 +19,7 @@
<div class="row">
<div class="col-lg-12">
<div class="alert alert-success alert-dismissible" role="alert">
<strong>{{ __("firefly.flash_success") }}</strong> <span x-html="success_message"></span>
<strong>{{ __("firefly.flash_success") }}</strong> <span x-text="success_message"></span>
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="{{ __('firefly.close') }}"></button>
</div>
</div>
@@ -61,8 +61,8 @@
{{ __('firefly.submit') }}
</button>
</div>
<p class="text-success" x-html="success_message"></p>
<p class="text-danger" x-html="error_message"></p>
<p class="text-success" x-text="success_message"></p>
<p class="text-danger" x-text="error_message"></p>
</div>
</div>
</div>
@@ -56,8 +56,8 @@
<thead>
<tr>
<th>{{ __('form.date') }}</th>
<th x-html="i18next.t('form.from_currency_to_currency', {from: from.code, to: to.code})"></th>
<th x-html="i18next.t('form.to_currency_from_currency', {from: from.code, to: to.code})"></th>
<th x-text="i18next.t('form.from_currency_to_currency', {from: from.code, to: to.code})"></th>
<th x-text="i18next.t('form.to_currency_from_currency', {from: from.code, to: to.code})"></th>
<th>&nbsp;</th>
</tr>
</thead>
+2 -2
View File
@@ -19,7 +19,7 @@
<div class="row">
<div class="col-lg-12">
<div class="alert alert-success alert-dismissible" role="alert">
<strong>{{ __("firefly.flash_success") }}</strong> <span x-html="success_message"></span>
<strong>{{ __("firefly.flash_success") }}</strong> <span x-text="success_message"></span>
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="{{ __('firefly.close') }}"></button>
</div>
</div>
@@ -56,7 +56,7 @@
<p class="text-success" x-text="success_message"></p>
</template>
<template x-if="'' !== error_message">
<p class="text-danger" x-html="error_message"></p>
<p class="text-danger" x-text="error_message"></p>
</template>
</div>
</div>
+3 -3
View File
@@ -19,7 +19,7 @@
<div class="row">
<div class="col-lg-12">
<div class="alert alert-success alert-dismissible" role="alert">
<strong>{{ __("firefly.flash_success") }}</strong> <span x-html="success_message"></span>
<strong>{{ __("firefly.flash_success") }}</strong> <span x-text="success_message"></span>
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="{{ __('firefly.close') }}"></button>
</div>
</div>
@@ -54,8 +54,8 @@
{{ __('firefly.submit') }}
</button>
</div>
<p class="text-success" x-html="success_message"></p>
<p class="text-danger" x-html="error_message"></p>
<p class="text-success" x-text="success_message"></p>
<p class="text-danger" x-text="error_message"></p>
</div>
</div>
</div>
+1 -1
View File
@@ -5,7 +5,7 @@
<div class="row">
<div class="col-lg-12">
<div class="alert alert-success alert-dismissible" role="alert">
<strong>{{ __("firefly.flash_success") }}</strong> <span x-html="success_message"></span>
<strong>{{ __("firefly.flash_success") }}</strong> <span x-text="success_message"></span>
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="{{ __('firefly.close') }}"></button>
</div>
</div>