Skip to content

Commit

Permalink
feat: #6084 update listing modal (#6099)
Browse files Browse the repository at this point in the history
  • Loading branch information
willmcvay authored Feb 7, 2022
1 parent 85e6c35 commit ead3b87
Show file tree
Hide file tree
Showing 36 changed files with 1,281 additions and 138 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,11 @@ export const DevsManagement: React.FC = () => {
{
Header: 'Agreed Terms Date',
id: 'agreedTerms',
Cell: ({ row }: { row: { original: DeveloperModel } }) => dayjs(row.original.agreedTerms).format('DD/MM/YYYY'),
Cell: ({ row }: { row: { original: DeveloperModel & { isMember: boolean } } }) => {
return row.original.isMember && row.original.agreedTerms
? dayjs(row.original.agreedTerms).format('DD/MM/YYYY')
: '-'
},
},
!hasLimitedAccess && {
Header: '',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ Object {
class="el-table-cell-content"
data-narrow-label="Total Cost"
>
£1.9625
£1.96
</div>
</div>
<div
Expand Down Expand Up @@ -498,7 +498,7 @@ Object {
class="el-table-cell-content"
data-narrow-label="Total Cost"
>
£1.9625
£1.96
</div>
</div>
<div
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const UsageTable: FC<UsageTableProps> = ({ billing }) => {
return apiCalls.length ? (
<>
<Subtitle>Monthly Total</Subtitle>
<BodyText hasGreyText>£{billing?.totalCost}</BodyText>
<BodyText hasGreyText>£{billing?.totalCost?.toFixed(2).padStart(2, '0')}</BodyText>
<Subtitle>Breakdown</Subtitle>
<Table
rows={apiCalls.map(({ name, amount, cost, itemCount, items }) => ({
Expand All @@ -46,7 +46,7 @@ export const UsageTable: FC<UsageTableProps> = ({ billing }) => {
},
{
label: 'Total Cost',
value: cost ? ${cost}` : '£0',
value: cost ? ${cost.toFixed(2).padStart(2, '0')}` : '£0',
icon: 'homeSystem',
cellHasDarkText: true,
narrowTable: {
Expand Down
2 changes: 1 addition & 1 deletion packages/admin-portal/src/tests/badges/badge-functions.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion packages/admin-portal/src/tests/badges/badge-lines.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion packages/auto-bump/action/index.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions packages/connect-session/src/__mocks__/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export const mockLoginIdentity = {
offGroupName: 'Cool Office Group',
officeId: 'MVK',
orgProduct: 'agencyCloud',
agencyCloudId: 'SOME_AC_ID',
}

export const mockBrowserSession: ReapitConnectSession = {
Expand Down
1 change: 1 addition & 0 deletions packages/connect-session/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export interface ReapitConnectSession {
export interface LoginIdentity {
email: string
name: string
agencyCloudId: string | null
developerId: string | null
clientId: string | null
adminId: string | null
Expand Down
4 changes: 3 additions & 1 deletion packages/connect-session/src/utils/verify-decode-id-token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ export const connectSessionVerifyDecodeIdTokenWithPublicKeys = async (
return {
name: claim['name'],
email: claim['email'],
agencyCloudId: claim['custom:reapit:agencyCloudId'] || null,
developerId: claim['custom:reapit:developerId'] || null,
clientId: claim['custom:reapit:clientCode'] || null,
adminId: claim['custom:reapit:marketAdmin'] || null,
Expand All @@ -78,7 +79,8 @@ export const connectSessionVerifyDecodeIdTokenWithPublicKeys = async (
orgProduct: claim['custom:reapit:orgProduct'] || null,
}
} catch (error) {
console.error('Reapit Connect Session error:', error.message)
const err = error as Error
console.error('Reapit Connect Session error:', err.message)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export const mockLoginIdentity = {
offGroupName: 'Cool Office Group',
officeId: 'MVK',
orgProduct: 'agencyCloud',
agencyCloudId: 'SOME_AC_ID',
}
export const mockBrowserSession: ReapitConnectSession = {
accessToken: JSON.stringify({
Expand Down
1 change: 1 addition & 0 deletions packages/data-warehouse/src/services/__mocks__/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export const mockLoginIdentity = {
offGroupName: 'Cool Office Group',
officeId: 'MVK',
orgProduct: 'agencyCloud',
agencyCloudId: 'SOME_AC_ID',
}

export const mockBrowserSession: ReapitConnectSession = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ describe('DeveloperAppRevisionModal', () => {
offGroupName: 'Cool Office Group',
officeId: 'MVK',
orgProduct: 'agencyCloud',
agencyCloudId: 'SOME_AC_ID',
}
const fn = handleCancelPendingRevisionsButtonClick(spyDispatch, appId, appRevisionId, loginIdentity)
fn()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3655,49 +3655,28 @@ exports[`DeveloperSubmitApp should match a snapshot when pendingRevisions = fals
</form>
</Form>
</Formik>
<ModalV2
footer={
Array [
<Button
onClick={[Function]}
>
Close
</Button>,
]
}
isCentered={true}
onClose={[Function]}
title="Account Information Required"
visible={false}
<SubmitAppModal
Modal={[Function]}
closeModal={[Function]}
>
<Dialog
className="m36ncwu-modal-container"
closeIcon={
<span
aria-label="close"
className="delete"
/>
}
destroyOnClose={true}
footer={
Array [
<Button
onClick={[Function]}
>
Close
</Button>,
]
}
onClose={[Function]}
title={
<ModalHeaderV2>
Account Information Required
</ModalHeaderV2>
}
visible={false}
wrapClassName="m140lwlu-modal-centered"
/>
</ModalV2>
<ModalComponent
title="Account Information Required"
>
<Portal
id="root"
>
<Portal
containerInfo={<div />}
>
<Modal
isOpen={false}
onModalClose={[Function]}
title="Account Information Required"
/>
</Portal>
</Portal>
</ModalComponent>
</SubmitAppModal>
</DeveloperEditApp>
</Router>
</MemoryRouter>
Expand Down
Loading

0 comments on commit ead3b87

Please sign in to comment.