Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: bug bash fixes #417

Merged
merged 1 commit into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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