Skip to content

Commit

Permalink
Fix [4485, 4484]: lint issue
Browse files Browse the repository at this point in the history
  • Loading branch information
mkbeefcake committed Aug 31, 2023
1 parent 04dd258 commit 328ca9a
Show file tree
Hide file tree
Showing 5 changed files with 106 additions and 97 deletions.
50 changes: 26 additions & 24 deletions packages/ui/src/forum/components/ThreadCard/ThreadCard.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,30 +23,32 @@ const forumThread: ForumThreadWithDetails = {
tags: [],
visiblePostsCount: 5,
status: { __typename: 'ThreadStatusActive' },
posts: [{
id: "1",
createdAt: "2023-06-28T19:14:00.000Z",
text: "Test text",
status: "PostStatusActive",
threadId: "459",
categoryId: "2",
author: {
id: "4129",
handle: "Codefikeyz",
rootAccount: "j4TZJCACAWao9bnh5k86qeRW2QhNVNkf9eEw1Vz4V8ZeqD4u4",
controllerAccount: "j4TZJCACAWao9bnh5k86qeRW2QhNVNkf9eEw1Vz4V8ZeqD4u4",
isCouncilMember: false,
isFoundingMember: true,
inviteCount: 1,
roles: [],
boundAccounts: [
"j4TZJCACAWao9bnh5k86qeRW2QhNVNkf9eEw1Vz4V8ZeqD4u4",
"j4WJoUb8xxQucAUFtmF18r41gzb1AG22nzypW1PT4LMLJqzU5"
],
isVerified: true,
createdAt:"2023-06-28T19:14:00.000Z",
}
}]
posts: [
{
id: '1',
createdAt: '2023-06-28T19:14:00.000Z',
text: 'Test text',
status: 'PostStatusActive',
threadId: '459',
categoryId: '2',
author: {
id: '4129',
handle: 'Codefikeyz',
rootAccount: 'j4TZJCACAWao9bnh5k86qeRW2QhNVNkf9eEw1Vz4V8ZeqD4u4',
controllerAccount: 'j4TZJCACAWao9bnh5k86qeRW2QhNVNkf9eEw1Vz4V8ZeqD4u4',
isCouncilMember: false,
isFoundingMember: true,
inviteCount: 1,
roles: [],
boundAccounts: [
'j4TZJCACAWao9bnh5k86qeRW2QhNVNkf9eEw1Vz4V8ZeqD4u4',
'j4WJoUb8xxQucAUFtmF18r41gzb1AG22nzypW1PT4LMLJqzU5',
],
isVerified: true,
createdAt: '2023-06-28T19:14:00.000Z',
},
},
],
}

