Skip to content

Commit 76d9e24

Browse files
UI - feedbackpoints fixed (#16858) and code cleanup
1 parent 43d24b3 commit 76d9e24

25 files changed

Lines changed: 532 additions & 1695 deletions

src/ContentProcessorWeb/src/App.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import * as React from "react";
22
import { useEffect } from "react";
33
import Header from "./Components/Header/Header.tsx"; // Import Header
44
import "./Styles/App.css";
5-
import "./Components/Content/Content.css";
65
import HomePage from "./Pages/HomePage.tsx";
76
import DefaultPage from "./Pages/DefaultPage";
87
//import AuxiliaryPage from "./Pages/AuxiliaryPage/AuxiliaryPage.tsx";

src/ContentProcessorWeb/src/Components/Content/Content.css

Lines changed: 0 additions & 19 deletions
This file was deleted.

src/ContentProcessorWeb/src/Components/Content/Content.tsx

Lines changed: 0 additions & 52 deletions
This file was deleted.

src/ContentProcessorWeb/src/Components/DialogComponent/DialogComponent.tsx

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,8 @@ import {
1010
useId,
1111
} from "@fluentui/react-components";
1212

13-
interface FooterButton {
14-
text: string;
15-
appearance: "primary" | "secondary";
16-
onClick: () => void;
17-
}
13+
import { ConfirmationProps } from './DialogComponentTypes'
1814

19-
interface ConfirmationProps {
20-
title: string;
21-
content: string;
22-
isDialogOpen: boolean; // Controlled state for dialog visibility
23-
onDialogClose: () => void; // Function to close the dialog
24-
footerButtons: FooterButton[]; // Array of footer buttons
25-
}
2615

2716
export const Confirmation: React.FC<ConfirmationProps> = ({
2817
title,
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
2+
import { ReactNode } from 'react';
3+
4+
interface FooterButton {
5+
text: string;
6+
appearance: "primary" | "secondary";
7+
onClick: () => void;
8+
}
9+
10+
export interface ConfirmationProps {
11+
title: string;
12+
content: string | ReactNode;
13+
isDialogOpen: boolean; // Controlled state for dialog visibility
14+
onDialogClose: () => void; // Function to close the dialog
15+
footerButtons: FooterButton[]; // Array of footer buttons
16+
}

src/ContentProcessorWeb/src/Components/DocumentViewer/DocumentViewer.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import React, { useEffect, useState } from "react";
22
import { useTranslation } from "react-i18next";
3-
import { Document } from "./DocumentViewer.types";
43
import { TIFFViewer } from 'react-tiff';
54
import './DocumentViewer.styles.scss';
65

@@ -107,7 +106,7 @@ const DocumentViewer = ({ className, metadata, urlWithSasToken, iframeKey }: IIF
107106
<div className={"invalidImagePopup"}>
108107
<span className="imgEH">We can't open this file</span>
109108
<p className="imgCtn">Something went wrong.</p>
110-
</div>
109+
</div>
111110
: getContentComponent()
112111
}
113112
</div>

src/ContentProcessorWeb/src/Components/DocumentViewer/DocumentViewer.types.ts

Lines changed: 0 additions & 88 deletions
This file was deleted.

src/ContentProcessorWeb/src/Components/Header/Header.tsx

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import {
2626
} from "../../Imports/bundleIcons.tsx";
2727
import MainLogo from "../../Imports/MainLogo.svg";
2828
import "./Header.css";
29-
import { DocumentBulletListCubeRegular, InfoRegular} from "@fluentui/react-icons"
29+
import { DocumentBulletListCubeRegular, InfoRegular, DocumentData16Regular } from "@fluentui/react-icons"
3030

3131
import useAuth from "../../msal-auth/useAuth.ts";
3232

@@ -41,6 +41,12 @@ const tabConfigs = [
4141
value: "default", // Route path defined in App.tsx
4242
label: "Content", // Visible label on UI
4343
},
44+
45+
{
46+
icon: <DocumentBulletListCubeRegular />, // Import bundle icon
47+
value: "api", // Route path defined in App.tsx
48+
label: "API Documentation", // Visible label on UI
49+
},
4450
// Add more
4551
];
4652

@@ -69,12 +75,18 @@ const HeaderPage: React.FC<HeaderPageProps> = ({ toggleTheme, isDarkMode }) => {
6975
_: React.SyntheticEvent,
7076
data: { value: TabValue }
7177
) => {
72-
const newRoute = Object.keys(tabRoutes).find(
73-
(key) => tabRoutes[key] === data.value
74-
);
75-
if (newRoute) {
76-
navigate(newRoute);
78+
if (data.value == 'api') {
79+
_.preventDefault(); // Prevents the default anchor click behavior
80+
window.open(process.env.REACT_APP_API_BASE_URL + "/docs", '_blank', 'noopener noreferrer');
81+
} else {
82+
const newRoute = Object.keys(tabRoutes).find(
83+
(key) => tabRoutes[key] === data.value
84+
);
85+
if (newRoute) {
86+
navigate(newRoute);
87+
}
7788
}
89+
7890
};
7991

8092

@@ -100,8 +112,8 @@ const HeaderPage: React.FC<HeaderPageProps> = ({ toggleTheme, isDarkMode }) => {
100112
</TabList>
101113
</div>
102114
<div className="headerTag">
103-
<InfoRegular style={{ marginRight: "4px" }}/>
104-
<span>AI-generated content may be incorrect</span>
115+
<InfoRegular style={{ marginRight: "4px" }} />
116+
<span>AI-generated content may be incorrect</span>
105117
</div>
106118

107119
{/* Tools Section */}

0 commit comments

Comments
 (0)