Skip to content

Feat/system admin #1108

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 26 commits into from
Jun 18, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
228b71f
Deploy this branch
jmgasper Apr 15, 2025
2d59f23
permission-submit
stevenfrog Apr 27, 2025
11232bd
review and billing account update
stevenfrog Apr 27, 2025
774a8f5
Merge branch 'dev' into permission-update
stevenfrog Apr 27, 2025
580617f
Merge pull request #1053 from stevenfrog/permission-update
jmgasper Apr 27, 2025
af68445
Fix typo
jmgasper Apr 27, 2025
88fe2bf
Topcoder Admin App - Misc Update 0505
suppermancool May 7, 2025
2be1b57
Merge pull request #1070 from topcoder-platform/diazz-admin-f2f-30376773
jmgasper May 8, 2025
59d8bc6
fix unapprove challenge id
stevenfrog May 13, 2025
9510de9
Merge pull request #1073 from stevenfrog/fix-unapprove-challenge-id
jmgasper May 14, 2025
d558ca8
Topcoder Admin App - Misc Update 0518
suppermancool May 22, 2025
a9b4b2b
Topcoder Admin App - Marathon Match Functionality
suppermancool May 25, 2025
f3d3e67
Merge pull request #1085 from topcoder-platform/diazz-admin-f2f-30376861
jmgasper May 27, 2025
366c806
Merge branch 'feat/system-admin' into diazz-admin-code-30376878
suppermancool Jun 1, 2025
21fad4a
Marathon match functionality - final fix
suppermancool Jun 2, 2025
07ac31d
Topcoder Admin App - Misc Update 0601
suppermancool Jun 3, 2025
b261088
Merge pull request #1092 from topcoder-platform/diazz-admin-code-3037…
jmgasper Jun 4, 2025
9204d86
Merge branch 'feat/system-admin' into diazz-admin-f2f-30376988
suppermancool Jun 4, 2025
a82243b
Merge pull request #1093 from topcoder-platform/diazz-admin-f2f-30376988
jmgasper Jun 5, 2025
6f686e3
admin billing accounts: always set payment_terms_id = 1 when send upd…
suppermancool Jun 6, 2025
5ddb252
Merge branch 'dev' into feat/system-admin
suppermancool Jun 6, 2025
538deb9
fix lint after merging
suppermancool Jun 6, 2025
5fd7ac7
Merge pull request #1095 from topcoder-platform/diazz-admin-f2f-30376988
jmgasper Jun 8, 2025
a8a6f0a
Topcoder Admin App - Misc Update 0610
suppermancool Jun 10, 2025
58b5490
fix lint
suppermancool Jun 13, 2025
c367efe
Merge pull request #1105 from topcoder-platform/diazz-admin-f2f-30377050
jmgasper Jun 16, 2025
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
Prev Previous commit
Next Next commit
Topcoder Admin App - Misc Update 0518
  • Loading branch information
suppermancool committed May 22, 2025
commit d558ca8a49c8fd5dcbf87d2e2f6dfeeff18bf4b0
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/**
* Billing accounts page.
*/
import { FC } from 'react'
import { FC, useState } from 'react'
import classNames from 'classnames'

import { PlusIcon } from '@heroicons/react/solid'
import { LinkButton, LoadingSpinner, PageDivider, PageTitle } from '~/libs/ui'
import { colWidthType, LinkButton, LoadingSpinner, PageDivider, PageTitle } from '~/libs/ui'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The import colWidthType is added but not used in the code. Consider removing it if it's unnecessary to avoid unused imports.


