Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ exports[`base/Nav/SideMenu/UserMenu/BasicVersionModal render snap when open is t
class="ant-typography css-dev-only-do-not-override-txh9fw"
>
UI:
dev-zjrc-sql-manage-tips-sql-meta-perf 456fd4b26
dev-zjrc-sql-manage-rule-filter-memberof bdf1f7ff3
</article>
</div>
<div
Expand Down Expand Up @@ -345,7 +345,7 @@ exports[`base/Nav/SideMenu/UserMenu/BasicVersionModal render snap when open is t
class="ant-typography css-dev-only-do-not-override-txh9fw"
>
UI:
dev-zjrc-sql-manage-tips-sql-meta-perf 456fd4b26
dev-zjrc-sql-manage-rule-filter-memberof bdf1f7ff3
</article>
</div>
<div
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ exports[`base/Nav/SideMenu/UserMenu/VersionModal-ce render snap when open is tru
class="ant-typography css-dev-only-do-not-override-txh9fw"
>
UI:
dev-zjrc-sql-manage-tips-sql-meta-perf 456fd4b26
dev-zjrc-sql-manage-rule-filter-memberof bdf1f7ff3
</article>
</div>
<div
Expand Down Expand Up @@ -1312,7 +1312,7 @@ exports[`base/Nav/SideMenu/UserMenu/VersionModal-ce render snap when open is tru
class="ant-typography css-dev-only-do-not-override-txh9fw"
>
UI:
dev-zjrc-sql-manage-tips-sql-meta-perf 456fd4b26
dev-zjrc-sql-manage-rule-filter-memberof bdf1f7ff3
</article>
</div>
<div
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ exports[`base/Nav/SideMenu/UserMenu/VersionModal-ee render snap when open is tru
class="ant-typography css-dev-only-do-not-override-txh9fw"
>
UI:
dev-zjrc-sql-manage-tips-sql-meta-perf 456fd4b26
dev-zjrc-sql-manage-rule-filter-memberof bdf1f7ff3
</article>
</div>
<div
Expand Down Expand Up @@ -352,7 +352,7 @@ exports[`base/Nav/SideMenu/UserMenu/VersionModal-ee render snap when open is tru
class="ant-typography css-dev-only-do-not-override-txh9fw"
>
UI:
dev-zjrc-sql-manage-tips-sql-meta-perf 456fd4b26
dev-zjrc-sql-manage-rule-filter-memberof bdf1f7ff3
</article>
</div>
<div
Expand Down
3 changes: 2 additions & 1 deletion packages/base/src/scripts/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export const UI_VERSION = 'dev-zjrc-sql-manage-tips-sql-meta-perf 456fd4b26';
export const UI_VERSION =
'dev-zjrc-sql-manage-rule-filter-memberof bdf1f7ff3';
Original file line number Diff line number Diff line change
Expand Up @@ -4457,7 +4457,7 @@ exports[`page/SqlManagement/SQLEEIndex render sql statics data 1`] = `
class="ant-pagination-total-text"
>
<span>
2 条数据
1 条数据
</span>
</li>
<li
Expand Down
35 changes: 20 additions & 15 deletions packages/sqle/src/page/SqlManagement/component/SQLEEIndex/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
problemSQlNum: null,
optimizedSQLNum: null
});
const [listTotal, setListTotal] = useState(0);
// 分页总数与卡片「SQL总数」同源(统计接口);列表回包 sql_manage_total_num 固定为 0,不可写入
const statisticsRequestSeq = useRef(0);
const [refreshSpinning, setRefreshSpinning] = useState(false);
const [refreshSuccess, setRefreshSuccess] = useState(false);
Expand Down Expand Up @@ -463,6 +463,7 @@
pollingInterval: 1000,
pollingErrorRetryCount: 3,
onFinally: (_params, data, error) => {
// AC-008:有审核中则继续列表轮询且不打统计;离开审核中后停轮询并补打一次统计
const hasBeingAudited =
!error &&
!!data?.list?.some(
Expand All @@ -471,7 +472,6 @@
);

if (!error) {
setListTotal(data?.otherData?.sql_manage_total_num ?? 0);
handleSourceExtraFromResponse(
data?.otherData?.source_extra as ISourceExtra | undefined
);
Expand Down Expand Up @@ -500,18 +500,23 @@
const seq = ++statisticsRequestSeq.current;
return SqlManage.GetSqlManageStatisticsV2(
buildStatisticsRequestParams()
).then((res) => {
if (seq !== statisticsRequestSeq.current) {
return;
}
if (res.data.code === ResponseCode.SUCCESS) {
setSQLNum({
SQLTotalNum: res.data.sql_manage_total_num ?? 0,
problemSQlNum: res.data.sql_manage_bad_num ?? 0,
optimizedSQLNum: res.data.sql_manage_optimized_num ?? 0
});
}
});
)
.then((res) => {
if (seq !== statisticsRequestSeq.current) {
return;
}
// 仅成功回包更新;失败/非 SUCCESS 保持上次总数(AC-007)
if (res.data.code === ResponseCode.SUCCESS) {
setSQLNum({
SQLTotalNum: res.data.sql_manage_total_num ?? 0,
problemSQlNum: res.data.sql_manage_bad_num ?? 0,
optimizedSQLNum: res.data.sql_manage_optimized_num ?? 0
});
}
})
.catch(() => {

Check warning on line 517 in packages/sqle/src/page/SqlManagement/component/SQLEEIndex/index.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🕹️ Function is not covered

Warning! Not covered function
// 网络或请求异常:不写入 0,分页与卡片沿用失败前 SQLNum
});
},
{
refreshDeps: [
Expand Down Expand Up @@ -990,7 +995,7 @@
}
rowSelection={rowSelection as TableRowSelection<ISqlManage>}
pagination={{
total: listTotal,
total: SQLNum.SQLTotalNum ?? 0,
current: pagination.page_index
}}
columns={columns}
Expand Down
3 changes: 2 additions & 1 deletion scripts/getGitVersion.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ const commitId = execSync('git rev-parse --short HEAD', {
version = `${branch.split('\n')[0]} ${commitId.split('\n')[0]}`;
const filePath = resolve(process.cwd(), './src/scripts/version.ts');

const command = `export const UI_VERSION = '${version}';\n`;
// 长分支名单行会触发 prettier printWidth,拆成多行避免 docker_build_ee 失败
const command = `export const UI_VERSION =\n '${version}';\n`;
writeFileSync(filePath, command);
Loading