-
Notifications
You must be signed in to change notification settings - Fork 332
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1892 from jplag/report-viewer/min-version-toast
Add toast for new version notification
- Loading branch information
Showing
11 changed files
with
147 additions
and
80 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 was deleted.
Oops, something went wrong.
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,45 @@ | ||
<template> | ||
<div | ||
class="absolute bottom-5 left-5 max-w-96 rounded-md border-2 border-accent-dark bg-container-light dark:bg-container-dark" | ||
v-if="timePassed < timeToLive && visible" | ||
> | ||
<div class="flex"> | ||
<div class="flex-grow p-2"> | ||
<slot></slot> | ||
</div> | ||
<div class="cursor-pointer p-1" @click="visible = false"> | ||
<FontAwesomeIcon :icon="faTimes" /> | ||
</div> | ||
</div> | ||
<div | ||
class="h-1 bg-accent" | ||
:style="{ width: `${100 - (timePassed / timeToLive) * 100}%` }" | ||
></div> | ||
</div> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome' | ||
import { ref } from 'vue' | ||
import { faTimes } from '@fortawesome/free-solid-svg-icons' | ||
const props = defineProps({ | ||
timeToLive: { | ||
type: Number, | ||
required: false, | ||
default: 5000 | ||
} | ||
}) | ||
const timePassed = ref(0) | ||
const visible = ref(true) | ||
const intervalTime = 20 | ||
const intervalID = setInterval(() => { | ||
timePassed.value += intervalTime | ||
if (timePassed.value >= props.timeToLive) { | ||
clearInterval(intervalID) | ||
} | ||
}, intervalTime) | ||
</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
40 changes: 40 additions & 0 deletions
40
report-viewer/src/components/VersionRepositoryReference.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<template> | ||
<div | ||
:class="{ | ||
'absolute bottom-1 left-5 space-x-2 text-xs text-black dark:text-white print:hidden': | ||
overrideStyle | ||
}" | ||
> | ||
<span | ||
v-if="!reportViewerVersion.isDevVersion() && !reportViewerVersion.isInvalid() && showVersion" | ||
>JPlag v{{ reportViewerVersion.toString() }}</span | ||
> | ||
<span> | ||
JPlag is open source. Bug reports and feature requests can be submitted on | ||
<a | ||
href="https://github.com/jplag/JPlag/issues" | ||
class="text-link-dark underline dark:text-link" | ||
><FontAwesomeIcon :icon="faGithub" /> GitHub</a | ||
> | ||
</span> | ||
</div> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome' | ||
import { faGithub } from '@fortawesome/free-brands-svg-icons' | ||
import { reportViewerVersion } from '@/model/Version' | ||
defineProps({ | ||
overrideStyle: { | ||
type: Boolean, | ||
required: false, | ||
default: true | ||
}, | ||
showVersion: { | ||
type: Boolean, | ||
required: false, | ||
default: true | ||
} | ||
}) | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"report_viewer_version": { | ||
"major": 0, | ||
"major": 5, | ||
"minor": 0, | ||
"patch": 0 | ||
}, | ||
|
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