import { BillingAccountsFilter } from '../../lib/components/BillingAccountsFilter'
import { BillingAccountsTable } from '../../lib/components/BillingAccountsTable'
Expand All @@ -22,6 +22,7 @@ interface Props {
const pageTitle = 'Billing Accounts'

export const BillingAccountsPage: FC<Props> = (props: Props) => {
const [colWidth, setColWidth] = useState<colWidthType>({})

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The type colWidthType used in useState<colWidthType>({}) is not defined in the provided code snippet. Ensure that colWidthType is properly defined and imported if necessary.

const {
isLoading,
datas,
Expand Down Expand Up @@ -76,6 +77,8 @@ export const BillingAccountsPage: FC<Props> = (props: Props) => {
setPage={setPage}
setSort={setSort}
sort={sort}
colWidth={colWidth}
setColWidth={setColWidth}
/>
)}
</>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/**
* Billing account clients page.
*/
import { FC } from 'react'
import { FC, useState } from 'react'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The useState import is added but not used in the current code. Consider removing it if it's not needed.

import classNames from 'classnames'

import { LinkButton, LoadingSpinner, PageDivider, PageTitle } from '~/libs/ui'
import { colWidthType, LinkButton, LoadingSpinner, PageDivider, PageTitle } from '~/libs/ui'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The colWidthType import is added but not used in the current code. Consider removing it if it's not needed.

import { PlusIcon } from '@heroicons/react/solid'

import { MSG_NO_RECORD_FOUND } from '../../config/index.config'
Expand All @@ -22,6 +22,7 @@ interface Props {
const pageTitle = 'Clients'

export const ClientsPage: FC<Props> = (props: Props) => {
const [colWidth, setColWidth] = useState<colWidthType>({})

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The colWidthType type is used here, but it is not defined in the provided code. Ensure that colWidthType is imported or defined within this file or elsewhere in the project.

const {
isLoading,
datas,
Expand Down Expand Up @@ -77,6 +78,8 @@ export const ClientsPage: FC<Props> = (props: Props) => {
setPage={setPage}
setSort={setSort}
sort={sort}
colWidth={colWidth}
setColWidth={setColWidth}
/>
)}
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,9 @@
.btnDelete {
padding-right: 0;
}

.desktopTable {
td {
vertical-align: middle;
}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/**
* Billing account resources table.
*/
import { FC, useMemo } from 'react'
import { FC, useMemo, useState } from 'react'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The useState hook is imported but not used in the component. Consider removing it if it's not needed to avoid unnecessary imports.

import classNames from 'classnames'

import { useWindowSize, WindowSize } from '~/libs/shared'
import { Button, Table, TableColumn } from '~/libs/ui'
import { Button, colWidthType, Table, TableColumn } from '~/libs/ui'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The colWidthType is imported but not used in the component. Consider removing it if it's not needed to avoid unnecessary imports.


import { useTableFilterLocal, useTableFilterLocalProps } from '../../hooks'
import { Pagination } from '../common/Pagination'
Expand All @@ -26,6 +26,7 @@ interface Props {
}

export const BillingAccountResourcesTable: FC<Props> = (props: Props) => {
const [colWidth, setColWidth] = useState<colWidthType>({})

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The colWidth state is initialized but not used anywhere in the component. Consider removing it if it is not needed, or implement its usage if it is intended to be part of the component's functionality.

const {
page,
setPage,
Expand All @@ -40,12 +41,14 @@ export const BillingAccountResourcesTable: FC<Props> = (props: Props) => {
const columns = useMemo<TableColumn<BillingAccountResource>[]>(
() => [
{
columnId: 'name',

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding a columnId for consistency with the other columns, even if it is not currently used.

label: 'Name',
propertyName: 'name',
type: 'text',
},
{
className: styles.blockColumnAction,
columnId: 'action',
label: '',
renderer: (data: BillingAccountResource) => (
<Button
Expand Down Expand Up @@ -100,6 +103,9 @@ export const BillingAccountResourcesTable: FC<Props> = (props: Props) => {
onToggleSort={setSort}
forceSort={sort}
removeDefaultSort
className={styles.desktopTable}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The className prop is being set to styles.desktopTable. Ensure that styles.desktopTable is defined in your styles module, otherwise this will not have any effect.

colWidth={colWidth}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The colWidth prop is being passed to the component. Verify that the component being used supports this prop and that it is being used correctly within the component.

setColWidth={setColWidth}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The setColWidth prop is being passed to the component. Ensure that this function is defined and is intended to be used by the component. Double-check that the component supports this prop.

/>
)}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,9 @@
white-space: break-spaces !important;
text-align: left !important;
}

.desktopTable {
td {
vertical-align: middle;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Link } from 'react-router-dom'
import classNames from 'classnames'

import { Sort } from '~/apps/gamification-admin/src/game-lib'
import { LinkButton, Table, TableColumn } from '~/libs/ui'
import { colWidthType, LinkButton, Table, TableColumn } from '~/libs/ui'
import { useWindowSize, WindowSize } from '~/libs/shared'

import { BillingAccount, MobileTableColumn } from '../../models'
Expand All @@ -23,12 +23,15 @@ interface Props {
setPage: Dispatch<SetStateAction<number>>
sort: Sort | undefined,
setSort: Dispatch<SetStateAction<Sort | undefined>>
colWidth: colWidthType | undefined,
setColWidth: Dispatch<SetStateAction<colWidthType>> | undefined
}

export const BillingAccountsTable: FC<Props> = (props: Props) => {
const columns = useMemo<TableColumn<BillingAccount>[]>(
() => [
{
columnId: 'id',
label: 'Account ID',
renderer: (data: BillingAccount) => (
<div>
Expand All @@ -39,26 +42,31 @@ export const BillingAccountsTable: FC<Props> = (props: Props) => {
},
{
className: styles.tableCell,
columnId: 'name',
label: 'Name',
propertyName: 'name',
type: 'text',
},
{
columnId: 'status',
label: 'Status',
propertyName: 'status',
type: 'text',
},
{
columnId: 'startDateString',
label: 'Start Date',
propertyName: 'startDateString',
type: 'text',
},
{
columnId: 'endDateString',
label: 'End Date',
propertyName: 'endDateString',
type: 'text',
},
{
columnId: 'action',
label: '',
renderer: (data: BillingAccount) => (
<span>
Expand Down Expand Up @@ -167,6 +175,9 @@ export const BillingAccountsTable: FC<Props> = (props: Props) => {
onToggleSort={props.setSort}
removeDefaultSort
forceSort={props.sort}
colWidth={props.colWidth}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The colWidth prop is added to the component, but ensure that it is being used correctly within the component logic to adjust column widths as intended.

setColWidth={props.setColWidth}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The setColWidth prop is introduced, but verify that it is being utilized appropriately to update column widths dynamically.

className={styles.desktopTable}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The className prop styles.desktopTable is added. Confirm that the corresponding styles are defined and applied correctly to achieve the desired layout and appearance.

/>
)}
<Pagination
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,9 @@
flex: none;
}
}

.desktopTable {
td {
vertical-align: middle;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,8 @@ const ChallengeList: FC<ChallengeListProps> = props => {
columns={columns}
data={props.challenges}
disableSorting
onToggleSort={_.noop}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The onToggleSort prop is set to _.noop, which means it does nothing. If sorting is not intended to be implemented, consider removing this prop to avoid confusion.

className={styles.desktopTable}
/>
)}
{screenWidth <= 1279 && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,9 @@
text-align: right;
}
}

.desktopTable {
td {
vertical-align: middle;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,7 @@ const ChallengeUserList: FC<ChallengeUserListProps> = props => {
columns={columns}
data={props.users}
disableSorting
className={styles.desktopTable}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ensure that styles.desktopTable is defined and correctly imported. If it is not defined, this will lead to a runtime error.

/>
)}
{screenWidth <= 984 && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,9 @@
white-space: break-spaces !important;
text-align: left !important;
}

.desktopTable {
td {
vertical-align: middle;
}
}
13 changes: 12 additions & 1 deletion src/apps/admin/src/lib/components/ClientsTable/ClientsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import classNames from 'classnames'

import { Sort } from '~/apps/gamification-admin/src/game-lib'
import { useWindowSize, WindowSize } from '~/libs/shared'
import { Table, TableColumn } from '~/libs/ui'
import { colWidthType, Table, TableColumn } from '~/libs/ui'

import { ClientInfo, MobileTableColumn } from '../../models'
import { Pagination } from '../common/Pagination'
Expand All @@ -23,12 +23,15 @@ interface Props {
setPage: Dispatch<SetStateAction<number>>
sort: Sort | undefined
setSort: Dispatch<SetStateAction<Sort | undefined>>
colWidth: colWidthType | undefined,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The colWidth prop is marked as undefined, but it might be better to handle this case explicitly in the component to avoid potential runtime errors if colWidth is not provided.

setColWidth: Dispatch<SetStateAction<colWidthType>> | undefined

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The setColWidth prop is marked as undefined, but it might be better to handle this case explicitly in the component to avoid potential runtime errors if setColWidth is not provided.

}

export const ClientsTable: FC<Props> = (props: Props) => {
const columns = useMemo<TableColumn<ClientInfo>[]>(
() => [
{
columnId: 'ClientID',

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The columnId property is added to the column definition. Ensure that this property is used consistently throughout the table implementation, especially if there are other places where column IDs are referenced or required.

label: 'Client ID',
renderer: (data: ClientInfo) => (
<div>
Expand All @@ -39,26 +42,31 @@ export const ClientsTable: FC<Props> = (props: Props) => {
},
{
className: styles.tableCell,
columnId: 'name',

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider ensuring that the columnId values are unique and consistent with the data structure used elsewhere in the application to avoid potential conflicts or errors.

label: 'Name',
propertyName: 'name',
type: 'text',
},
{
columnId: 'status',

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ensure that the columnId for 'status' is used consistently throughout the application to prevent any mismatches or errors in data handling.

label: 'Status',
propertyName: 'status',
type: 'text',
},
{
columnId: 'startDateString',

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verify that the columnId 'startDateString' aligns with the data model and is used consistently to avoid potential issues with data retrieval or display.

label: 'Start Date',
propertyName: 'startDateString',
type: 'text',
},
{
columnId: 'endDateString',

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check that the columnId 'endDateString' is correctly mapped and used consistently across the application to prevent any inconsistencies.

label: 'End Date',
propertyName: 'endDateString',
type: 'text',
},
{
columnId: 'codeName',

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ensure that the columnId 'codeName' is unique and consistently used throughout the application to avoid potential conflicts or errors.

label: 'Code name',
renderer: (data: ClientInfo) => (
<>
Expand Down Expand Up @@ -161,6 +169,9 @@ export const ClientsTable: FC<Props> = (props: Props) => {
onToggleSort={props.setSort}
removeDefaultSort
forceSort={props.sort}
className={styles.desktopTable}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The className prop is being added to the component, but ensure that styles.desktopTable is defined in the styles object to avoid potential runtime errors.

colWidth={props.colWidth}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The colWidth prop is being introduced. Verify that this prop is being used correctly within the component to ensure it affects the column width as intended.

setColWidth={props.setColWidth}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The setColWidth prop is added. Ensure that this function is defined and used appropriately to update the column width state.

/>
)}
<Pagination
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,9 @@
background: none;
}
}

.desktopTable {
td {
vertical-align: middle;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ export const DialogEditUserGroups: FC<Props> = (props: Props) => {
data={userGroups}
disableSorting
onToggleSort={_.noop}
className={styles.desktopTable}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider verifying if styles.desktopTable is defined in the styles object to ensure it is applied correctly. If it is not defined, it may lead to unexpected styling issues.

/>
) : (
<div>No groups</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,9 @@
background: none;
}
}

.desktopTable {
td {
vertical-align: middle;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ export const DialogEditUserRoles: FC<Props> = (props: Props) => {
data={userRoles}
disableSorting
onToggleSort={_.noop}
className={styles.desktopTable}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider verifying if the styles.desktopTable class is defined and applied correctly to ensure consistent styling across different components.

/>
) : (
<div>No roles</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,9 @@
background: none;
}
}

.desktopTable {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider renaming the class .desktopTable to follow a more consistent naming convention, such as using kebab-case (.desktop-table) or BEM (Block Element Modifier) methodology, to maintain consistency with other class names in the project.

td {
vertical-align: middle;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ export const DialogEditUserTerms: FC<Props> = (props: Props) => {
data={addedInfo.datas}
disableSorting
onToggleSort={_.noop}
className={styles.desktopTable}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider verifying if styles.desktopTable is defined and correctly imported. If it's not defined, it may lead to unexpected styling issues.

/>
<Pagination
page={addedInfo.page}
Expand Down Expand Up @@ -276,6 +277,7 @@ export const DialogEditUserTerms: FC<Props> = (props: Props) => {
data={notAddedInfo.datas}
disableSorting
onToggleSort={_.noop}
className={styles.desktopTable}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider verifying if the styles.desktopTable class is defined and used correctly in the CSS module. Ensure it aligns with the intended design and does not introduce any unintended styling issues.

/>
<Pagination
page={notAddedInfo.page}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,9 @@
padding: 16px 16px 32px;
text-align: center;
}

.desktopTable {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider using a more descriptive class name than .desktopTable to clearly convey the purpose or context of this table styling.

td {
vertical-align: middle;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ export const DialogUserStatusHistory: FC<Props> = (props: Props) => {
data={userAchievements}
disableSorting
onToggleSort={_.noop}
className={styles.desktopTable}
/>
)}
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,9 @@
.blockCellWrap {
white-space: break-spaces !important;
}

.desktopTable {
td {
vertical-align: middle;
}
}
Loading