Flip negated conditions to positive for readability (S7735)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
+26
-26
@@ -129,23 +129,23 @@ export const useAllMapDataStore = defineStore("allMapDataStore", {
|
||||
switch (copy.type) {
|
||||
case "date":
|
||||
copy.min =
|
||||
copy.min !== null
|
||||
? moment(copy.min).format("YYYY/MM/DD HH:mm")
|
||||
: null;
|
||||
copy.min === null
|
||||
? null
|
||||
: moment(copy.min).format("YYYY/MM/DD HH:mm");
|
||||
copy.max =
|
||||
copy.max !== null
|
||||
? moment(copy.max).format("YYYY/MM/DD HH:mm")
|
||||
: null;
|
||||
copy.max === null
|
||||
? null
|
||||
: moment(copy.max).format("YYYY/MM/DD HH:mm");
|
||||
break;
|
||||
case "float":
|
||||
copy.min =
|
||||
copy.min !== null
|
||||
? Number(new Decimal(copy.min).toFixed(2, 3))
|
||||
: null;
|
||||
copy.min === null
|
||||
? null
|
||||
: Number(new Decimal(copy.min).toFixed(2, 3));
|
||||
copy.max =
|
||||
copy.max !== null
|
||||
? Number(new Decimal(copy.max).toFixed(2, 2))
|
||||
: null;
|
||||
copy.max === null
|
||||
? null
|
||||
: Number(new Decimal(copy.max).toFixed(2, 2));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -212,15 +212,15 @@ export const useAllMapDataStore = defineStore("allMapDataStore", {
|
||||
switch (att.type) {
|
||||
case "date":
|
||||
att.value =
|
||||
att.value !== null
|
||||
? moment(att.value).format("YYYY/MM/DD HH:mm")
|
||||
: null;
|
||||
att.value === null
|
||||
? null
|
||||
: moment(att.value).format("YYYY/MM/DD HH:mm");
|
||||
break;
|
||||
case "float":
|
||||
att.value =
|
||||
att.value !== null
|
||||
? Number(new Decimal(att.value).toFixed(2))
|
||||
: null;
|
||||
att.value === null
|
||||
? null
|
||||
: Number(new Decimal(att.value).toFixed(2));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -257,15 +257,15 @@ export const useAllMapDataStore = defineStore("allMapDataStore", {
|
||||
switch (att.type) {
|
||||
case "date":
|
||||
att.value =
|
||||
att.value !== null
|
||||
? moment(att.value).format("YYYY/MM/DD HH:mm")
|
||||
: null;
|
||||
att.value === null
|
||||
? null
|
||||
: moment(att.value).format("YYYY/MM/DD HH:mm");
|
||||
break;
|
||||
case "float":
|
||||
att.value =
|
||||
att.value !== null
|
||||
? Number(new Decimal(att.value).toFixed(2))
|
||||
: null;
|
||||
att.value === null
|
||||
? null
|
||||
: Number(new Decimal(att.value).toFixed(2));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -305,9 +305,9 @@ export const useAllMapDataStore = defineStore("allMapDataStore", {
|
||||
this.allFilterTimeframe.x_axis.max_base = max;
|
||||
// Convert to a time format without seconds
|
||||
this.allFilterTimeframe.x_axis.min =
|
||||
min !== null ? moment(min).format("YYYY/MM/DD HH:mm") : null;
|
||||
min === null ? null : moment(min).format("YYYY/MM/DD HH:mm");
|
||||
this.allFilterTimeframe.x_axis.max =
|
||||
max !== null ? moment(max).format("YYYY/MM/DD HH:mm") : null;
|
||||
max === null ? null : moment(max).format("YYYY/MM/DD HH:mm");
|
||||
} catch (error) {
|
||||
apiError(error, "Failed to load the Filter Parameters.");
|
||||
}
|
||||
|
||||
+18
-18
@@ -178,9 +178,9 @@ export const useConformanceStore = defineStore("conformanceStore", {
|
||||
case "dummy": //sonar-qube
|
||||
case "duration-list":
|
||||
copy.value = copy.value.map((v) =>
|
||||
v !== null
|
||||
? abbreviateNumber(new Decimal(v.toFixed(2)))
|
||||
: null,
|
||||
v === null
|
||||
? null
|
||||
: abbreviateNumber(new Decimal(v.toFixed(2))),
|
||||
);
|
||||
copy.value = copy.value.map((v) => (v ?? "").trim()).join(", ");
|
||||
break;
|
||||
@@ -194,15 +194,15 @@ export const useConformanceStore = defineStore("conformanceStore", {
|
||||
switch (copy.type) {
|
||||
case "date":
|
||||
copy.value =
|
||||
copy.value !== null
|
||||
? moment(copy.value).format("YYYY/MM/DD HH:mm:ss")
|
||||
: null;
|
||||
copy.value === null
|
||||
? null
|
||||
: moment(copy.value).format("YYYY/MM/DD HH:mm:ss");
|
||||
break;
|
||||
case "float":
|
||||
copy.value =
|
||||
copy.value !== null
|
||||
? new Decimal(copy.value).toFixed(2)
|
||||
: null;
|
||||
copy.value === null
|
||||
? null
|
||||
: new Decimal(copy.value).toFixed(2);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -234,15 +234,15 @@ export const useConformanceStore = defineStore("conformanceStore", {
|
||||
switch (copy.type) {
|
||||
case "date":
|
||||
copy.value =
|
||||
copy.value !== null
|
||||
? moment(copy.value).format("YYYY/MM/DD HH:mm:ss")
|
||||
: null;
|
||||
copy.value === null
|
||||
? null
|
||||
: moment(copy.value).format("YYYY/MM/DD HH:mm:ss");
|
||||
break;
|
||||
case "float":
|
||||
copy.value =
|
||||
copy.value !== null
|
||||
? new Decimal(copy.value).toFixed(2)
|
||||
: null;
|
||||
copy.value === null
|
||||
? null
|
||||
: new Decimal(copy.value).toFixed(2);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -306,10 +306,10 @@ export const useConformanceStore = defineStore("conformanceStore", {
|
||||
const api = getCheckApiBase(this);
|
||||
try {
|
||||
const response = await apiClient.get(api);
|
||||
if (!getRouteFile) {
|
||||
this.allConformanceTempReportData = response.data;
|
||||
} else {
|
||||
if (getRouteFile) {
|
||||
this.allRouteFile = response.data.file;
|
||||
} else {
|
||||
this.allConformanceTempReportData = response.data;
|
||||
}
|
||||
} catch (error) {
|
||||
apiError(error, "Failed to Get the Temporary Log Conformance Report.");
|
||||
|
||||
Reference in New Issue
Block a user