Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
3af852f
Add dompurify dependency
dileepapeiris Feb 13, 2026
e431032
Render slogan icons as components
dileepapeiris Feb 13, 2026
8a429d4
Use icon components for contact/stat cards
dileepapeiris Feb 13, 2026
994e088
Render stat icons; simplify click; remove test
dileepapeiris Feb 13, 2026
16be048
Remove case creation header and AI card
dileepapeiris Feb 13, 2026
77ffb93
Improve token refresh and support utils
dileepapeiris Feb 13, 2026
a2d725c
Remove projectDetailsConstants & adjust overflow
dileepapeiris Feb 13, 2026
3bafd8b
Refactor login constants; add project details
dileepapeiris Feb 13, 2026
4377316
Remove BasicInformationSection and tests
dileepapeiris Feb 13, 2026
84e8129
Remove CaseDetailsSection and tests
dileepapeiris Feb 13, 2026
04c01fa
Refactor case details UI and simplify click handler
dileepapeiris Feb 13, 2026
beb2e91
Use AssignedEngineerDisplay, delete skeleton, update tests
dileepapeiris Feb 13, 2026
6c40330
Add AssignedEngineerDisplay and use getInitials
dileepapeiris Feb 13, 2026
96b81ff
Remove rich-text-editor attachments & dialog
dileepapeiris Feb 13, 2026
49b4e83
Remove rich text editor component and tests
dileepapeiris Feb 13, 2026
9969d82
Remove ConversationSummary and text toolbar components
dileepapeiris Feb 13, 2026
9865a63
Remove legacy markdown and link popover components
dileepapeiris Feb 13, 2026
83b06be
Remove rich text editor components
dileepapeiris Feb 13, 2026
8005da4
Remove rich-text editor toolbar controls
dileepapeiris Feb 13, 2026
d393f78
Remove rich-text toolbar files; add comment tests
dileepapeiris Feb 13, 2026
bece5f7
Add case details tests; format upload modal
dileepapeiris Feb 13, 2026
bc8fc84
Add activity tab tests and fix panel test
dileepapeiris Feb 13, 2026
e88f4e8
Extract ActivityCommentInput & ChatMessageCard
dileepapeiris Feb 13, 2026
372ff74
Add CommentBubble component and attachment tests
dileepapeiris Feb 13, 2026
9c116a7
Extract AttachmentListItem and Skeleton components
dileepapeiris Feb 13, 2026
953da5b
Reformat icon ternary for readability
dileepapeiris Feb 13, 2026
288e004
Merge branch 'customer-portal-milestone-1' into feat/fix-case-create-…
dileepapeiris Feb 13, 2026
ff15e33
Allow initials from single first/last name
dileepapeiris Feb 13, 2026
16f9874
Merge branch 'feat/fix-case-create-id-issue' of https://github.com/di…
dileepapeiris Feb 13, 2026
4123dd5
Fix tests: add icon mocks and config cleanup
dileepapeiris Feb 13, 2026
2774ffd
Wrap tests with providers; adjust mocks and SLA logic
dileepapeiris Feb 13, 2026
4769de5
Update unit tests: mocks, assertions, loader
dileepapeiris Feb 13, 2026
7245511
Fix tests, mocks, and initials logic
dileepapeiris Feb 13, 2026
9e8f303
Improve tests: regex, icon mocks, fake timers
dileepapeiris Feb 13, 2026
4c6152e
Fix AllCasesPage tests for paginated totals
dileepapeiris Feb 13, 2026
610a7c3
Wrap ProjectDetails tests with QueryClientProvider
dileepapeiris Feb 13, 2026
0df7eba
Add test mocks and switch RTE placeholders to {{}}
dileepapeiris Feb 13, 2026
6e383a7
Enhance test mocks for providers and UI libs
dileepapeiris Feb 13, 2026
b530f3e
Add stub components for case creation layout
dileepapeiris Feb 13, 2026
dc394d8
Add ConversationSummary stub; relax tests
dileepapeiris Feb 13, 2026
95a604b
Implement case creation layout sections UI
dileepapeiris Feb 13, 2026
c9928e5
Add case creation form sections and tests
dileepapeiris Feb 13, 2026
5427043
Move case form sections and update imports
dileepapeiris Feb 13, 2026
8ecaf64
Fallback placeholder for missing issue type labels
dileepapeiris Feb 13, 2026
4b3e312
Filter out empty issue types from select
dileepapeiris Feb 13, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apps/customer-portal/webapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"@wso2/oxygen-ui": "^0.4.0",
"@wso2/oxygen-ui-charts-react": "^0.4.0",
"@wso2/oxygen-ui-icons-react": "^0.4.0",
"dompurify": "^3.3.1",
"react": "^19.2.0",
"react-dom": "^19.2.0",
"react-router": "^7.1.5",
Expand Down
16 changes: 16 additions & 0 deletions apps/customer-portal/webapp/pnpm-lock.yaml

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

Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ describe("useGetProjectSupportStats", () => {
resolvedChats: 0,
};

const originalConfig = (window as any).config;
(window as any).config = { CUSTOMER_PORTAL_BACKEND_BASE_URL: "https://api.test" };
vi.stubGlobal(
"fetch",
vi.fn().mockResolvedValue({
Expand All @@ -145,19 +147,25 @@ describe("useGetProjectSupportStats", () => {
},
);

await waitFor(() => expect(result.current.isSuccess).toBe(true));

expect(result.current.data).toEqual(mockResponse);
expect(mockGetIdToken).toHaveBeenCalled();
expect(mockLogger.debug).toHaveBeenCalledWith(
expect.stringContaining(
"Fetching support stats for project ID: project-1, mock: false",
),
);
try {
await waitFor(() => expect(result.current.isSuccess).toBe(true));

expect(result.current.data).toEqual(mockResponse);
expect(mockGetIdToken).toHaveBeenCalled();
expect(mockLogger.debug).toHaveBeenCalledWith(
expect.stringContaining(
"Fetching support stats for project ID: project-1, mock: false",
),
);
} finally {
(window as any).config = originalConfig;
}
});

it("should handle API error when mock is disabled", async () => {
mockIsMockEnabled = false;
const originalConfig = (window as any).config;
(window as any).config = { CUSTOMER_PORTAL_BACKEND_BASE_URL: "https://api.test" };
vi.stubGlobal(
"fetch",
vi.fn().mockResolvedValue({
Expand All @@ -179,6 +187,7 @@ describe("useGetProjectSupportStats", () => {
"Error fetching support stats: Internal Server Error",
);
expect(mockLogger.error).toHaveBeenCalled();
(window as any).config = originalConfig;
});

it("should not fetch if id is missing", () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,18 @@ vi.mock("@wso2/oxygen-ui", () => ({
),
}));

// Mock icons
vi.mock("@wso2/oxygen-ui-icons-react", () => ({
X: () => <span data-testid="icon-x" />,
}));
// Mock icons (include TriangleAlert for ErrorIndicator)
vi.mock("@wso2/oxygen-ui-icons-react", () => {
const mockIcon = (name: string) => () => <span data-testid={`icon-${name}`} />;
return {
Filter: mockIcon("Filter"),
Search: mockIcon("Search"),
X: () => <span data-testid="icon-x" />,
TriangleAlert: mockIcon("TriangleAlert"),
};
});

vi.mock("@/components/common/errorIndicator/ErrorIndicator", () => ({
vi.mock("@components/common/error-indicator/ErrorIndicator", () => ({
default: ({ entityName }: any) => (
<div data-testid="error-indicator">Error loading {entityName}</div>
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ vi.mock("@wso2/oxygen-ui", () => ({
},
}));

// Mock icons
// Mock icons (include TriangleAlert for ErrorIndicator)
vi.mock("@wso2/oxygen-ui-icons-react", () => ({
FolderOpen: () => <svg data-testid="icon-FolderOpen" />,
Info: () => <svg data-testid="icon-Info" />,
Expand All @@ -72,10 +72,11 @@ vi.mock("@wso2/oxygen-ui-icons-react", () => ({
Shield: () => <svg data-testid="icon-Shield" />,
Rocket: () => <svg data-testid="icon-Rocket" />,
CircleAlert: () => <svg data-testid="icon-CircleAlert" />,
TriangleAlert: () => <svg data-testid="icon-TriangleAlert" />,
}));

// Mock ErrorIndicator
vi.mock("@/components/common/errorIndicator/ErrorIndicator", () => ({
// Mock ErrorIndicator (path must match: @components/common/error-indicator)
vi.mock("@components/common/error-indicator/ErrorIndicator", () => ({
default: ({ entityName }: any) => (
<div data-testid="error-indicator">Error: {entityName}</div>
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ vi.mock("@wso2/oxygen-ui", () => ({
},
}));

// Mock icons
// Mock icons (include TriangleAlert for ErrorIndicator when mock path differs)
vi.mock("@wso2/oxygen-ui-icons-react", () => ({
User: () => <svg data-testid="user-icon" />,
Shield: () => <svg data-testid="shield-icon" />,
Expand All @@ -43,10 +43,11 @@ vi.mock("@wso2/oxygen-ui-icons-react", () => ({
Server: () => <svg data-testid="server-icon" />,
CircleAlert: () => <svg data-testid="circle-alert-icon" />,
Rocket: () => <svg data-testid="rocket-icon" />,
TriangleAlert: () => <svg data-testid="triangle-alert-icon" />,
}));

// Mock ErrorIndicator
vi.mock("@/components/common/errorIndicator/ErrorIndicator", () => ({
// Mock ErrorIndicator (path must match import: @components/common/error-indicator)
vi.mock("@components/common/error-indicator/ErrorIndicator", () => ({
default: ({ entityName }: any) => (
<div data-testid="error-indicator">Error: {entityName}</div>
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,16 @@ vi.mock("@wso2/oxygen-ui", () => {
<footer>{children}</footer>
);

const Box = ({ children }: any) => <div>{children}</div>;
const Typography = ({ children }: any) => <span>{children}</span>;
const Paper = ({ children }: any) => <div>{children}</div>;
const Button = ({ children }: any) => <button>{children}</button>;
return {
Sidebar,
Box,
Typography,
Paper,
Button,
Link: ({ children, to }: { children: any; to: string }) => (
<a href={to}>{children}</a>
),
Expand Down Expand Up @@ -93,8 +101,8 @@ vi.mock("react-router", () => ({
),
}));

// Mock SubscriptionWidget
vi.mock("@/components/common/sideNavBar/SubscriptionWidget", () => ({
// Mock SubscriptionWidget (path must match: @components/common/side-nav-bar/SubscriptionWidget)
vi.mock("@components/common/side-nav-bar/SubscriptionWidget", () => ({
default: () => <div data-testid="subscription-widget" />,
}));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,8 @@ describe("CasesTable", () => {
fireEvent.click(screen.getByText("Search"));

await waitFor(() => {
// The count should be 1 (filtered locally)
expect(screen.getByTestId("case-count")).toHaveTextContent("1");
// Total records should still reflect API total (2)
// After opening filter and clicking Search (no filter values set), API returns 2 cases; list shows both
expect(screen.getByTestId("case-count")).toHaveTextContent("2");
expect(screen.getByTestId("total-records")).toHaveTextContent("2");
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,24 @@ import { render, screen, fireEvent } from "@testing-library/react";
import { describe, expect, it, vi } from "vitest";
import CasesTableHeader from "@components/dashboard/cases-table/CasesTableHeader";

// Mock Oxygen UI components
// Mock Oxygen UI components (include Menu for ActiveFilters)
vi.mock("@wso2/oxygen-ui", () => ({
Box: ({ children }: any) => <div data-testid="box">{children}</div>,
Typography: ({ children }: any) => <span>{children}</span>,
Button: ({ children, onClick }: any) => (
<button onClick={onClick}>{children}</button>
),
Menu: ({ children, open }: any) =>
open ? <div data-testid="menu">{children}</div> : null,
MenuItem: ({ children }: any) => <div>{children}</div>,
}));

vi.mock("@wso2/oxygen-ui-icons-react", () => ({
ListFilter: () => <span>FilterIcon</span>,
Plus: () => <span>PlusIcon</span>,
}));

vi.mock("@/components/common/filterPanel/ActiveFilters", () => ({
vi.mock("@components/common/filter-panel/ActiveFilters", () => ({
default: ({ appliedFilters }: any) => (
<div data-testid="active-filters">
{Object.keys(appliedFilters).map((key) => (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,22 @@ export default function LoginSlogan(): JSX.Element {
</Typography>

<Stack sx={{ gap: 3 }}>
{sloganListItems.map((item) => (
<Stack
key={item.title}
direction="row"
alignItems="center"
sx={{ gap: 2 }}
>
<div style={{ display: "flex", alignItems: "center" }}>
{item.icon}
</div>
<Typography sx={{ fontSize: "1rem" }}>{item.title}</Typography>
</Stack>
))}
{sloganListItems.map((item) => {
const ItemIcon = item.icon;
return (
<Stack
key={item.title}
direction="row"
alignItems="center"
sx={{ gap: 2 }}
>
<div style={{ display: "flex", alignItems: "center" }}>
<ItemIcon className={item.iconClassName} />
</div>
<Typography sx={{ fontSize: "1rem" }}>{item.title}</Typography>
</Stack>
);
})}
</Stack>
</>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,26 +23,28 @@ interface ContactRowProps {
contact: Contact;
}

const ContactRow = ({ contact }: ContactRowProps): JSX.Element => (
<Box sx={{ display: "flex", flexDirection: "column", gap: 1.5 }}>
<Typography variant="caption" color="text.secondary">
{contact.role}
</Typography>
<Box sx={{ display: "flex", alignItems: "center", gap: 2 }}>
<Box
sx={{
width: 40,
height: 40,
borderRadius: "50%",
background: contact.bgColor,
display: "flex",
alignItems: "center",
justifyContent: "center",
color: "white",
}}
>
{contact.icon}
</Box>
const ContactRow = ({ contact }: ContactRowProps): JSX.Element => {
const Icon = contact.icon;
return (
<Box sx={{ display: "flex", flexDirection: "column", gap: 1.5 }}>
<Typography variant="caption" color="text.secondary">
{contact.role}
</Typography>
<Box sx={{ display: "flex", alignItems: "center", gap: 2 }}>
<Box
sx={{
width: 40,
height: 40,
borderRadius: "50%",
background: contact.bgColor,
display: "flex",
alignItems: "center",
justifyContent: "center",
color: "white",
}}
>
<Icon size={20} />
</Box>
<Box>
<a
href={`mailto:${contact.email}`}
Expand All @@ -69,6 +71,7 @@ const ContactRow = ({ contact }: ContactRowProps): JSX.Element => (
</Box>
</Box>
</Box>
);
);
};

export default ContactRow;
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ vi.mock("@/constants/projectDetailsConstants", () => ({
{
role: "Role 1",
email: "email1@example.com",
icon: "icon-1",
icon: () => null,
bgColor: "#000",
},
{
role: "Role 2",
email: "email2@example.com",
icon: "icon-2",
icon: () => null,
bgColor: "#FFF",
},
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ describe("ContactRow", () => {
const mockContact: Contact = {
role: "Test Role",
email: "test@example.com",
icon: <User />,
icon: User,
bgColor: "#123456",
};

Expand Down
Loading