Skip to content

Commit a168598

Browse files
authored
Merge pull request #122 from terminusdb/fix_change_request_id
review payment page
2 parents c8a6958 + 629aa6e commit a168598

File tree

6 files changed

+15
-9
lines changed

6 files changed

+15
-9
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

packages/tdb-react-table/src/GraphqlTable.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ minWidth,
2020
maxWidth}]*/
2121

2222
//this only render the logic of do the query is in an external hook
23-
export const GraphqlTable = ({result, config, freewidth, start, filtersBy ,limit, orderBy, totalRows, setLimits, setOrder, setFilters,onRefresh,dowloadConfig})=>{
23+
export const GraphqlTable = ({hiddenColumnsArr, result, config, freewidth, start, filtersBy ,limit, orderBy, totalRows, setLimits, setOrder, setFilters,onRefresh,dowloadConfig})=>{
2424
// let wt = TerminusClient.View.table()
2525
// if(view) wt.loadJSON(view.table, view.rules)
2626

@@ -68,7 +68,7 @@ export const GraphqlTable = ({result, config, freewidth, start, filtersBy ,limit
6868
};
6969

7070
function formatTableColumns(){
71-
const hiddenColumns = []
71+
const hiddenColumns = [] //hiddenColumnsArr
7272
// I visualise the id only if it is the only item
7373
const colArr = config.columns
7474
if(!Array.isArray(colArr))return []

0 commit comments

Comments
 (0)