diff --git a/resources/js/Components/TablePersons.vue b/resources/js/Components/TablePersons.vue index 3dd6d3b..c119d8c 100644 --- a/resources/js/Components/TablePersons.vue +++ b/resources/js/Components/TablePersons.vue @@ -2,8 +2,8 @@ import { computed, ref, watch } from 'vue'; import { mdiTrashCan } from '@mdi/js'; import { mdiDragVariant, mdiChevronLeft, mdiChevronRight } from '@mdi/js'; +import { mdiAccount, mdiDomain } from '@mdi/js'; import BaseIcon from '@/Components/BaseIcon.vue'; -import BaseButtons from '@/Components/BaseButtons.vue'; import BaseButton from '@/Components/BaseButton.vue'; import { Person } from '@/Dataset'; import Draggable from 'vuedraggable'; @@ -21,25 +21,6 @@ interface Props { canReorder?: boolean; } -// const props = defineProps({ -// checkable: Boolean, -// persons: { -// type: Array, -// default: () => [], -// }, -// relation: { -// type: String, -// required: true, -// }, -// contributortypes: { -// type: Object, -// default: () => ({}), -// }, -// errors: { -// type: Object, -// default: () => ({}), -// }, -// }); const props = withDefaults(defineProps(), { checkable: false, persons: () => [], @@ -63,15 +44,18 @@ const perPage = ref(5); const currentPage = ref(0); const dragEnabled = ref(props.canReorder); +// Name type options +const nameTypeOptions = { + 'Personal': 'Personal', + 'Organizational': 'Org' +}; + // Computed properties const items = computed({ get() { return props.persons; }, - // setter set(value) { - // Note: we are using destructuring assignment syntax here. - props.persons.length = 0; props.persons.push(...value); }, @@ -122,19 +106,19 @@ const pagesList = computed(() => { return pages; }); -// const removeAuthor = (key: number) => { -// items.value.splice(key, 1); -// }; // Methods const removeAuthor = (index: number) => { const actualIndex = perPage.value * currentPage.value + index; const person = items.value[actualIndex]; - if (confirm(`Are you sure you want to remove ${person.first_name || ''} ${person.last_name || person.email}?`)) { + const displayName = person.name_type === 'Organizational' + ? person.last_name || person.email + : `${person.first_name || ''} ${person.last_name || person.email}`.trim(); + + if (confirm(`Are you sure you want to remove ${displayName}?`)) { items.value.splice(actualIndex, 1); emit('remove-person', actualIndex, person); - // Adjust current page if needed if (itemsPaginated.value.length === 0 && currentPage.value > 0) { currentPage.value--; } @@ -144,6 +128,12 @@ const removeAuthor = (index: number) => { const updatePerson = (index: number, field: keyof Person, value: any) => { const actualIndex = perPage.value * currentPage.value + index; const person = items.value[actualIndex]; + + // Handle name_type change - clear first_name if switching to Organizational + if (field === 'name_type' && value === 'Organizational') { + person.first_name = ''; + } + (person as any)[field] = value; emit('person-updated', actualIndex, person); }; @@ -170,7 +160,6 @@ const handleDragEnd = (evt: any) => { watch( () => props.persons.length, () => { - // Reset to first page if current page is out of bounds if (currentPage.value >= numPages.value && numPages.value > 0) { currentPage.value = numPages.value - 1; } @@ -189,18 +178,16 @@ const perPageOptions = [ @@ -481,7 +558,6 @@ const perPageOptions = [ @apply bg-white dark:bg-slate-900 rounded-lg shadow-sm; } -/* Improve table responsiveness */ @media (max-width: 768px) { table { font-size: 0.875rem; @@ -492,4 +568,4 @@ const perPageOptions = [ padding: 0.5rem !important; } } - + \ No newline at end of file diff --git a/start/rules/file_scan.ts b/start/rules/file_scan.ts index 8003a9d..71bb8b1 100644 --- a/start/rules/file_scan.ts +++ b/start/rules/file_scan.ts @@ -45,8 +45,8 @@ async function scanFileForViruses(filePath: string | undefined, options: Options active: true, // If true, this module will consider using the clamdscan binary host: options.host, // IP of host to connect to TCP interface, port: options.port, // Port of host to use when connecting to TCP interface - socket: '/var/run/clamav/clamd.socket', // Socket file for connecting via socket - localFallback: false, // Use local clamscan binary if socket/tcp fails + // socket: '/var/run/clamav/clamd.socket', // Socket file for connecting via socket + // localFallback: false, // Use local clamscan binary if socket/tcp fails // port: options.port, multiscan: true, // Scan using all available cores! Yay! },