-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
61e5df9
commit b84a874
Showing
8 changed files
with
153 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<!-- | ||
Copyright 2024 ODK Central Developers | ||
See the NOTICE file at the top-level directory of this distribution and at | ||
https://github.com/getodk/central-frontend/blob/master/NOTICE. | ||
|
||
This file is part of ODK Central. It is subject to the license terms in | ||
the LICENSE file found in the top-level directory of this distribution and at | ||
https://www.apache.org/licenses/LICENSE-2.0. No part of ODK Central, | ||
including this file, may be copied, modified, propagated, or distributed | ||
except according to the terms contained in the LICENSE file. | ||
--> | ||
<template> | ||
<hover-card icon="file"> | ||
<template #title>{{ submission.instanceNameOrId }}</template> | ||
<template #subtitle>{{ $t('resource.submission') }}</template> | ||
<template #body> | ||
<dl class="dl-horizontal dl-horizontal-fixed"> | ||
<dt>{{ $t('resource.form') }}</dt> | ||
<dd>{{ form.nameOrId }}</dd> | ||
|
||
<dt>{{ $t('header.submitterName') }}</dt> | ||
<dd>{{ submission.__system.submitterName }}</dd> | ||
|
||
<dt>{{ $t('header.submissionDate') }}</dt> | ||
<dd><date-time :iso="submission.__system.submissionDate"/></dd> | ||
|
||
<dt>{{ $t('common.lastUpdate') }}</dt> | ||
<dd><date-time :iso="updatedOrCreatedAt"/></dd> | ||
</dl> | ||
</template> | ||
</hover-card> | ||
</template> | ||
|
||
<script setup> | ||
import { computed } from 'vue'; | ||
|
||
import DateTime from '../date-time.vue'; | ||
import HoverCard from '../hover-card.vue'; | ||
|
||
import { useRequestData } from '../../request-data'; | ||
|
||
defineOptions({ | ||
name: 'HoverCardSubmission' | ||
}); | ||
|
||
const { form, submission } = useRequestData(); | ||
|
||
const updatedOrCreatedAt = computed(() => { | ||
const { __system } = submission; | ||
return __system.updatedAt ?? __system.submissionDate; | ||
}); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<!-- | ||
Copyright 2024 ODK Central Developers | ||
See the NOTICE file at the top-level directory of this distribution and at | ||
https://github.com/getodk/central-frontend/blob/master/NOTICE. | ||
|
||
This file is part of ODK Central. It is subject to the license terms in | ||
the LICENSE file found in the top-level directory of this distribution and at | ||
https://www.apache.org/licenses/LICENSE-2.0. No part of ODK Central, | ||
including this file, may be copied, modified, propagated, or distributed | ||
except according to the terms contained in the LICENSE file. | ||
--> | ||
<template> | ||
<router-link ref="link" :key="to" :to="to"> | ||
{{ submission.currentVersion.instanceName ?? submission.instanceId }} | ||
</router-link> | ||
</template> | ||
|
||
<script setup> | ||
import { computed, ref } from 'vue'; | ||
|
||
import useHoverCard from '../../composables/hover-card'; | ||
import useRoutes from '../../composables/routes'; | ||
|
||
defineOptions({ | ||
name: 'SubmissionLink' | ||
}); | ||
const props = defineProps({ | ||
projectId: { | ||
type: [Number, String], | ||
required: true | ||
}, | ||
xmlFormId: { | ||
type: String, | ||
required: true | ||
}, | ||
// A submission in the format of a REST API response (not OData) | ||
submission: { | ||
type: Object, | ||
required: true | ||
} | ||
}); | ||
|
||
const { submissionPath } = useRoutes(); | ||
const to = computed(() => | ||
submissionPath(props.projectId, props.xmlFormId, props.submission.instanceId)); | ||
|
||
const link = ref(null); | ||
useHoverCard(computed(() => link.value?.$el), 'submission', () => ({ | ||
projectId: props.projectId, | ||
xmlFormId: props.xmlFormId, | ||
instanceId: props.submission.instanceId | ||
})); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters