-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into fix/network-profile
- Loading branch information
Showing
44 changed files
with
1,243 additions
and
271 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
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 |
---|---|---|
@@ -1,56 +1,23 @@ | ||
<template> | ||
<span v-if="loading"><Spinner></Spinner></span> | ||
<span v-else-if="update"> | ||
<a :href="`/${this.schema}/settings/#/changelog`"> | ||
{{ formatStamp(update.stamp) }} ({{ update.tableName }}) | ||
<span> | ||
<a :href="`/${lastUpdate.schema}/settings/#/changelog`"> | ||
{{ timeStamp }} ({{ lastUpdate.tableName }}) | ||
</a> | ||
</span> | ||
<span v-else | ||
><em>{{ statusMessage }}</em></span | ||
> | ||
</template> | ||
|
||
<script> | ||
import { request } from "graphql-request"; | ||
import { Spinner } from "molgenis-components"; | ||
export default { | ||
name: "LastUpdateField", | ||
components: { Spinner }, | ||
props: { | ||
schema: { | ||
String, | ||
required: true, | ||
}, | ||
}, | ||
data() { | ||
return { | ||
update: null, | ||
loading: true, | ||
statusMessage: "", | ||
}; | ||
}, | ||
methods: { | ||
formatStamp(stamp) { | ||
const date = new Date(stamp); | ||
return date.toLocaleDateString(); | ||
}, | ||
}, | ||
async created() { | ||
const resp = await request( | ||
`/${this.schema}/settings/graphql`, | ||
"{_changes(limit: 1) {operation, stamp, userId, tableName}}" | ||
).catch((error) => { | ||
this.statusMessage = "failed to fetch updated"; | ||
console.log(error); | ||
}); | ||
<script setup lang="ts"> | ||
import { computed } from "vue"; | ||
this.update = resp ? resp["_changes"][0] : null; | ||
const props = defineProps<{ | ||
lastUpdate: { | ||
stamp: number; | ||
tableName: string; | ||
schema: string; | ||
}; | ||
}>(); | ||
if (this.update && this.update.stamp) { | ||
// emit timestamp for use in row sort | ||
this.$emit("input", this.update.stamp); | ||
} | ||
this.loading = false; | ||
}, | ||
}; | ||
const timeStamp = computed(() => { | ||
return new Date(props.lastUpdate.stamp).toLocaleDateString(); | ||
}); | ||
</script> |
4 changes: 3 additions & 1 deletion
4
...s/components/content/ContentBlockData.vue → ...r/components/content/ContentBlockData.vue
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
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
Oops, something went wrong.