Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
0c47ac3
Initial plan
Copilot Dec 8, 2025
da4abab
Add backend block listing mutation and tests
Copilot Dec 8, 2025
b2d6bfd
Add frontend block/unblock listing UI with modals and mutations
Copilot Dec 8, 2025
f181fbd
Add access control for blocked listings and modal stories
Copilot Dec 8, 2025
d7c4c6a
Fix lint errors in modal components
Copilot Dec 8, 2025
a851a46
Address code review feedback - simplify modal and remove unused param…
Copilot Dec 8, 2025
e2a86e2
Fix sonar issues
Dec 8, 2025
e720f96
Update twilio
Dec 8, 2025
0d83de8
Update pnpm-lock.yaml
Dec 8, 2025
964647c
Update test cases
Dec 8, 2025
e7c0675
Update jws and jsonwebtoken
Dec 8, 2025
5e55f08
Update node.json
Dec 8, 2025
6d7fba8
Fixed import problem
Dec 9, 2025
e043285
Merge branch 'main' of https://github.com/simnova/sharethrift into co…
Dec 9, 2025
0c9a8a9
Update twilio
Dec 9, 2025
dd6f86e
Update import
Dec 9, 2025
bfc4680
Update import route
Dec 9, 2025
eda9272
Added test cases of ViewListingContainer
Dec 9, 2025
e973d56
Merge branch 'main' into copilot/add-block-unblock-listing-buttons-again
rohit-r-kumar Dec 9, 2025
02665e3
Potential fix for pull request finding 'Unused variable, import, func…
rohit-r-kumar Dec 9, 2025
d467702
Update test cases for coverage
Dec 9, 2025
9763e66
Update test coverage
Dec 9, 2025
0032423
Update test cases
Dec 9, 2025
099a02b
Update test cases for coverge
Dec 9, 2025
18e62b1
Update story book
Dec 9, 2025
1e4d765
Update requested changes
Dec 11, 2025
c712407
Resolved sourcery-ai comments
Dec 11, 2025
78abd26
Update
Dec 11, 2025
ca745a6
Merge branch 'main' of https://github.com/simnova/sharethrift into co…
Dec 12, 2025
2b8198d
Resolved sonar issues
Dec 12, 2025
8aad95e
Update tsconfig-base.json
Dec 12, 2025
d669c74
resolve sonar isssue
Dec 15, 2025
821267c
Resolve knip issue
Dec 15, 2025
1ab993e
Resolve sourcery-ai comment
Dec 15, 2025
acd1ffb
Resolved sourcery-ai comment
Dec 15, 2025
e44aacc
Resolved sourcery-ai comment
Dec 15, 2025
c6fa0d4
Resolve sourcery-comments
Dec 16, 2025
0802434
Update test cases and resolved sonar issues
Dec 17, 2025
3276844
Fix test cases
Dec 17, 2025
f639ed3
update test cases
Dec 17, 2025
936f3a9
Revert "update test cases"
Dec 17, 2025
ed9242e
Revert "Fix test cases"
Dec 17, 2025
e370b77
Revert "Update test cases and resolved sonar issues"
Dec 17, 2025
304416f
Rev "
Dec 17, 2025
6dff80d
Update test cases
Dec 17, 2025
d77cf25
Add test of item-listing
Dec 17, 2025
a6d46ff
Update test cases
Dec 18, 2025
0e66a1e
Update button
Dec 18, 2025
cdb96ad
Update block
Dec 18, 2025
0f093f8
Add sharer name to pop up of Unblock Listing
Dec 18, 2025
9c456ec
Resolve kip issues
Dec 18, 2025
647a5c0
Merge branch 'main' of https://github.com/simnova/sharethrift into co…
Dec 18, 2025
d8d5131
Update test cases
Dec 19, 2025
456fc6e
Solve vulnerable storybook version
Dec 19, 2025
86fcab2
Merge branch 'main' of https://github.com/simnova/sharethrift into co…
Dec 19, 2025
cca3fae
Update Comments
Dec 23, 2025
75e8067
Resolve comments
Dec 23, 2025
0018aec
Update storybook
Dec 23, 2025
ef267c9
Resolve BlockListingButton
Dec 23, 2025
bd93b20
Update event handler
Dec 23, 2025
98319d3
Update yaml
Dec 23, 2025
c47414b
Initial plan
Copilot Dec 26, 2025
743b2df
Add blockReason and blockDescription fields to ItemListing domain and…
Copilot Dec 26, 2025
7af4221
Add appeal request queries and GraphQL types generation
Copilot Dec 26, 2025
a6a7de4
Add blocked listing UI with banner, modals, and appeal functionality
Copilot Dec 26, 2025
3dbf1fa
Fix TypeScript compilation errors and build issues
Copilot Dec 26, 2025
f734c1e
Address code review feedback and improve security documentation
Copilot Dec 26, 2025
520f36d
Merge branch 'main' of https://github.com/simnova/sharethrift into co…
Dec 30, 2025
efd094c
Update yaml
Dec 30, 2025
1c64943
Merge branch 'copilot/add-block-unblock-listing-buttons-again' of htt…
Dec 30, 2025
273d0d2
Update HomeAllListingsTableContainerCreateListingAppealRequest
Jan 2, 2026
8c2f462
fix: handle unpopulated relationships gracefully in appeal request ad…
Jan 2, 2026
7c356b9
Merge branch 'main' of https://github.com/simnova/sharethrift into co…
Jan 7, 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
122 changes: 61 additions & 61 deletions apps/ui-sharethrift/package.json
Original file line number Diff line number Diff line change
@@ -1,63 +1,63 @@
{
"name": "@sthrift/ui-sharethrift",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"start": "vite",
"build": "tsc -b && vite build",
"lint": "eslint .",
"preview": "vite preview",
"tswatch": "tsc --build --watch",
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build",
"test": "vitest run",
"test:coverage": "vitest run --coverage",
"test:watch": "vitest"
},
"dependencies": {
"@ant-design/icons": "^6.1.0",
"@ant-design/v5-patch-for-react-19": "^1.0.3",
"@apollo/client": "^4.0.7",
"@sthrift/ui-components": "workspace:*",
"antd": "^5.27.1",
"crypto-hash": "^3.1.0",
"dayjs": "^1.11.18",
"graphql": "^16.11.0",
"lodash": "^4.17.21",
"react": "^19.1.1",
"react-dom": "^19.1.1",
"react-oidc-context": "^3.3.0",
"react-router-dom": "^7.8.0",
"rxjs": "^7.8.2"
},
"devDependencies": {
"@cellix/typescript-config": "workspace:*",
"@cellix/vitest-config": "workspace:*",
"@chromatic-com/storybook": "^4.1.0",
"@eslint/js": "^9.30.1",
"@graphql-typed-document-node/core": "^3.2.0",
"@storybook/addon-a11y": "^9.1.17",
"@storybook/addon-docs": "^9.1.17",
"@storybook/addon-vitest": "^9.1.17",
"@storybook/react": "^9.1.17",
"@storybook/react-vite": "^9.1.17",
"@testing-library/jest-dom": "^6.9.1",
"@types/lodash": "^4.17.20",
"@types/react": "^19.1.9",
"@types/react-dom": "^19.1.7",
"@vitejs/plugin-react": "^4.7.0",
"@vitest/browser": "3.2.4",
"@vitest/coverage-v8": "^3.2.4",
"eslint": "^9.30.1",
"eslint-plugin-react-hooks": "^5.2.0",
"eslint-plugin-react-refresh": "^0.4.20",
"globals": "^16.3.0",
"storybook": "catalog:",
"typescript": "~5.8.3",
"typescript-eslint": "^8.35.1",
"vite": "^7.1.2",
"vitest": "^3.2.4"
},
"license": "MIT"
"name": "@sthrift/ui-sharethrift",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"start": "vite",
"build": "tsc -b && vite build",
"lint": "eslint .",
"preview": "vite preview",
"tswatch": "tsc --build --watch",
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build",
"test": "vitest run",
"test:coverage": "vitest run --coverage",
"test:watch": "vitest"
},
"dependencies": {
"@ant-design/icons": "^6.1.0",
"@ant-design/v5-patch-for-react-19": "^1.0.3",
"@apollo/client": "^4.0.7",
"@sthrift/ui-components": "workspace:*",
"antd": "^5.27.1",
"crypto-hash": "^3.1.0",
"dayjs": "^1.11.18",
"graphql": "^16.11.0",
"lodash": "^4.17.21",
"react": "^19.1.1",
"react-dom": "^19.1.1",
"react-oidc-context": "^3.3.0",
"react-router-dom": "^7.8.0",
"rxjs": "^7.8.2"
},
"devDependencies": {
"@cellix/typescript-config": "workspace:*",
"@cellix/vitest-config": "workspace:*",
"@chromatic-com/storybook": "^4.1.0",
"@eslint/js": "^9.30.1",
"@graphql-typed-document-node/core": "^3.2.0",
"@storybook/addon-a11y": "^9.1.17",
"@storybook/addon-docs": "^9.1.17",
"@storybook/addon-vitest": "^9.1.17",
"@storybook/react": "^9.1.17",
"@storybook/react-vite": "^9.1.17",
"@testing-library/jest-dom": "^6.9.1",
"@types/lodash": "^4.17.20",
"@types/react": "^19.1.9",
"@types/react-dom": "^19.1.7",
"@vitejs/plugin-react": "^4.7.0",
"@vitest/browser": "3.2.4",
"@vitest/coverage-v8": "^3.2.4",
"eslint": "^9.30.1",
"eslint-plugin-react-hooks": "^5.2.0",
"eslint-plugin-react-refresh": "^0.4.20",
"globals": "^16.3.0",
"storybook": "catalog:",
"typescript": "~5.8.3",
"typescript-eslint": "^8.35.1",
"vite": "^7.1.2",
"vitest": "^3.2.4"
},
"license": "MIT"
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Inline fragment (previously in admin-listings-table.fragment.graphql)
fragment AdminListingFields on ListingAll {
id
title
state
images
createdAt
sharingPeriodStart
sharingPeriodEnd
id
title
state
images
createdAt
sharingPeriodStart
sharingPeriodEnd
}

