Skip to content

Commit

Permalink
Merge pull request #975 from openedx/bcitro/ENT-6881
Browse files Browse the repository at this point in the history
fix: hide integration sync status message behind feature flag
  • Loading branch information
bcitro committed Mar 10, 2023
2 parents 7eb4eec + 96dc2c6 commit 68d7ed9
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/components/settings/SettingsLMSTab/ExistingCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ const ExistingCard = ({
const redirectPath = `${useRouteMatch().url}`;
const [showDeleteModal, setShowDeleteModal] = useState(false);
const isEdxStaff = getAuthenticatedUser().administrator;
const showErrorReporting = isEdxStaff && features.FEATURE_INTEGRATION_REPORTING;

const toggleConfig = async (id, channelType, toggle) => {
const configOptions = {
Expand Down Expand Up @@ -101,7 +102,7 @@ const ExistingCard = ({
const getCardButton = () => {
switch (getStatus(config)) {
case ACTIVE:
if (isEdxStaff && features.FEATURE_INTEGRATION_REPORTING) {
if (showErrorReporting) {
return <Button variant="outline-primary" href={`${redirectPath}${config.channelCode}/${config.id}`}>View sync history</Button>;
}
return null;
Expand Down Expand Up @@ -180,7 +181,7 @@ const ExistingCard = ({
alt="Actions dropdown"
/>
<Dropdown.Menu>
{(isInactive && isEdxStaff && features.FEATURE_INTEGRATION_REPORTING) && (
{(isInactive && showErrorReporting) && (
<div className="d-flex">
<Dropdown.Item
href={`${redirectPath}${config.channelCode}/${config.id}`}
Expand Down Expand Up @@ -262,8 +263,12 @@ const ExistingCard = ({
/>
<Card.Footer className="pt-2 pb-2 justify-content-between">
<div className="x-small d-flex align-items-center">
<Icon className="small-icon" src={Sync} />
{getLastSync()}
{showErrorReporting && (
<>
<Icon className="small-icon" src={Sync} />
{getLastSync()}
</>
)}
</div>
{getCardButton()}
</Card.Footer>
Expand Down

0 comments on commit 68d7ed9

Please sign in to comment.