fix: #329 text ellipsis. Sonar

This commit is contained in:
Cindy Chang
2024-08-14 09:59:09 +08:00
parent 2a188c34ec
commit df341c26ab
3 changed files with 7 additions and 6 deletions

View File

@@ -14,9 +14,10 @@
>
<Column field="username" :header="i18next.t('AcctMgmt.Account')" bodyClass="font-medium" sortable>
<template #body="slotProps">
<div class="row-container flex-w-full-hoverable w-full flex" @mouseenter="handleRowMouseOver(slotProps.data.username)"
<div class="row-container flex-w-full-hoverable w-full" @mouseenter="handleRowMouseOver(slotProps.data.username)"
@mouseout="handleRowMouseOut(slotProps.data.username)">
<div @dblclick="onAcctDoubleClick(slotProps.data.username)" class="account-cell cursor-pointer flex">
<div @dblclick="onAcctDoubleClick(slotProps.data.username)" class="account-cell cursor-pointer
whitespace-nowrap overflow-hidden text-ellipsis">
{{ slotProps.data.username }}
</div>
<span id="just_create_badge" class="flex ml-4"
@@ -30,7 +31,7 @@
<template #body="slotProps">
<div class="row-container flex-w-full-hoverable w-full" @mouseenter="handleRowMouseOver(slotProps.data.username)"
@mouseout="handleRowMouseOut(slotProps.data.username)">
<div class="fullname-cell">
<div class="fullname-cell whitespace-nowrap overflow-hidden text-ellipsis">
{{ slotProps.data.name }}
</div>
</div>
@@ -113,7 +114,7 @@
<script>
import { ref, computed, onMounted, watch, } from 'vue';
import { storeToRefs, mapState, mapActions, } from 'pinia';
import { mapState, mapActions, } from 'pinia';
import LoadingStore from '@/stores/loading.js';
import { useModalStore } from '@/stores/modal.js';
import useAcctMgmtStore from '@/stores/acctMgmt.ts';

View File

@@ -276,7 +276,7 @@ export default {
// 避免直接使用動態 href改用安全的方法來處理動態導航避免直接將未經驗證的數據綁定到 href 屬性。
isSafeTagId(tagId) {
// 檢查 tagId 是否符合安全的格式(例如只允許特定的模式或路徑)
const pattern = /^#?[a-zA-Z0-9-_\/]*$/; // 例如: #waitingTime
const pattern = /^#?[a-zA-Z0-9]*$/; // 例如: #waitingTime
return pattern.test(tagId);
},
/**

View File

@@ -247,7 +247,7 @@ export default {
// 避免直接使用動態 href改用安全的方法來處理動態導航避免直接將未經驗證的數據綁定到 href 屬性。
isSafeTagId(tagId) {
// 檢查 tagId 是否符合安全的格式(例如只允許特定的模式或路徑)
const pattern = /^#?[a-zA-Z0-9-_\/]*$/; // 例如: #waitingTime
const pattern = /^#?[a-zA-Z0-9-]*$/; // 例如: #waitingTime
return pattern.test(tagId);
},
/**