query AdminListingsTableContainerAdminListings(
Expand Down Expand Up @@ -42,5 +42,9 @@ mutation AdminListingsTableContainerDeleteListing($id: ObjectID!) {
}

mutation AdminListingsTableContainerUnblockListing($id: ObjectID!) {
unblockListing(id: $id)
unblockListing(id: $id) {
id
state
success
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
import {
AdminListingsTableContainerAdminListingsDocument,
AdminListingsTableContainerDeleteListingDocument,
AdminListingsTableContainerUnblockListingDocument,
AdminListingsTableContainerUnblockListingDocument
} from '../../../../../../../generated.tsx';

const meta: Meta<typeof AdminListings> = {
Expand Down Expand Up @@ -56,10 +56,11 @@ const meta: Meta<typeof AdminListings> = {
},
result: {
data: {
unblockItemListing: {
__typename: 'MutationStatus',
unblockListing: {
__typename: 'BlockListingResult',
id: 'listing-1',
state: 'Published',
success: true,
errorMessage: null,
},
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import { withMockApolloClient, withMockRouter } from '../../../../../../../test-
import {
AdminListingsTableContainerAdminListingsDocument,
AdminListingsTableContainerDeleteListingDocument,
AdminListingsTableContainerUnblockListingDocument,
BlockListingContainerUnblockListingDocument,
AdminListingsTableContainerUnblockListingDocument
} from '../../../../../../../generated.tsx';

const meta = {
Expand Down Expand Up @@ -49,14 +50,15 @@ const meta = {
},
{
request: {
query: AdminListingsTableContainerUnblockListingDocument,
query: BlockListingContainerUnblockListingDocument,
},
result: {
data: {
unblockItemListing: {
__typename: 'MutationStatus',
unblockListing: {
__typename: 'BlockListingResult',
id: 'listing-123',
state: 'Published',
success: true,
errorMessage: null,
},
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { useNavigate, useParams } from 'react-router-dom';
import {
AdminListingsTableContainerAdminListingsDocument,
AdminListingsTableContainerDeleteListingDocument,
AdminListingsTableContainerUnblockListingDocument,
BlockListingContainerUnblockListingDocument,
} from '../../../../../../../generated.tsx';

export function AdminViewListing(): ReactElement {
Expand All @@ -37,7 +37,7 @@ export function AdminViewListing(): ReactElement {
);

const [unblockListingMutation] = useMutation(
AdminListingsTableContainerUnblockListingDocument,
BlockListingContainerUnblockListingDocument,
);

const [deleteListingMutation] = useMutation(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import { Modal, Typography } from 'antd';
import { ExclamationCircleOutlined } from '@ant-design/icons';
import type React from 'react';

const { Paragraph } = Typography;

export interface AppealConfirmationModalProps {
visible: boolean;
onConfirm: () => void;
onCancel: () => void;
loading?: boolean;
}

export const AppealConfirmationModal: React.FC<
AppealConfirmationModalProps
> = ({ visible, onConfirm, onCancel, loading }) => {
return (
<Modal
title={
<span>
<ExclamationCircleOutlined style={{ color: '#faad14', marginRight: 8 }} />
Confirm Appeal
</span>
}
open={visible}
onOk={onConfirm}
onCancel={onCancel}
okText="Appeal"
cancelText="Cancel"
confirmLoading={loading}
okButtonProps={{ danger: true }}
>
<Paragraph>
Before you appeal, make sure you've reviewed and updated your listing to
comply with our guidelines.
</Paragraph>
<Paragraph strong>
Appeals without changes may be blocked. Are you sure you want to proceed?
</Paragraph>
</Modal>
);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
import { Alert, Button, Modal, Typography } from 'antd';
import { ExclamationCircleOutlined } from '@ant-design/icons';
import type React from 'react';

const { Paragraph, Title } = Typography;

export interface BlockInformationModalProps {
visible: boolean;
onClose: () => void;
onEditListing: () => void;
onAppealBlock: () => void;
blockReason?: string;
blockDescription?: string;
appealRequested?: boolean;
}

export const BlockInformationModal: React.FC<BlockInformationModalProps> = ({
visible,
onClose,
onEditListing,
onAppealBlock,
blockReason,
blockDescription,
appealRequested,
}) => {
return (
<Modal
title={
<span>
<ExclamationCircleOutlined style={{ color: '#ff4d4f', marginRight: 8 }} />
Block Information
</span>
}
open={visible}
onCancel={onClose}
footer={[
<Button key="cancel" onClick={onClose}>
Cancel
</Button>,
<Button key="edit" type="primary" onClick={onEditListing}>
Edit Listing
</Button>,
<Button
key="appeal"
type="primary"
danger
onClick={onAppealBlock}
disabled={appealRequested}
>
{appealRequested ? 'Appeal Submitted' : 'Appeal Block'}
</Button>,
]}
>
<div style={{ marginBottom: 16 }}>
<Title level={5} style={{ marginBottom: 8 }}>
Reason
</Title>
<Paragraph>{blockReason || 'No reason provided'}</Paragraph>
</div>

<div style={{ marginBottom: 16 }}>
<Title level={5} style={{ marginBottom: 8 }}>
Description
</Title>
<Paragraph>{blockDescription || 'No description provided'}</Paragraph>
</div>

{appealRequested && (
<div style={{ marginTop: 16 }}>
<Title level={5} style={{ marginBottom: 8 }}>
Status
</Title>
<Paragraph>Appeal Requested</Paragraph>
</div>
)}

{!appealRequested && (
<Alert
message="Before you appeal, make sure you've reviewed and updated your listing to address any issues. Appeals without changes may be blocked."
type="info"
showIcon
icon={<ExclamationCircleOutlined />}
style={{ marginTop: 16 }}
/>
)}
</Modal>
);
};
Loading
Loading