diff --git a/src/core/apollo/generated/apollo-hooks.ts b/src/core/apollo/generated/apollo-hooks.ts index 8922a07b0a..7afb2971e7 100644 --- a/src/core/apollo/generated/apollo-hooks.ts +++ b/src/core/apollo/generated/apollo-hooks.ts @@ -11453,9 +11453,9 @@ export function refetchRolesOrganizationQuery(variables: SchemaTypes.RolesOrgani } export const AssignLicensePlanToAccountDocument = gql` - mutation AssignLicensePlanToAccount($licensePlanId: UUID!, $accountID: UUID!, $licensingID: UUID!) { + mutation AssignLicensePlanToAccount($licensePlanId: UUID!, $accountId: UUID!, $licensingId: UUID!) { assignLicensePlanToAccount( - planData: { accountID: $accountID, licensePlanID: $licensePlanId, licensingID: $licensingID } + planData: { accountID: $accountId, licensePlanID: $licensePlanId, licensingID: $licensingId } ) { id } @@ -11480,8 +11480,8 @@ export type AssignLicensePlanToAccountMutationFn = Apollo.MutationFunction< * const [assignLicensePlanToAccountMutation, { data, loading, error }] = useAssignLicensePlanToAccountMutation({ * variables: { * licensePlanId: // value for 'licensePlanId' - * accountID: // value for 'accountID' - * licensingID: // value for 'licensingID' + * accountId: // value for 'accountId' + * licensingId: // value for 'licensingId' * }, * }); */ @@ -11506,9 +11506,9 @@ export type AssignLicensePlanToAccountMutationOptions = Apollo.BaseMutationOptio SchemaTypes.AssignLicensePlanToAccountMutationVariables >; export const RevokeLicensePlanFromAccountDocument = gql` - mutation RevokeLicensePlanFromAccount($licensePlanId: UUID!, $accountID: UUID!, $licensingID: UUID!) { + mutation RevokeLicensePlanFromAccount($licensePlanId: UUID!, $accountId: UUID!, $licensingId: UUID!) { revokeLicensePlanFromAccount( - planData: { accountID: $accountID, licensePlanID: $licensePlanId, licensingID: $licensingID } + planData: { accountID: $accountId, licensePlanID: $licensePlanId, licensingID: $licensingId } ) { id } @@ -11533,8 +11533,8 @@ export type RevokeLicensePlanFromAccountMutationFn = Apollo.MutationFunction< * const [revokeLicensePlanFromAccountMutation, { data, loading, error }] = useRevokeLicensePlanFromAccountMutation({ * variables: { * licensePlanId: // value for 'licensePlanId' - * accountID: // value for 'accountID' - * licensingID: // value for 'licensingID' + * accountId: // value for 'accountId' + * licensingId: // value for 'licensingId' * }, * }); */ diff --git a/src/core/apollo/generated/graphql-schema.ts b/src/core/apollo/generated/graphql-schema.ts index ce17577cac..1be670da28 100644 --- a/src/core/apollo/generated/graphql-schema.ts +++ b/src/core/apollo/generated/graphql-schema.ts @@ -16269,8 +16269,8 @@ export type RolesOrganizationQuery = { export type AssignLicensePlanToAccountMutationVariables = Exact<{ licensePlanId: Scalars['UUID']; - accountID: Scalars['UUID']; - licensingID: Scalars['UUID']; + accountId: Scalars['UUID']; + licensingId: Scalars['UUID']; }>; export type AssignLicensePlanToAccountMutation = { @@ -16280,8 +16280,8 @@ export type AssignLicensePlanToAccountMutation = { export type RevokeLicensePlanFromAccountMutationVariables = Exact<{ licensePlanId: Scalars['UUID']; - accountID: Scalars['UUID']; - licensingID: Scalars['UUID']; + accountId: Scalars['UUID']; + licensingId: Scalars['UUID']; }>; export type RevokeLicensePlanFromAccountMutation = { diff --git a/src/core/ui/dialogs/InfoDialog.tsx b/src/core/ui/dialogs/InfoDialog.tsx index cb4209598e..2f0b2225eb 100644 --- a/src/core/ui/dialogs/InfoDialog.tsx +++ b/src/core/ui/dialogs/InfoDialog.tsx @@ -11,12 +11,12 @@ import { gutters } from '../grid/utils'; // however there's no need of this entities, actions, etc. structure interface InfoDialogProps { entities: { - title?: string | React.ReactNode; - content?: ReactNode; - confirmButtonText?: string; + title: string | React.ReactNode; + content: ReactNode; + buttonCaption: string; }; actions: { - onConfirm: () => void; + onButtonClick: () => void; }; options: { show: boolean; @@ -27,22 +27,11 @@ interface InfoDialogProps { } const InfoDialog: FC<InfoDialogProps> = ({ entities, actions, options, state }) => { - const title = entities.title; - if (!title) { - throw new Error('The confirmation dialog needs a title provided'); - } - const content = entities.content; - if (!content) { - throw new Error('The confirmation dialog needs text content provided'); - } - const confirmButtonText = entities.confirmButtonText; - if (!confirmButtonText) { - throw new Error('The confirmation dialog needs button text content provided'); - } + const { title, content, buttonCaption } = entities; return ( - <Dialog open={options.show} aria-labelledby="confirmation-dialog" onClose={actions.onConfirm}> - <DialogHeader onClose={actions.onConfirm}> + <Dialog open={options.show} aria-labelledby="confirmation-dialog" onClose={actions.onButtonClick}> + <DialogHeader onClose={actions.onButtonClick}> <BlockTitle>{title}</BlockTitle> </DialogHeader> <DialogContent>{content}</DialogContent> @@ -51,9 +40,9 @@ const InfoDialog: FC<InfoDialogProps> = ({ entities, actions, options, state }) variant="text" loading={state?.isLoading} disabled={state?.isLoading} - onClick={actions.onConfirm} + onClick={actions.onButtonClick} > - {confirmButtonText} + {buttonCaption} </LoadingButton> </Actions> </Dialog> diff --git a/src/domain/community/contributor/organization/adminOrganizations/ManageLicensePlanAccount.graphql b/src/domain/community/contributor/organization/adminOrganizations/ManageLicensePlanAccount.graphql index f165c0a19f..ba141e7395 100644 --- a/src/domain/community/contributor/organization/adminOrganizations/ManageLicensePlanAccount.graphql +++ b/src/domain/community/contributor/organization/adminOrganizations/ManageLicensePlanAccount.graphql @@ -1,18 +1,18 @@ -mutation AssignLicensePlanToAccount($licensePlanId: UUID!, $accountID: UUID!, $licensingID: UUID!) { +mutation AssignLicensePlanToAccount($licensePlanId: UUID!, $accountId: UUID!, $licensingId: UUID!) { assignLicensePlanToAccount(planData: { - accountID: $accountID + accountID: $accountId licensePlanID: $licensePlanId - licensingID: $licensingID + licensingID: $licensingId }) { id } } -mutation RevokeLicensePlanFromAccount($licensePlanId: UUID!, $accountID: UUID!, $licensingID: UUID!) { +mutation RevokeLicensePlanFromAccount($licensePlanId: UUID!, $accountId: UUID!, $licensingId: UUID!) { revokeLicensePlanFromAccount(planData: { - accountID: $accountID + accountID: $accountId licensePlanID: $licensePlanId - licensingID: $licensingID + licensingID: $licensingId }) { id } diff --git a/src/domain/community/contributor/organization/adminOrganizations/useAdminGlobalOrganizationsList.ts b/src/domain/community/contributor/organization/adminOrganizations/useAdminGlobalOrganizationsList.ts index 2b3f0d4cd4..55f7b151a2 100644 --- a/src/domain/community/contributor/organization/adminOrganizations/useAdminGlobalOrganizationsList.ts +++ b/src/domain/community/contributor/organization/adminOrganizations/useAdminGlobalOrganizationsList.ts @@ -107,12 +107,12 @@ export const useAdminGlobalOrganizationsList = () => { }; const [assignLicense] = useAssignLicensePlanToAccountMutation(); - const assignLicensePlan = async (accountId: string, planId: string) => { + const assignLicensePlan = async (accountId: string, licensePlanId: string) => { await assignLicense({ variables: { - accountID: accountId, - licensePlanId: planId, - licensingID: data?.platform.licensing.id ?? '', + accountId, + licensePlanId, + licensingId: data?.platform.licensing.id ?? '', }, refetchQueries: [ refetchAdminGlobalOrganizationsListQuery({ @@ -125,12 +125,12 @@ export const useAdminGlobalOrganizationsList = () => { }; const [revokeLicense] = useRevokeLicensePlanFromAccountMutation(); - const revokeLicensePlan = async (accountId: string, planId: string) => { + const revokeLicensePlan = async (accountId: string, licensePlanId: string) => { await revokeLicense({ variables: { - accountID: accountId, - licensePlanId: planId, - licensingID: data?.platform.licensing.id ?? '', + accountId, + licensePlanId, + licensingId: data?.platform.licensing.id ?? '', }, refetchQueries: [ refetchAdminGlobalOrganizationsListQuery({ diff --git a/src/domain/community/user/adminUsers/useAdminGlobalUserList.tsx b/src/domain/community/user/adminUsers/useAdminGlobalUserList.tsx index 051277fae8..bbef3c039b 100644 --- a/src/domain/community/user/adminUsers/useAdminGlobalUserList.tsx +++ b/src/domain/community/user/adminUsers/useAdminGlobalUserList.tsx @@ -107,12 +107,12 @@ const useAdminGlobalUserList = ({ }; const [assignLicense] = useAssignLicensePlanToAccountMutation(); - const assignLicensePlan = async (accountId: string, planId: string) => { + const assignLicensePlan = async (accountId: string, licensePlanId: string) => { await assignLicense({ variables: { - accountID: accountId, - licensePlanId: planId, - licensingID: data?.platform.licensing.id ?? '', + accountId, + licensePlanId, + licensingId: data?.platform.licensing.id ?? '', }, refetchQueries: [ refetchUserListQuery({ @@ -125,12 +125,12 @@ const useAdminGlobalUserList = ({ }; const [revokeLicense] = useRevokeLicensePlanFromAccountMutation(); - const revokeLicensePlan = async (accountId: string, planId: string) => { + const revokeLicensePlan = async (accountId: string, licensePlanId: string) => { await revokeLicense({ variables: { - accountID: accountId, - licensePlanId: planId, - licensingID: data?.platform.licensing.id ?? '', + accountId, + licensePlanId, + licensingId: data?.platform.licensing.id ?? '', }, refetchQueries: [ refetchUserListQuery({ diff --git a/src/main/topLevelPages/myDashboard/newVirtualContributorWizard/useNewVirtualContributorWizard.tsx b/src/main/topLevelPages/myDashboard/newVirtualContributorWizard/useNewVirtualContributorWizard.tsx index fea0310ad7..77bf4f14b2 100644 --- a/src/main/topLevelPages/myDashboard/newVirtualContributorWizard/useNewVirtualContributorWizard.tsx +++ b/src/main/topLevelPages/myDashboard/newVirtualContributorWizard/useNewVirtualContributorWizard.tsx @@ -490,16 +490,16 @@ const useNewVirtualContributorWizard = (): useNewVirtualContributorWizardProvide }, }); - const vcId = data?.createVirtualContributor.id; + const virtualContributorId = data?.createVirtualContributor.id; - if (vcId) { + if (virtualContributorId) { if (parentCommunityId) { // the VC cannot be added to the BoK community // if it's not part of the parent community await addVirtualContributorToCommunity({ variables: { communityId: parentCommunityId, - virtualContributorId: vcId, + virtualContributorId, }, }); } @@ -508,7 +508,7 @@ const useNewVirtualContributorWizard = (): useNewVirtualContributorWizardProvide await addVirtualContributorToCommunity({ variables: { communityId: communityId, - virtualContributorId: vcId, + virtualContributorId, }, }); @@ -527,6 +527,7 @@ const useNewVirtualContributorWizard = (): useNewVirtualContributorWizardProvide return false; } catch (error) { + // TODO: log this to Sentry return false; } }; @@ -583,9 +584,9 @@ const useNewVirtualContributorWizard = (): useNewVirtualContributorWizardProvide entities={{ title: t('createVirtualContributorWizard.insufficientPrivileges.title'), content: t('createVirtualContributorWizard.insufficientPrivileges.description'), - confirmButtonText: t('buttons.ok'), + buttonCaption: t('buttons.ok'), }} - actions={{ onConfirm: onDialogClose }} + actions={{ onButtonClick: onDialogClose }} options={{ show: true }} /> )}