Copilot commented on code in PR #8088:
URL: https://github.com/apache/incubator-seata/pull/8088#discussion_r3181450272
##########
console/src/main/resources/static/console-fe/src/utils/request.ts:
##########
@@ -14,62 +14,103 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-import axios, { AxiosInstance, AxiosResponse } from 'axios';
-import { Message } from '@alifd/next';
-import { get } from 'lodash';
-import { AUTHORIZATION_HEADER } from '@/contants';
-import { getCurrentLocaleObj } from '@/reducers/locale';
-
-const createRequest = (baseURL: string, generalErrorMessage: string = 'Request
error, please try again later!') => {
- const instance: AxiosInstance = axios.create({
+import axios, {
+ type AxiosError,
+ type AxiosInstance,
+ type AxiosResponse,
+ type InternalAxiosRequestConfig,
+} from 'axios'
+import { ElMessage } from 'element-plus'
+import 'element-plus/theme-chalk/el-message.css';
+import i18n from '@/i18n'
+import router from '@/router'
+import { useAppStore } from '@/stores/app'
Review Comment:
`router` is imported but never used, which will fail `noUnusedLocals`/ESLint
and adds dead code. Also this file mixes semicolon/no-semicolon style (`import
'element-plus/theme-chalk/el-message.css';`) despite the repo Prettier config
using `semi: false`; please remove the unused import and align the statement
style.
##########
console/src/main/resources/static/console-fe/src/components/branch/BranchSessionDialog.vue:
##########
@@ -0,0 +1,175 @@
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+-->
+<template>
+ <el-dialog
+ :model-value="visible"
+ :title="t('branch.title') + ' - ' + xid"
+ width="80%"
+ class="branch-dialog"
+ @update:model-value="$emit('update:visible', $event)"
+ >
+ <el-table v-loading="loading" :data="branchList" border style="width:
100%">
+ <el-table-column prop="transactionId"
:label="t('branch.table.transactionId')" min-width="170" show-overflow-tooltip
/>
+ <el-table-column prop="branchId" :label="t('branch.table.branchId')"
min-width="170" show-overflow-tooltip />
+ <el-table-column prop="resourceGroupId"
:label="t('branch.table.resourceGroupId')" min-width="140"
show-overflow-tooltip />
+ <el-table-column prop="branchType" :label="t('branch.table.branchType')"
min-width="100" />
+ <el-table-column :label="t('branch.table.status')" min-width="140">
+ <template #default="{ row }">
+ <el-button :type="getStatusButtonType(row.status)" size="small"
plain>
+ {{ GlobalStatusMap[row.status] ?? row.status }}
+ </el-button>
+ </template>
Review Comment:
This dialog is rendering branch session status values using
`GlobalStatusMap` (global transaction statuses). Branch sessions use
`BranchStatus` codes/names, so the displayed text and `statusButtonTypeMap`
will be incorrect (e.g., `PhaseOne_Done`, `PhaseTwo_Committed`, etc.).
Introduce a dedicated branch-status map aligned with
`org.apache.seata.core.model.BranchStatus` and use it for both label rendering
and button type selection.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]