Skip to content

Commit b5d88e9

Browse files
committed
review payment page
1 parent 3515fc9 commit b5d88e9

File tree

5 files changed

+13
-7
lines changed

5 files changed

+13
-7
lines changed

packages/tdb-dashboard/src/components/DocumentsGraphqlTable.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ export const DocumentsGraphqlTable = ({type,onRowClick,showGraphqlTab=true}) =>
3636
orderBy,
3737
filterBy,
3838
loading,
39+
// hiddenColumnsArr,
3940
documentResults } = ControlledGraphqlQuery(apolloClient,query, type, 10, 0, {}, false);
4041

4142
useEffect(() => {
@@ -141,6 +142,7 @@ export const DocumentsGraphqlTable = ({type,onRowClick,showGraphqlTab=true}) =>
141142
result={extractedResults}
142143
freewidth={true}
143144
config ={tableConfigObj}
145+
// hiddenColumnsArr = {hiddenColumnsArr}
144146
// view={(tableConfig ? tableConfig.json() : {})}
145147
limit={limit}
146148
start={start}

packages/tdb-dashboard/src/hooks/ControlledGraphqlQuery.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ export function ControlledGraphqlQuery (apolloClient, graphqlQuery, documentType
1212
// const [hasNextPage, setHasNextPage] = useState(true)
1313
const [controlledRefresh, setControlledRefresh] = useState(0)
1414
const [data, setData] = useState(null)
15-
15+
16+
const [setHiddenColumnsArr, hiddenColumnsArr] = useState([])
17+
1618
//filter is the filter formatted for the query
1719
let filterTable = []
1820

@@ -157,6 +159,8 @@ export function ControlledGraphqlQuery (apolloClient, graphqlQuery, documentType
157159
rowCount,
158160
onRefresh,
159161
documentResults:data,
162+
hiddenColumnsArr,
163+
setHiddenColumnsArr,
160164
// maybe we need to set from outside
161165
// setDocumentResults,
162166
// setControlledRefresh,

packages/tdb-dashboard/src/payment/CancelSubscription.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ export const CancelSubscription = ({showModal, setShowModal}) => {
5454
</Card>
5555
}
5656

57-
return <Modal centered size="lg" className="modal-dialog-right" show={showModal} onHide={closeModal}>
57+
return <Modal centered size="lg" className="modal-dialog-right" show={showModal} onHide={closeModal} backdrop="static"
58+
keyboard={false}>
5859
<Modal.Header>
5960
<Stack direction="horizontal" gap={10} className="justify-content-center">
6061
<Modal.Title className="h4 fw-bold">Downgrade to Community</Modal.Title>

packages/tdb-dashboard/src/payment/PaymentPage.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export const PaymentPage = ({showModal, setShowModal, subscriptionObj}) => {
1212
setShowModal(false)
1313
}
1414

15-
return <Modal size="lg" className="modal-dialog-right" show={showModal} onHide={closeModal}>
15+
return <Modal size="lg" className="modal-dialog-right" show={showModal} onHide={closeModal} backdrop="static" keyboard={false}>
1616
<Modal.Header style={{background:subscriptionObj.color}}>
1717
<Stack direction="horizontal" gap={10} className="justify-content-center">
1818
<Modal.Title className="h4 fw-bold" >Update to {subscriptionObj.title}</Modal.Title>

packages/tdb-dashboard/src/payment/StripeManager.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,12 @@ export function StripeManager(stripe=null){
2424
processStart()
2525
const token = await clientUser.getTokenSilently()
2626
const options = getOptions(token);
27-
const response = await axiosHub.delete(`${baseUrl}/private/subscription`, options)
28-
return true
27+
await axiosHub.delete(`${baseUrl}/private/subscription`, options)
28+
clientUser.userInfo.tier = "Community"
29+
processSuccess()
2930
}catch(err){
3031
const message = err && err.response && err.response.data ? err.response.data.message : 'There was an error processing your request'
3132
processError(message)
32-
}finally{
33-
processSuccess()
3433
}
3534
}
3635

0 commit comments

Comments
 (0)