const Template: Story = (args) => <ThreadCard thread={{ ...forumThread, ...args }} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export interface LatestActivitydProps {
posts: ForumPost[]
}
export const LatestActivity = memo(({ /*threadId,*/ posts }: LatestActivitydProps) => {
posts.sort((a: ForumPost, b: ForumPost) => new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime())
const post = posts[0] // const { post } = useThreadLatestPost(threadId)

if (!post) return <Loading withoutMargin />
Expand Down
50 changes: 26 additions & 24 deletions packages/ui/src/forum/components/threads/ThreadList.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,30 +32,32 @@ const forumThread: ForumThreadWithDetails = {
tags: [],
visiblePostsCount: 5,
status: { __typename: 'ThreadStatusActive' },
posts: [{
id: "1",
createdAt: "2023-06-28T19:14:00.000Z",
text: "Test text",
status: "PostStatusActive",
threadId: "459",
categoryId: "2",
author: {
id: "4129",
handle: "Codefikeyz",
rootAccount: "j4TZJCACAWao9bnh5k86qeRW2QhNVNkf9eEw1Vz4V8ZeqD4u4",
controllerAccount: "j4TZJCACAWao9bnh5k86qeRW2QhNVNkf9eEw1Vz4V8ZeqD4u4",
isCouncilMember: false,
isFoundingMember: true,
inviteCount: 1,
roles: [],
boundAccounts: [
"j4TZJCACAWao9bnh5k86qeRW2QhNVNkf9eEw1Vz4V8ZeqD4u4",
"j4WJoUb8xxQucAUFtmF18r41gzb1AG22nzypW1PT4LMLJqzU5"
],
isVerified: true,
createdAt:"2023-06-28T19:14:00.000Z",
}
}]
posts: [
{
id: '1',
createdAt: '2023-06-28T19:14:00.000Z',
text: 'Test text',
status: 'PostStatusActive',
threadId: '459',
categoryId: '2',
author: {
id: '4129',
handle: 'Codefikeyz',
rootAccount: 'j4TZJCACAWao9bnh5k86qeRW2QhNVNkf9eEw1Vz4V8ZeqD4u4',
controllerAccount: 'j4TZJCACAWao9bnh5k86qeRW2QhNVNkf9eEw1Vz4V8ZeqD4u4',
isCouncilMember: false,
isFoundingMember: true,
inviteCount: 1,
roles: [],
boundAccounts: [
'j4TZJCACAWao9bnh5k86qeRW2QhNVNkf9eEw1Vz4V8ZeqD4u4',
'j4WJoUb8xxQucAUFtmF18r41gzb1AG22nzypW1PT4LMLJqzU5',
],
isVerified: true,
createdAt: '2023-06-28T19:14:00.000Z',
},
},
],
}

const Template: Story = ({ isArchive, type, initialPostText, categoryTitle, title }) => {
Expand Down
50 changes: 26 additions & 24 deletions packages/ui/test/forum/modals/DeleteThreadModal.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,30 +41,32 @@ const modalData: ModalCallData<DeleteThreadModalCall> = {
tags: [],
visiblePostsCount: 5,
status: { __typename: 'ThreadStatusActive' },
posts: [{
id: "1",
createdAt: "2023-06-28T19:14:00.000Z",
text: "Test text",
status: "PostStatusActive",
threadId: "459",
categoryId: "2",
author: {
id: "4129",
handle: "Codefikeyz",
rootAccount: "j4TZJCACAWao9bnh5k86qeRW2QhNVNkf9eEw1Vz4V8ZeqD4u4",
controllerAccount: "j4TZJCACAWao9bnh5k86qeRW2QhNVNkf9eEw1Vz4V8ZeqD4u4",
isCouncilMember: false,
isFoundingMember: true,
inviteCount: 1,
roles: [],
boundAccounts: [
"j4TZJCACAWao9bnh5k86qeRW2QhNVNkf9eEw1Vz4V8ZeqD4u4",
"j4WJoUb8xxQucAUFtmF18r41gzb1AG22nzypW1PT4LMLJqzU5"
],
isVerified: true,
createdAt:"2023-06-28T19:14:00.000Z",
}
}]
posts: [
{
id: '1',
createdAt: '2023-06-28T19:14:00.000Z',
text: 'Test text',
status: 'PostStatusActive',
threadId: '459',
categoryId: '2',
author: {
id: '4129',
handle: 'Codefikeyz',
rootAccount: 'j4TZJCACAWao9bnh5k86qeRW2QhNVNkf9eEw1Vz4V8ZeqD4u4',
controllerAccount: 'j4TZJCACAWao9bnh5k86qeRW2QhNVNkf9eEw1Vz4V8ZeqD4u4',
isCouncilMember: false,
isFoundingMember: true,
inviteCount: 1,
roles: [],
boundAccounts: [
'j4TZJCACAWao9bnh5k86qeRW2QhNVNkf9eEw1Vz4V8ZeqD4u4',
'j4WJoUb8xxQucAUFtmF18r41gzb1AG22nzypW1PT4LMLJqzU5',
],
isVerified: true,
createdAt: '2023-06-28T19:14:00.000Z',
},
},
],
},
}

Expand Down
52 changes: 27 additions & 25 deletions packages/ui/test/forum/pages/ForumThread.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,31 +62,33 @@ describe('UI: Forum Thread Page', () => {
tags: [],
visiblePostsCount: 0,
status: { __typename: 'ThreadStatusActive' },
posts: [{
id: "1",
createdAt: "2023-06-28T19:14:00.000Z",
text: "Test text",
status: "PostStatusActive",
threadId: "459",
categoryId: "2",
author: {
id: "4129",
handle: "Codefikeyz",
rootAccount: "j4TZJCACAWao9bnh5k86qeRW2QhNVNkf9eEw1Vz4V8ZeqD4u4",
controllerAccount: "j4TZJCACAWao9bnh5k86qeRW2QhNVNkf9eEw1Vz4V8ZeqD4u4",
isCouncilMember: false,
isFoundingMember: true,
inviteCount: 1,
roles: [],
boundAccounts: [
"j4TZJCACAWao9bnh5k86qeRW2QhNVNkf9eEw1Vz4V8ZeqD4u4",
"j4WJoUb8xxQucAUFtmF18r41gzb1AG22nzypW1PT4LMLJqzU5"
],
isVerified: true,
createdAt:"2023-06-28T19:14:00.000Z",
}
}]
}
posts: [
{
id: '1',
createdAt: '2023-06-28T19:14:00.000Z',
text: 'Test text',
status: 'PostStatusActive',
threadId: '459',
categoryId: '2',
author: {
id: '4129',
handle: 'Codefikeyz',
rootAccount: 'j4TZJCACAWao9bnh5k86qeRW2QhNVNkf9eEw1Vz4V8ZeqD4u4',
controllerAccount: 'j4TZJCACAWao9bnh5k86qeRW2QhNVNkf9eEw1Vz4V8ZeqD4u4',
isCouncilMember: false,
isFoundingMember: true,
inviteCount: 1,
roles: [],
boundAccounts: [
'j4TZJCACAWao9bnh5k86qeRW2QhNVNkf9eEw1Vz4V8ZeqD4u4',
'j4WJoUb8xxQucAUFtmF18r41gzb1AG22nzypW1PT4LMLJqzU5',
],
isVerified: true,
createdAt: '2023-06-28T19:14:00.000Z',
},
},
],
}

beforeAll(() => {
stubAccounts([alice, bob])
Expand Down

0 comments on commit 328ca9a

Please sign in to comment.