Skip to content

Commit

Permalink
Merge pull request #417 from openedx/kiram15/ENT-9457
Browse files Browse the repository at this point in the history
fix: bug bash fixes
  • Loading branch information
kiram15 authored Sep 12, 2024
2 parents ca5bd94 + 88f69f5 commit 3936064
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 73 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ import PropTypes from 'prop-types';
import {
ActionRow, Badge, Button, Icon, ModalDialog,
} from '@openedx/paragon';
import { Check, Launch } from '@openedx/paragon/icons';
import { Check, Close, Launch } from '@openedx/paragon/icons';
import { getConfig } from '@edx/frontend-platform';
import classNames from 'classnames';

const CustomerDetailModal = ({ customer, isOpen, close }) => {
const { DJANGO_ADMIN_LMS_BASE_URL } = getConfig();
Expand Down Expand Up @@ -34,11 +33,8 @@ const CustomerDetailModal = ({ customer, isOpen, close }) => {
<p>{customer.name || '--'}</p>
<p className="d-flex">
<Icon
className={classNames(
'mr-3',
{ 'text-white': !customer.active },
)}
src={Check}
className="mr-3"
src={customer.active ? Check : Close}
/>
Active Admin Portal
</p>
Expand All @@ -51,11 +47,8 @@ const CustomerDetailModal = ({ customer, isOpen, close }) => {
<h3 className="mt-4 mb-3">Data sharing consent</h3>
<p className="d-flex">
<Icon
className={classNames(
'mr-3',
{ 'text-white': !customer.enableDataSharingConsent },
)}
src={Check}
className="mr-3"
src={customer.enableDataSharingConsent ? Check : Close}
/>
Activate data sharing consent prompt
</p>
Expand All @@ -72,82 +65,51 @@ const CustomerDetailModal = ({ customer, isOpen, close }) => {
<p>{customer.defaultLanguage || '--'}</p>
<p className="d-flex">
<Icon
className={classNames(
'mr-3',
{ 'text-white': !customer.hideLaborMarketData },
)}
src={Check}
className="mr-3"
src={customer.hideLaborMarketData ? Check : Close}
/>
Hide labor market data
</p>
<h3 className="mt-4 mb-3">Integration and learner platform settings</h3>
<p className="d-flex">
<Icon
className={classNames(
'mr-3',
{ 'text-white': !customer.enablePortalReportingConfigScreen },
)}
src={Check}
className="mr-3"
src={customer.enablePortalReportingConfigScreen ? Check : Close}
/>
Display learning platform configuration screen
</p>
<p className="d-flex">
<Icon
className={classNames(
'mr-3',
{ 'text-white': !customer.enablePortalSamlConfigurationScreen },
)}
src={Check}
className="mr-3"
src={customer.enablePortalSamlConfigurationScreen ? Check : Close}
/>
Display SSO configuration screen
</p>
<p className="d-flex">
<Icon
className={classNames(
'mr-3',
{ 'text-white': !customer.enableSlugLogin },
)}
src={Check}
className="mr-3"
src={customer.enableSlugLogin ? Check : Close}
/>
Allow slug login for SSO
</p>
<p className="d-flex">
<Icon
className={classNames(
'mr-3',
{ 'text-white': !customer.replaceSensitiveSsoUsername },
)}
src={Check}
className="mr-3"
src={customer.replaceSensitiveSsoUsername ? Check : Close}
/>
Replace sensitive SSO username
</p>
<p className="d-flex">
<Icon
className={classNames(
'mr-3',
{ 'text-white': !customer.hideCourseOriginalPrice },
)}
src={Check}
className="mr-3"
src={customer.hideCourseOriginalPrice ? Check : Close}
/>
Hide course price on learning platform
</p>
<p className="d-flex">
<Icon
className={classNames(
'mr-3',
{ 'text-white': !customer.hideCourseOriginalPrice },
)}
src={Check}
/>
Hide course price on learning platform
</p>
<p className="d-flex">
<Icon
className={classNames(
'mr-3',
{ 'text-white': !customer.enableGenerationOfApiCredentials },
)}
src={Check}
className="mr-3"
src={customer.enableGenerationOfApiCredentials ? Check : Close}
/>
Allow generation of API credentials
</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import PropTypes from 'prop-types';

import CustomerViewCard from './CustomerViewCard';
import { formatDate } from '../data/utils';
import DJANGO_ADMIN_BASE_URL from '../data/constants';

const CustomerIntegrations = ({
slug, activeIntegrations, activeSSO, apiCredentialsEnabled,
Expand Down Expand Up @@ -47,8 +46,6 @@ const CustomerIntegrations = ({
slug={slug}
header="Integration"
title="API"
buttonText="Open in Django"
buttonLink={`${DJANGO_ADMIN_BASE_URL}/admin/enterprise/enterprisecustomerinvitekey/`}
/>
)}
</div>
Expand Down
31 changes: 18 additions & 13 deletions src/Configuration/Customers/CustomerDetailView/CustomerViewCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,24 @@ const CustomerViewCard = (
<Card.Section className="pt-0 x-small text-gray-400">
{subtext && <div>{subtext}</div>}
</Card.Section>
<Card.Footer>
<Button>
<Hyperlink
destination={buttonLink}
rel="noopener noreferrer"
target="_blank"
className="text-white"
showLaunchIcon
>
{buttonText}
</Hyperlink>
</Button>
</Card.Footer>
{buttonText && (
<Card.Footer>
<Button>
<Hyperlink
destination={buttonLink}
rel="noopener noreferrer"
target="_blank"
className="text-white"
showLaunchIcon
>
{buttonText}
</Hyperlink>
</Button>
</Card.Footer>
)}
{!buttonText && (
<p className="mb-5" />
)}
</Card>
);

Expand Down

0 comments on commit 3936064

Please sign in to comment.