feat: Extension getter zur Doc-Klasse hinzufügen, um die Dateierweiterung aus der Eigenschaft name abzurufen
This commit is contained in:
parent
24c3bf0324
commit
b9e6ff27db
@ -301,4 +301,4 @@ export const _documents: Doc[] = [
|
||||
addedWhen: new Date("2024-04-17T11:25:00Z"),
|
||||
addedWho: "SchreiberM"
|
||||
}
|
||||
];
|
||||
].map(doc => Object.assign(doc));
|
||||
@ -8,6 +8,14 @@ export class Doc {
|
||||
addedWho!: string;
|
||||
changedWhen?: Date;
|
||||
changedWho?: string;
|
||||
|
||||
get Extension(): string | undefined {
|
||||
const parts = this.name.split('.');
|
||||
if (parts.length > 1 && parts[parts.length - 1].trim() !== '') {
|
||||
return parts[parts.length - 1].toLowerCase();
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
|
||||
export type DocQuery = {
|
||||
|
||||
@ -6,11 +6,8 @@ import { varAlpha } from 'minimal-shared/utils';
|
||||
import Box from '@mui/material/Box';
|
||||
import Link from '@mui/material/Link';
|
||||
import Card from '@mui/material/Card';
|
||||
import Avatar from '@mui/material/Avatar';
|
||||
import Typography from '@mui/material/Typography';
|
||||
|
||||
import { fDate } from 'src/utils/format-time';
|
||||
|
||||
import { Doc } from 'src/api/document-service';
|
||||
|
||||
import { Iconify } from 'src/components/iconify';
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user