fix: #329 text ellipsis. Sonar
This commit is contained in:
@@ -14,9 +14,10 @@
|
|||||||
>
|
>
|
||||||
<Column field="username" :header="i18next.t('AcctMgmt.Account')" bodyClass="font-medium" sortable>
|
<Column field="username" :header="i18next.t('AcctMgmt.Account')" bodyClass="font-medium" sortable>
|
||||||
<template #body="slotProps">
|
<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)">
|
@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 }}
|
{{ slotProps.data.username }}
|
||||||
</div>
|
</div>
|
||||||
<span id="just_create_badge" class="flex ml-4"
|
<span id="just_create_badge" class="flex ml-4"
|
||||||
@@ -30,7 +31,7 @@
|
|||||||
<template #body="slotProps">
|
<template #body="slotProps">
|
||||||
<div class="row-container flex-w-full-hoverable w-full" @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)">
|
@mouseout="handleRowMouseOut(slotProps.data.username)">
|
||||||
<div class="fullname-cell">
|
<div class="fullname-cell whitespace-nowrap overflow-hidden text-ellipsis">
|
||||||
{{ slotProps.data.name }}
|
{{ slotProps.data.name }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -113,7 +114,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { ref, computed, onMounted, watch, } from 'vue';
|
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 LoadingStore from '@/stores/loading.js';
|
||||||
import { useModalStore } from '@/stores/modal.js';
|
import { useModalStore } from '@/stores/modal.js';
|
||||||
import useAcctMgmtStore from '@/stores/acctMgmt.ts';
|
import useAcctMgmtStore from '@/stores/acctMgmt.ts';
|
||||||
|
|||||||
@@ -276,7 +276,7 @@ export default {
|
|||||||
// 避免直接使用動態 href:改用安全的方法來處理動態導航,避免直接將未經驗證的數據綁定到 href 屬性。
|
// 避免直接使用動態 href:改用安全的方法來處理動態導航,避免直接將未經驗證的數據綁定到 href 屬性。
|
||||||
isSafeTagId(tagId) {
|
isSafeTagId(tagId) {
|
||||||
// 檢查 tagId 是否符合安全的格式(例如只允許特定的模式或路徑)
|
// 檢查 tagId 是否符合安全的格式(例如只允許特定的模式或路徑)
|
||||||
const pattern = /^#?[a-zA-Z0-9-_\/]*$/; // 例如: #waitingTime
|
const pattern = /^#?[a-zA-Z0-9]*$/; // 例如: #waitingTime
|
||||||
return pattern.test(tagId);
|
return pattern.test(tagId);
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -247,7 +247,7 @@ export default {
|
|||||||
// 避免直接使用動態 href:改用安全的方法來處理動態導航,避免直接將未經驗證的數據綁定到 href 屬性。
|
// 避免直接使用動態 href:改用安全的方法來處理動態導航,避免直接將未經驗證的數據綁定到 href 屬性。
|
||||||
isSafeTagId(tagId) {
|
isSafeTagId(tagId) {
|
||||||
// 檢查 tagId 是否符合安全的格式(例如只允許特定的模式或路徑)
|
// 檢查 tagId 是否符合安全的格式(例如只允許特定的模式或路徑)
|
||||||
const pattern = /^#?[a-zA-Z0-9-_\/]*$/; // 例如: #waitingTime
|
const pattern = /^#?[a-zA-Z0-9-]*$/; // 例如: #waitingTime
|
||||||
return pattern.test(tagId);
|
return pattern.test(tagId);
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user