Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into report-viewer/clus…
Browse files Browse the repository at this point in the history
…ter-graph
  • Loading branch information
Kr0nox committed Oct 2, 2023
2 parents c3c84bd + 9149f42 commit c3baddd
Show file tree
Hide file tree
Showing 19 changed files with 292 additions and 110 deletions.
2 changes: 1 addition & 1 deletion cli/src/main/java/de/jplag/cli/CliOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public class CliOptions implements Runnable {
"--result-directory"}, description = "Name of the directory in which the comparison results will be stored (default: result)%n")
public String resultFolder = "results";

@ArgGroup(heading = "Advanced%n")
@ArgGroup(heading = "Advanced%n", exclusive = false)
public Advanced advanced = new Advanced();

@ArgGroup(validate = false, heading = "Clustering%n")
Expand Down
23 changes: 23 additions & 0 deletions cli/src/test/java/de/jplag/cli/AdvancedGroupTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package de.jplag.cli;

import static org.junit.jupiter.api.Assertions.assertEquals;

import java.util.Arrays;

import org.junit.jupiter.api.Test;

class AdvancedGroupTest extends CommandLineInterfaceTest {
private static final String SUFFIXES = ".sc,.scala";

private static final double SIMILARITY_THRESHOLD = 0.5;

/**
* Verify that it is possible to set multiple options in the "advanced" options group.
*/
@Test
void testNotExclusive() throws CliException {
buildOptionsFromCLI(defaultArguments().suffixes(SUFFIXES).similarityThreshold(SIMILARITY_THRESHOLD));
assertEquals(Arrays.stream(SUFFIXES.split(",")).toList(), options.fileSuffixes());
assertEquals(0.5, options.similarityThreshold());
}
}
2 changes: 1 addition & 1 deletion languages/scala/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<dependency>
<groupId>org.scalameta</groupId>
<artifactId>scalameta_${scala.compat.version}</artifactId>
<version>4.8.10</version>
<version>4.8.11</version>
</dependency>
</dependencies>

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
<dependency>
<groupId>edu.stanford.nlp</groupId>
<artifactId>stanford-corenlp</artifactId>
<version>4.5.4</version>
<version>4.5.5</version>
</dependency>

<!-- LOGGER -->
Expand Down
82 changes: 41 additions & 41 deletions report-viewer/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions report-viewer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,21 @@
"vue": "^3.3.4",
"vue-chartjs": "^5.2.0",
"vue-draggable-next": "^2.2.1",
"vue-router": "^4.2.4",
"vue-router": "^4.2.5",
"vue-virtual-scroller": "^2.0.0-beta.8"
},
"devDependencies": {
"@playwright/test": "^1.38.0",
"@playwright/test": "^1.38.1",
"@rushstack/eslint-patch": "^1.4.0",
"@types/jsdom": "^21.1.3",
"@types/node": "^18.11.9",
"@types/node": "^18.18.0",
"@vitejs/plugin-vue": "^4.3.4",
"@vue/eslint-config-prettier": "^8.0.0",
"@vue/eslint-config-typescript": "^11.0.3",
"@vue/test-utils": "^2.4.1",
"@vue/tsconfig": "^0.4.0",
"autoprefixer": "^10.4.15",
"eslint": "^8.49.0",
"eslint": "^8.50.0",
"eslint-plugin-vue": "^9.17.0",
"husky": "^8.0.0",
"jsdom": "^22.1.0",
Expand All @@ -58,6 +58,6 @@
"typescript": "^5.2.2",
"vite": "^4.4.9",
"vitest": "^0.34.4",
"vue-tsc": "^1.8.11"
"vue-tsc": "^1.8.15"
}
}
4 changes: 1 addition & 3 deletions report-viewer/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
<div
class="max-w-screen max-h-fit min-h-screen bg-backgorund-light text-black dark:bg-backgorund-dark dark:text-amber-50"
>
<Suspense>
<RouterView class="max-h-screen overflow-hidden" />
</Suspense>
<RouterView class="max-h-screen overflow-hidden" />

<Button
class="absolute bottom-2 right-2 flex h-12 w-12 items-center justify-center text-center"
Expand Down
2 changes: 1 addition & 1 deletion report-viewer/src/components/FilesContainer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
!matches.get(file.fileName) ? [] : (matches.get(file.fileName) as MatchInSingleFile[])
"
:highlight-language="highlightLanguage"
@line-selected="(match) => $emit('line-selected', match)"
@line-selected="(match) => $emit('lineSelected', match)"
class="mt-1"
/>
</VueDraggableNext>
Expand Down
18 changes: 18 additions & 0 deletions report-viewer/src/components/LoadingCircle.vue
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>
16 changes: 8 additions & 8 deletions report-viewer/src/router/index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { createRouter, createWebHistory } from 'vue-router'
import FileUploadView from '@/views/FileUploadView.vue'
import OverviewView from '@/views/OverviewView.vue'
import ComparisonView from '@/views/ComparisonView.vue'
import OverviewViewWrapper from '@/viewWrapper/OverviewViewWrapper.vue'
import ComparisonViewWrapper from '@/viewWrapper/ComparisonViewWrapper.vue'
import ErrorView from '@/views/ErrorView.vue'
import ClusterView from '@/views/ClusterView.vue'
import InformationView from '@/views/InformationView.vue'
import InformationViewWrapper from '@/viewWrapper/InformationViewWrapper.vue'
import ClusterViewWrapper from '@/viewWrapper/ClusterViewWrapper.vue'

/**
* The router is used to navigate between the different views of the application.
Expand All @@ -20,12 +20,12 @@ const router = createRouter({
{
path: '/overview',
name: 'OverviewView',
component: OverviewView
component: OverviewViewWrapper
},
{
path: '/comparison/:firstId/:secondId',
name: 'ComparisonView',
component: ComparisonView,
component: ComparisonViewWrapper,
props: true
},
{
Expand All @@ -36,13 +36,13 @@ const router = createRouter({
{
path: '/cluster/:clusterIndex',
name: 'ClusterView',
component: ClusterView,
component: ClusterViewWrapper,
props: true
},
{
path: '/info',
name: 'InfoView',
component: InformationView
component: InformationViewWrapper
}
]
})
Expand Down
32 changes: 32 additions & 0 deletions report-viewer/src/viewWrapper/ClusterViewWrapper.vue
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>
Loading

0 comments on commit c3baddd

Please sign in to comment.