Skip to content

Commit d1a0cd1

Browse files
committed
fix error and update README.md
1 parent c677279 commit d1a0cd1

File tree

10 files changed

+52
-53
lines changed

10 files changed

+52
-53
lines changed

README.md

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,18 @@
11
This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app).
22

3-
## Getting Started
3+
# TraceView 2
4+
5+
TraceView 2 is a web-based visualization tool designed to enhance the capabilities of
6+
[ARDoCo](https://github.com/ardoco/ardoco). \
7+
It provides a clear, visual way to explore tracelinks and find inconsistencies between software architecture models and
8+
documentation in software projects.
9+
10+
It is built using Next.js and React.
411

5-
First, run the development server:
612

7-
```bash
8-
npm run dev
9-
# or
10-
yarn dev
11-
# or
12-
pnpm dev
13-
# or
14-
bun dev
15-
```
1613

17-
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
1814

19-
You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.
2015

21-
This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel.
2216

2317
## Docker
2418

@@ -28,3 +22,5 @@ docker build -t traceview2 .
2822
docker run -p 3000:3000 traceview2
2923
```
3024

25+
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
26+

next.config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
import type { NextConfig } from "next";
1+
import type {NextConfig} from "next";
22

33
const nextConfig : NextConfig = {
44
/* config options here */
5+
output: 'standalone',
56
pageExtensions: ["mdx", "tsx", "ts"]
67
};
78
export default nextConfig;

src/app/layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const inter = Inter({subsets: ['latin']});
1414

1515
export const metadata: Metadata = { // those metadatas are the ones that are used for every page in the application. They can be overridden on a page by page basis.
1616
title: ' ArDoCo TraceView 2',
17-
description: 'This is a demo project',
17+
description: 'Is a web application for ARDoCo to visualize tracelinks and inconsistencies between software architecture models and documentation.',
1818
icons: {
1919
icon: '/ardoco-logo.png',
2020
}

src/app/view-provided/[id]/page.tsx

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ import {FileType} from "@/components/dataTypes/FileType";
88
import {HighlightProvider} from "@/contexts/HighlightTracelinksContextType";
99
import {ResultDisplay} from "@/components/traceLinksResultViewer/ResultDisplay";
1010
import {getTraceLinkTypeByName, TraceLinkType, TraceLinkTypes} from "@/components/dataTypes/TraceLinkTypes";
11-
import {ErrorDisplay} from "@/app/view/[id]/page";
1211
import {useNavigation} from "@/contexts/NavigationContext";
1312
import {InconsistencyProvider} from "@/contexts/HighlightInconsistencyContext";
1413
import {Inconsistency} from "@/components/traceLinksResultViewer/views/inconsistencies/dataModel/Inconsistency";
1514
import {
1615
parseInconsistenciesFromJSON
1716
} from "@/components/traceLinksResultViewer/views/inconsistencies/parser/InconsistencyParser";
1817
import {getResultViewOption} from "@/components/dataTypes/DisplayOption";
18+
import Button from "@/components/Button";
1919

2020
interface TraceLinkResult {
2121
traceLinkType: TraceLinkType;
@@ -125,4 +125,25 @@ export default function ViewProvided() {
125125
</HighlightProvider>
126126
</>
127127
);
128+
}
129+
130+
function ErrorDisplay({message, onRetry, retryAllowed}: {
131+
message: string;
132+
onRetry: (signal: AbortSignal) => void;
133+
retryAllowed: boolean
134+
}) {
135+
const {controller} = useNavigation();
136+
137+
return (
138+
<div className="w-full bg-gray-100 text-gray-700 p-3 text-center font-semibold border-gray-300 animate-fade-in">
139+
{message}
140+
{retryAllowed && (
141+
<Button
142+
text="Retry"
143+
onButtonClicked={() => onRetry(controller.signal)}
144+
disabled={false}
145+
/>
146+
)}
147+
</div>
148+
);
128149
}

src/app/view/[id]/page.tsx

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import {useParams, useSearchParams} from "next/navigation";
44
import React, {useEffect, useMemo, useState} from "react";
55
import {ResultDisplay} from "@/components/traceLinksResultViewer/ResultDisplay";
66
import {getTraceLinkTypeByName, TraceLinkTypes} from "@/components/dataTypes/TraceLinkTypes";
7-
import Button from "@/components/Button";
87
import {HighlightProvider} from "@/contexts/HighlightTracelinksContextType";
98
import {parseTraceLinksFromJSON} from "@/components/traceLinksResultViewer/views/tracelinks/parser/TraceLinkParser";
109
import {TraceLink} from "@/components/traceLinksResultViewer/views/tracelinks/dataModel/TraceLink";
@@ -145,7 +144,6 @@ export default function NewUploadProject() {
145144
);
146145
}
147146

148-
149147
function LoadingBanner() {
150148
return (
151149
<div className="w-full bg-gray-100 text-gray-700 p-3 text-center font-semibold border-gray-300 animate-fade-in">
@@ -154,23 +152,3 @@ function LoadingBanner() {
154152
);
155153
}
156154

157-
export function ErrorDisplay({message, onRetry, retryAllowed}: {
158-
message: string;
159-
onRetry: (signal: AbortSignal) => void;
160-
retryAllowed: boolean
161-
}) {
162-
const {controller} = useNavigation();
163-
164-
return (
165-
<div className="w-full bg-gray-100 text-gray-700 p-3 text-center font-semibold border-gray-300 animate-fade-in">
166-
{message}
167-
{retryAllowed && (
168-
<Button
169-
text="Retry"
170-
onButtonClicked={() => onRetry(controller.signal)}
171-
disabled={false}
172-
/>
173-
)}
174-
</div>
175-
);
176-
}
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
export enum MessageSource {
2-
TRACELINK_ONLY,
3-
ELEMENT_CLICK,
4-
INCONSISTENCY_ONLY,
2+
TRACELINK,
3+
PROVIDED_PROJECT_ELEMENT,
4+
/** e.g. a code element, a sentence from Documentation or an element from an architecture Element */
5+
INCONSISTENCY,
56
NONE
67
}

src/components/inputComponents/TextInput.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ interface TextInputProps {
99
export default function TextInput({placeholderText, value, onChange}: TextInputProps) {
1010
return (
1111
<input
12+
id={"project-name"}
1213
type="text"
1314
value={value}
1415
onChange={onChange}

src/components/traceLinksResultViewer/SearchResultMessage.tsx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,15 @@ export function SearchResultMessage({displayOptions}: SearchResultMessageProps)
4141

4242
const source =
4343
traceLinkTimestamp > inconsistencyTimestamp
44-
? traceLinkSource || MessageSource.ELEMENT_CLICK
44+
? traceLinkSource || MessageSource.TRACELINK
4545
: inconsistencyTimestamp > traceLinkTimestamp
46-
? inconsistencySource || MessageSource.ELEMENT_CLICK
47-
: traceLinkTimestamp > 0 ? MessageSource.ELEMENT_CLICK : MessageSource.NONE;
46+
? inconsistencySource || MessageSource.PROVIDED_PROJECT_ELEMENT
47+
: traceLinkTimestamp > 0 ? MessageSource.PROVIDED_PROJECT_ELEMENT : MessageSource.NONE;
4848

4949
const parts: MessagePart[] = [];
5050

51-
if (source === MessageSource.TRACELINK_ONLY && displayTraceLinks) {
51+
52+
if (source == MessageSource.TRACELINK && displayTraceLinks) {
5253
parts.push(
5354
{
5455
text: traceCount === 0 ? 'no traceLinks' :
@@ -57,7 +58,7 @@ export function SearchResultMessage({displayOptions}: SearchResultMessageProps)
5758
},
5859
{text: ' found.', type: 'normal'}
5960
);
60-
} else if (source === MessageSource.INCONSISTENCY_ONLY && displayInconsistencies) {
61+
} else if (source === MessageSource.INCONSISTENCY && displayInconsistencies) {
6162
parts.push(
6263
{
6364
text: inconsistencyCount === 0 ? 'no inconsistencies' :
@@ -66,7 +67,7 @@ export function SearchResultMessage({displayOptions}: SearchResultMessageProps)
6667
},
6768
{text: ' found.', type: 'normal'}
6869
);
69-
} else if (source === MessageSource.ELEMENT_CLICK) {
70+
} else if (source === MessageSource.PROVIDED_PROJECT_ELEMENT) {
7071
if (displayTraceLinks) {
7172
parts.push({
7273
text: traceCount === 0 ? 'no traceLinks' :

src/contexts/HighlightInconsistencyContext.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ export function InconsistencyProvider({
7575
return;
7676
}
7777
setHighlightedInconsistencies([inconsistency]);
78-
setMessageSource(MessageSource.INCONSISTENCY_ONLY);
78+
setMessageSource(MessageSource.INCONSISTENCY);
7979
setLastSearchTimestamp(Date.now());
8080
setLastClickedSource(inconsistency.id, DisplayOption.INCONSISTENCIES);
8181
}
@@ -93,7 +93,7 @@ export function InconsistencyProvider({
9393
setHighlightedInconsistencies([]);
9494
console.warn(`No inconsistency found for sentence number ${sentence}`);
9595
}
96-
setMessageSource(MessageSource.ELEMENT_CLICK);
96+
setMessageSource(MessageSource.PROVIDED_PROJECT_ELEMENT);
9797
setLastSearchTimestamp(Date.now());
9898
setLastClickedSource(sentence, DisplayOption.DOCUMENTATION);
9999
}
@@ -110,7 +110,7 @@ export function InconsistencyProvider({
110110
setHighlightedInconsistencies([]);
111111
console.warn(`No inconsistency found for model element ID ${modelElementId}`);
112112
}
113-
setMessageSource(MessageSource.ELEMENT_CLICK);
113+
setMessageSource(MessageSource.PROVIDED_PROJECT_ELEMENT);
114114
setLastSearchTimestamp(Date.now());
115115
setLastClickedSource(modelElementId, DisplayOption.ARCHITECTURE_MODEL);
116116
}

src/contexts/HighlightTracelinksContextType.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export function HighlightProvider({
7474
}
7575

7676
setHighlightedTraceLinks(matchingTraceLinks);
77-
setMessageSource(MessageSource.ELEMENT_CLICK);
77+
setMessageSource(MessageSource.PROVIDED_PROJECT_ELEMENT);
7878
setLastSearchTimestamp(Date.now());
7979
setLastClickedSource({id, type});
8080
};
@@ -84,7 +84,7 @@ export function HighlightProvider({
8484
return;
8585
}
8686
setHighlightedTraceLinks([traceLink]);
87-
setMessageSource(MessageSource.TRACELINK_ONLY);
87+
setMessageSource(MessageSource.TRACELINK);
8888
setLastSearchTimestamp(Date.now());
8989
setLastClickedSource({id: traceLink.id, type: DisplayOption.TRACELINKS});
9090
}

0 commit comments

Comments
 (0)