feat(doc-item): Vereinfachung der Darstellung von Änderungsinformationen durch neue Utility-Methode

- Ersetzte die separate Verwendung von `changedWho` und `changedWhen` durch die neue Methode `getChangedInfo()` in der Klasse `Doc`.
- Aktualisiertes Symbol für `addedWho` von ‚gridicons:add‘ zu ‚mdi:user‘.
This commit is contained in:
tekh 2025-07-11 14:31:16 +02:00
parent 93fec2051b
commit 960c4db1ac
2 changed files with 14 additions and 4 deletions

View File

@ -16,6 +16,17 @@ export class Doc {
changedWhen?: Date; changedWhen?: Date;
changedWho?: string; changedWho?: string;
getChangedInfo(separator: string = " | "): string | null {
const who = this.changedWho?.trim();
const when = this.changedWhen?.toLocaleDateString('de-DE');
if (!who && !when) {
return null;
}
return [who, when].filter(Boolean).join(separator);
}
get extension(): string | undefined { get extension(): string | undefined {
const parts = this.name.split('.'); const parts = this.name.split('.');
if (parts.length > 1 && parts[parts.length - 1].trim() !== '') { if (parts.length > 1 && parts[parts.length - 1].trim() !== '') {

View File

@ -43,7 +43,7 @@ export function DocItem({
// /> // />
// ); // );
//#endregion //#endregion
const renderTitle = ( const renderTitle = (
<Link <Link
color="inherit" color="inherit"
@ -77,9 +77,8 @@ export function DocItem({
}} }}
> >
{[ {[
{ data: doc.addedWho, icon: 'gridicons:add' }, { data: doc.addedWho, icon: 'mdi:user' },
{ data: doc.changedWho, icon: 'material-symbols:change-circle-rounded' }, { data: doc.getChangedInfo(', '), icon: 'material-symbols:change-circle-rounded' }
{ data: doc.changedWhen?.toLocaleDateString('de-DE'), icon: 'material-symbols:change-circle-rounded' },
].filter(info => info.data).map((info, _index) => ( ].filter(info => info.data).map((info, _index) => (
<Box <Box
key={_index} key={_index}