Replace let with const where variable is never reassigned
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -125,9 +125,9 @@ export default defineStore('allMapDataStore', {
|
||||
* fetch discover api, include '/process-map, /bpmn, /stats, /insights'.
|
||||
*/
|
||||
async getAllMapData() {
|
||||
let logId = this.logId;
|
||||
let tempFilterId = this.tempFilterId;
|
||||
let createfilterId = this.createFilterId
|
||||
const logId = this.logId;
|
||||
const tempFilterId = this.tempFilterId;
|
||||
const createfilterId = this.createFilterId
|
||||
let api = '';
|
||||
|
||||
// 先判斷暫存 再判斷 filter 最後 log
|
||||
@@ -149,11 +149,11 @@ export default defineStore('allMapDataStore', {
|
||||
* fetch trace api.
|
||||
*/
|
||||
async getAllTrace() {
|
||||
let logId = this.logId;
|
||||
let tempFilterId = this.tempFilterId;
|
||||
let createfilterId = this.createFilterId;
|
||||
let baseLogId = this.baseLogId;
|
||||
let baseApi = `/api/logs/${baseLogId}/traces`;
|
||||
const logId = this.logId;
|
||||
const tempFilterId = this.tempFilterId;
|
||||
const createfilterId = this.createFilterId;
|
||||
const baseLogId = this.baseLogId;
|
||||
const baseApi = `/api/logs/${baseLogId}/traces`;
|
||||
let api = '';
|
||||
|
||||
// 先判斷暫存 再判斷 filter 最後 log
|
||||
@@ -177,11 +177,11 @@ export default defineStore('allMapDataStore', {
|
||||
* fetch trace detail api.
|
||||
*/
|
||||
async getTraceDetail() {
|
||||
let logId = this.logId;
|
||||
let traceId = this.traceId;
|
||||
let tempFilterId = this.tempFilterId;
|
||||
let createfilterId = this.createFilterId;
|
||||
let start = this.infiniteStart;
|
||||
const logId = this.logId;
|
||||
const traceId = this.traceId;
|
||||
const tempFilterId = this.tempFilterId;
|
||||
const createfilterId = this.createFilterId;
|
||||
const start = this.infiniteStart;
|
||||
let api = '';
|
||||
|
||||
// 先判斷暫存 再判斷 filter 最後 log
|
||||
@@ -223,10 +223,10 @@ export default defineStore('allMapDataStore', {
|
||||
* fetch base log trace detail api.
|
||||
*/
|
||||
async getBaseTraceDetail() {
|
||||
let logId = this.baseLogId;
|
||||
let traceId = this.baseTraceId;
|
||||
let start = this.baseInfiniteStart;
|
||||
let api = `/api/logs/${logId}/traces/${traceId}?start=${start}&page_size=20`;
|
||||
const logId = this.baseLogId;
|
||||
const traceId = this.baseTraceId;
|
||||
const start = this.baseInfiniteStart;
|
||||
const api = `/api/logs/${logId}/traces/${traceId}?start=${start}&page_size=20`;
|
||||
|
||||
try {
|
||||
const response = await this.$axios.get(api);
|
||||
@@ -262,7 +262,7 @@ export default defineStore('allMapDataStore', {
|
||||
* fetch Filter Parameters api.
|
||||
*/
|
||||
async getFilterParams() {
|
||||
let logId = this.logId;
|
||||
const logId = this.logId;
|
||||
const api = `/api/filters/params?log_id=${logId}`;
|
||||
|
||||
try {
|
||||
@@ -274,8 +274,8 @@ export default defineStore('allMapDataStore', {
|
||||
this.allFilterTrace = response.data.trace;
|
||||
this.allFilterAttrs = response.data.attrs;
|
||||
|
||||
let min = this.allFilterTimeframe.x_axis.min;
|
||||
let max = this.allFilterTimeframe.x_axis.max;
|
||||
const min = this.allFilterTimeframe.x_axis.min;
|
||||
const max = this.allFilterTimeframe.x_axis.max;
|
||||
// 給 Chart.js 原始資料,格式不同的畫會錯誤輸出
|
||||
this.allFilterTimeframe.x_axis.min_base = min;
|
||||
this.allFilterTimeframe.x_axis.max_base = max;
|
||||
@@ -290,7 +290,7 @@ export default defineStore('allMapDataStore', {
|
||||
* Test if the Filter Rules Result in Any Data
|
||||
*/
|
||||
async checkHasResult() {
|
||||
let logId = this.logId;
|
||||
const logId = this.logId;
|
||||
const api = `/api/filters/has-result?log_id=${logId}`;
|
||||
|
||||
try {
|
||||
@@ -304,7 +304,7 @@ export default defineStore('allMapDataStore', {
|
||||
* Add a New Temporary Filter
|
||||
*/
|
||||
async addTempFilterId() {
|
||||
let logId = this.logId;
|
||||
const logId = this.logId;
|
||||
const api = `/api/temp-filters?log_id=${logId}`;
|
||||
|
||||
try {
|
||||
@@ -319,9 +319,9 @@ export default defineStore('allMapDataStore', {
|
||||
* @param {string} value file's name
|
||||
*/
|
||||
async addFilterId(value) {
|
||||
let logId = this.logId;
|
||||
const logId = this.logId;
|
||||
const api = `/api/filters?log_id=${logId}`;
|
||||
let createFilterObj = {
|
||||
const createFilterObj = {
|
||||
name: value,
|
||||
rules: this.postRuleData
|
||||
};
|
||||
@@ -357,7 +357,7 @@ export default defineStore('allMapDataStore', {
|
||||
* Update an Existing Filter
|
||||
*/
|
||||
async updateFilter() {
|
||||
let createFilterId = this.createFilterId
|
||||
const createFilterId = this.createFilterId
|
||||
const api = `/api/filters/${createFilterId}`;
|
||||
const data = this.postRuleData;
|
||||
|
||||
|
||||
@@ -189,8 +189,8 @@ export default defineStore('conformanceStore', {
|
||||
* fetch Log Conformance Parameters api for Rule Settings.
|
||||
*/
|
||||
async getConformanceParams() {
|
||||
let logId = this.conformanceLogId;
|
||||
let filterId = this.conformanceFilterId;
|
||||
const logId = this.conformanceLogId;
|
||||
const filterId = this.conformanceFilterId;
|
||||
let api = '';
|
||||
|
||||
// 先判斷 filter 檔,再判斷 log 檔。
|
||||
@@ -217,8 +217,8 @@ export default defineStore('conformanceStore', {
|
||||
* @param {object} data 送給後端的 data
|
||||
*/
|
||||
async addConformanceCheckId(data) {
|
||||
let logId = this.conformanceLogId;
|
||||
let filterId = this.conformanceFilterId;
|
||||
const logId = this.conformanceLogId;
|
||||
const filterId = this.conformanceFilterId;
|
||||
let api = '';
|
||||
|
||||
// 先判斷 filter 檔,再判斷 log 檔。
|
||||
@@ -246,10 +246,10 @@ export default defineStore('conformanceStore', {
|
||||
* @param {boolean} getRouteFile 是否為了取得 route file 而呼叫?使用在非 Conformance page
|
||||
*/
|
||||
async getConformanceReport(getRouteFile = false) {
|
||||
let logTempCheckId = this.conformanceLogTempCheckId;
|
||||
let filterTempCheckId = this.conformanceFilterTempCheckId;
|
||||
let logCreateCheckId = this.conformanceLogCreateCheckId;
|
||||
let filterCreateCheckId = this.conformanceFilterCreateCheckId;
|
||||
const logTempCheckId = this.conformanceLogTempCheckId;
|
||||
const filterTempCheckId = this.conformanceFilterTempCheckId;
|
||||
const logCreateCheckId = this.conformanceLogCreateCheckId;
|
||||
const filterCreateCheckId = this.conformanceFilterCreateCheckId;
|
||||
let api = '';
|
||||
|
||||
// 先判斷 Temp 再判斷原 ID;先判斷 filter 檔,再判斷 log 檔。
|
||||
@@ -281,10 +281,10 @@ export default defineStore('conformanceStore', {
|
||||
* @param {number} issueNo Issues 編號
|
||||
*/
|
||||
async getConformanceIssue(issueNo) {
|
||||
let logTempCheckId = this.conformanceLogTempCheckId;
|
||||
let filterTempCheckId = this.conformanceFilterTempCheckId;
|
||||
let logCreateCheckId = this.conformanceLogCreateCheckId;
|
||||
let filterCreateCheckId = this.conformanceFilterCreateCheckId;
|
||||
const logTempCheckId = this.conformanceLogTempCheckId;
|
||||
const filterTempCheckId = this.conformanceFilterTempCheckId;
|
||||
const logCreateCheckId = this.conformanceLogCreateCheckId;
|
||||
const filterCreateCheckId = this.conformanceFilterCreateCheckId;
|
||||
let api = '';
|
||||
|
||||
// 先判斷 filter 檔,再判斷 log 檔。
|
||||
@@ -315,10 +315,10 @@ export default defineStore('conformanceStore', {
|
||||
* @param {number} start Trace 要從哪個編號開始載入
|
||||
*/
|
||||
async getConformanceTraceDetail(issueNo, traceId, start) {
|
||||
let logTempCheckId = this.conformanceLogTempCheckId;
|
||||
let filterTempCheckId = this.conformanceFilterTempCheckId;
|
||||
let logCreateCheckId = this.conformanceLogCreateCheckId;
|
||||
let filterCreateCheckId = this.conformanceFilterCreateCheckId;
|
||||
const logTempCheckId = this.conformanceLogTempCheckId;
|
||||
const filterTempCheckId = this.conformanceFilterTempCheckId;
|
||||
const logCreateCheckId = this.conformanceLogCreateCheckId;
|
||||
const filterCreateCheckId = this.conformanceFilterCreateCheckId;
|
||||
let api = '';
|
||||
|
||||
// 先判斷 filter 檔,再判斷 log 檔。
|
||||
@@ -353,10 +353,10 @@ export default defineStore('conformanceStore', {
|
||||
* @param {number} loopNo loop 編號
|
||||
*/
|
||||
async getConformanceLoop(loopNo) {
|
||||
let logTempCheckId = this.conformanceLogTempCheckId;
|
||||
let filterTempCheckId = this.conformanceFilterTempCheckId;
|
||||
let logCreateCheckId = this.conformanceLogCreateCheckId;
|
||||
let filterCreateCheckId = this.conformanceFilterCreateCheckId;
|
||||
const logTempCheckId = this.conformanceLogTempCheckId;
|
||||
const filterTempCheckId = this.conformanceFilterTempCheckId;
|
||||
const logCreateCheckId = this.conformanceLogCreateCheckId;
|
||||
const filterCreateCheckId = this.conformanceFilterCreateCheckId;
|
||||
let api = '';
|
||||
|
||||
// 先判斷 filter 檔,再判斷 log 檔。
|
||||
@@ -379,10 +379,10 @@ export default defineStore('conformanceStore', {
|
||||
* @param {number} start Trace 要從哪個編號開始載入
|
||||
*/
|
||||
async getConformanceLoopsTraceDetail(loopNo, traceId, start) {
|
||||
let logTempCheckId = this.conformanceLogTempCheckId;
|
||||
let filterTempCheckId = this.conformanceFilterTempCheckId;
|
||||
let logCreateCheckId = this.conformanceLogCreateCheckId;
|
||||
let filterCreateCheckId = this.conformanceFilterCreateCheckId;
|
||||
const logTempCheckId = this.conformanceLogTempCheckId;
|
||||
const filterTempCheckId = this.conformanceFilterTempCheckId;
|
||||
const logCreateCheckId = this.conformanceLogCreateCheckId;
|
||||
const filterCreateCheckId = this.conformanceFilterCreateCheckId;
|
||||
let api = '';
|
||||
|
||||
// 先判斷 filter 檔,再判斷 log 檔。
|
||||
@@ -409,10 +409,10 @@ export default defineStore('conformanceStore', {
|
||||
* @param {string} value file's name
|
||||
*/
|
||||
async addConformanceCreateCheckId(value) {
|
||||
let logId = this.conformanceLogId;
|
||||
let filterId = this.conformanceFilterId;
|
||||
const logId = this.conformanceLogId;
|
||||
const filterId = this.conformanceFilterId;
|
||||
let api = '';
|
||||
let data = {
|
||||
const data = {
|
||||
name: value,
|
||||
rule: this.conformanceRuleData
|
||||
};
|
||||
@@ -439,8 +439,8 @@ export default defineStore('conformanceStore', {
|
||||
* Update an Existing Conformance Check, log and filter
|
||||
*/
|
||||
async updateConformance() {
|
||||
let logCreateCheckId = this.conformanceLogCreateCheckId;
|
||||
let filterCreateCheckId = this.conformanceFilterCreateCheckId;
|
||||
const logCreateCheckId = this.conformanceLogCreateCheckId;
|
||||
const filterCreateCheckId = this.conformanceFilterCreateCheckId;
|
||||
let api = '';
|
||||
const data = this.conformanceRuleData;
|
||||
|
||||
|
||||
@@ -35,8 +35,8 @@ export default defineStore('filesStore', {
|
||||
*/
|
||||
allFiles: state => {
|
||||
let result = state.allEventFiles;
|
||||
let data = state.switchFilesTagData;
|
||||
let filesTag = state.filesTag;
|
||||
const data = state.switchFilesTagData;
|
||||
const filesTag = state.filesTag;
|
||||
|
||||
result = result.filter(file => data[filesTag].includes(file.fileType));
|
||||
|
||||
@@ -128,7 +128,7 @@ export default defineStore('filesStore', {
|
||||
if(error.response.status === 422) {
|
||||
// msg: 'not in UTF-8' | 'insufficient columns' | 'the csv file is empty' | 'the filename does not ends with .csv'
|
||||
// type: 'encoding' | 'insufficient_columns' | 'empty' | 'name_suffix'
|
||||
let detail = error.response.data.detail;
|
||||
const detail = error.response.data.detail;
|
||||
|
||||
uploadFailedFirst(detail[0].type, detail[0].msg, detail[0].loc[2]);
|
||||
} else {
|
||||
@@ -170,7 +170,7 @@ export default defineStore('filesStore', {
|
||||
this.$router.push({name: 'Files'});
|
||||
} catch(error) {
|
||||
if(error.response.status === 422) {
|
||||
let detail = [...error.response.data.detail];
|
||||
const detail = [...error.response.data.detail];
|
||||
|
||||
uploadFailedSecond(detail);
|
||||
} else {
|
||||
@@ -194,7 +194,7 @@ export default defineStore('filesStore', {
|
||||
}
|
||||
|
||||
let api;
|
||||
let data = {"name": fileName};
|
||||
const data = {"name": fileName};
|
||||
|
||||
switch (type) {
|
||||
case 'log':
|
||||
|
||||
Reference in New Issue
Block a user