(profile) display card creation date next to last modification

This commit is contained in:
Andrea Vos 2024-11-09 13:46:00 +01:00
parent 008d5c7520
commit 34a49b0750
7 changed files with 20 additions and 9 deletions

View File

@ -196,10 +196,16 @@
<section>
<OpinionLegend :custom="profile.opinions" :used="usedOpinions" />
<p v-if="!isStatic && profile.lastUpdate" class="text-muted small text-center">
<T>profile.lastUpdate</T><T>quotation.colon</T>
{{ $date($ulidTime(profile.lastUpdate)) }}
</p>
<ul v-if="!isStatic" class="list-inline text-muted small text-center">
<li v-if="profile.id" class="list-inline-item">
<T>profile.creation</T><T>quotation.colon</T>
{{ $date($ulidTime(profile.id)) }}
</li>
<li v-if="profile.lastUpdate" class="list-inline-item">
<T>profile.lastUpdate</T><T>quotation.colon</T>
{{ $date($ulidTime(profile.lastUpdate)) }}
</li>
</ul>
</section>
</div>
</template>

View File

@ -902,6 +902,7 @@ profile:
invalidDate: 'Provided date is not valid'
publicEvents:
header: 'Events from the Queer Calendar'
creation: 'Card created'
lastUpdate: 'Card last updated'
share: 'Share'

View File

@ -1104,6 +1104,7 @@ profile:
invalidDate: 'Provided date is not valid'
publicEvents:
header: 'Events from the Queer Calendar'
creation: 'Card created'
lastUpdate: 'Card last updated'
share: 'Share'

View File

@ -1728,7 +1728,8 @@ profile:
invalidDate: 'Podana data nie jest poprawna'
publicEvents:
header: 'Wydarzenia z Kalendarza Queerowego'
lastUpdate: 'Ostatnia aktualizacja wizytówki'
creation: 'Wizytówka stworzona'
lastUpdate: 'Ostatnia modyfikacja wizytówki'
census:
header: 'Spis'

View File

@ -400,7 +400,7 @@ import type { Translator } from '~/src/translator.ts';
import { useMainStore } from '~/store/index.ts';
interface ProfileFormData extends Omit<Profile, 'birthday' | 'linksMetadata' | 'verifiedLinks' | 'opinions' |
'card' | 'cardDark' | 'lastUpdate'> {
'card' | 'cardDark' | 'lastUpdate' | 'id'> {
birthday: Date | null;
opinions: OpinionFormValue[];
}

View File

@ -325,6 +325,7 @@ const fetchProfiles = async (
}) ?? {};
const profile_obj: Partial<Profile> = {
id: propv('id', () => profile.id),
opinions: propv('opinions', () => JSON.parse(profile.opinions)),
names: propv('names', () => {
return JSON.parse(profile.names).map((name: ValueOpinion) => {
@ -618,7 +619,7 @@ const cleanupOpinions = (opinions: OpinionFormValue[]) => {
};
type SaveProfile = Omit<Profile, 'linksMetadata' | 'verifiedLinks' | 'footerAreas' | 'credentials' |
'card' | 'cardDark' | 'circle' | 'markdown' | 'events' | 'customEvents' | 'lastUpdate'>
'card' | 'cardDark' | 'circle' | 'markdown' | 'events' | 'customEvents' | 'lastUpdate' | 'id'>
& Partial<Pick<Profile, 'markdown' | 'events' | 'customEvents'>>
& Pick<ProfileRow, 'footerAreas' | 'credentials'>;
@ -1010,7 +1011,7 @@ interface ProfileExportData {
}
type ProfileExportProfile = Omit<Profile, 'linksMetadata' | 'verifiedLinks' | 'footerAreas' | 'credentials' |
'card' | 'cardDark' | 'circle' | 'lastUpdate'>
'card' | 'cardDark' | 'circle' | 'lastUpdate' | 'id'>
& Pick<ProfileRow, 'footerAreas' | 'credentials'>;
router.get('/profile/export', handleErrorAsync(async (req: Request, res: Response) => {

View File

@ -2,6 +2,7 @@ import type { CustomEvent } from './calendar/helpers.ts';
import type { Opinion } from './opinions.ts';
export interface Profile {
id: string;
names: NameOpinion[];
pronouns: ValueOpinion[];
description: string;
@ -87,7 +88,7 @@ export interface ProfileV1 extends Omit<Profile, 'names' | 'pronouns' | 'words'
}
export interface SaveProfilePayload extends Omit<Profile, 'linksMetadata' | 'verifiedLinks' | 'opinions' |
'card' | 'cardDark' | 'lastUpdate'> {
'card' | 'cardDark' | 'lastUpdate' | 'id'> {
username: string;
opinions: OpinionFormValue[];
propagate: string[];