forked from jplag/JPlag
-
Notifications
You must be signed in to change notification settings - Fork 1
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 jplag#1320 from jplag/report-viewer/view-wrapper
Wrapper for async Views
- Loading branch information
Showing
12 changed files
with
219 additions
and
59 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,18 @@ | ||
<template> | ||
<div> | ||
<div | ||
class="mx-auto h-16 w-16 animate-spin rounded-full border-8 border-interactable-border-light border-t-accent dark:border-interactable-border-dark dark:border-t-accent" | ||
></div> | ||
<p class="text-2xl font-bold">{{ message }}</p> | ||
</div> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
defineProps({ | ||
message: { | ||
type: String, | ||
required: false, | ||
default: 'Loading Files...' | ||
} | ||
}) | ||
</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,32 @@ | ||
<template> | ||
<ClusterView v-if="overview" :overview="overview" :cluster="overview.clusters[clusterIndex]" /> | ||
<div | ||
v-else | ||
class="absolute bottom-0 left-0 right-0 top-0 flex flex-col items-center justify-center" | ||
> | ||
<LoadingCircle class="mx-auto" /> | ||
</div> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { type Ref, ref, computed } from 'vue' | ||
import { OverviewFactory } from '@/model/factories/OverviewFactory' | ||
import ClusterView from '@/views/ClusterView.vue' | ||
import LoadingCircle from '@/components/LoadingCircle.vue' | ||
import type { Overview } from '@/model/Overview' | ||
const props = defineProps({ | ||
clusterIndex: { | ||
type: String, | ||
required: true | ||
} | ||
}) | ||
const clusterIndex = computed(() => parseInt(props.clusterIndex)) | ||
const overview: Ref<Overview | null> = ref(null) | ||
OverviewFactory.getOverview().then((o) => { | ||
overview.value = o | ||
}) | ||
</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 |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<template> | ||
<ComparisonView | ||
v-if="comparison && language" | ||
:first-id="firstId" | ||
:second-id="secondId" | ||
:comparison="comparison" | ||
:language="language" | ||
/> | ||
<div | ||
v-else | ||
class="absolute bottom-0 left-0 right-0 top-0 flex flex-col items-center justify-center" | ||
> | ||
<LoadingCircle class="mx-auto" /> | ||
</div> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { type Ref, ref } from 'vue' | ||
import { OverviewFactory } from '@/model/factories/OverviewFactory' | ||
import ComparisonView from '@/views/ComparisonView.vue' | ||
import { getHighlightLanguage, type HighlightLanguage } from '@/model/Language' | ||
import type { Comparison } from '@/model/Comparison' | ||
import { ComparisonFactory } from '@/model/factories/ComparisonFactory' | ||
import LoadingCircle from '@/components/LoadingCircle.vue' | ||
const props = defineProps({ | ||
firstId: { | ||
type: String, | ||
required: true | ||
}, | ||
secondId: { | ||
type: String, | ||
required: true | ||
} | ||
}) | ||
const comparison: Ref<Comparison | null> = ref(null) | ||
const language: Ref<HighlightLanguage | null> = ref(null) | ||
// This eslint rule is disabled to allow the use of await in the setup function. Disabling this rule is safe, because the props are gathered from the url, so changing them would reload the pafe anyway. | ||
// eslint-disable-next-line vue/no-setup-props-reactivity-loss | ||
ComparisonFactory.getComparison(props.firstId, props.secondId).then((comp) => { | ||
comparison.value = comp | ||
}) | ||
OverviewFactory.getOverview().then((overview) => { | ||
language.value = getHighlightLanguage(overview.language) | ||
}) | ||
</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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<template> | ||
<InformationView v-if="overview" :overview="overview" /> | ||
<div | ||
v-else | ||
class="absolute bottom-0 left-0 right-0 top-0 flex flex-col items-center justify-center" | ||
> | ||
<LoadingCircle class="mx-auto" /> | ||
</div> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { type Ref, ref } from 'vue' | ||
import { OverviewFactory } from '@/model/factories/OverviewFactory' | ||
import InformationView from '@/views/InformationView.vue' | ||
import type { Overview } from '@/model/Overview' | ||
import LoadingCircle from '@/components/LoadingCircle.vue' | ||
const overview: Ref<Overview | null> = ref(null) | ||
OverviewFactory.getOverview().then((o) => { | ||
overview.value = o | ||
}) | ||
</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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<template> | ||
<OverviewView v-if="overview" :overview="overview" /> | ||
<div | ||
v-else | ||
class="absolute bottom-0 left-0 right-0 top-0 flex flex-col items-center justify-center" | ||
> | ||
<LoadingCircle class="mx-auto" /> | ||
</div> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { type Ref, ref } from 'vue' | ||
import { OverviewFactory } from '@/model/factories/OverviewFactory' | ||
import OverviewView from '@/views/OverviewView.vue' | ||
import type { Overview } from '@/model/Overview' | ||
import LoadingCircle from '@/components/LoadingCircle.vue' | ||
const overview: Ref<Overview | null> = ref(null) | ||
OverviewFactory.getOverview().then((o) => { | ||
overview.value = o | ||
}) | ||
</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
Oops, something went wrong.