Skip to content

Commit

Permalink
Merge pull request #1010 from openedx/ea/ent-7433
Browse files Browse the repository at this point in the history
chore: portal appearance tab appears by default
  • Loading branch information
emrosarioa committed Jul 27, 2023
2 parents 70536da + 30545f9 commit 88357d6
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
30 changes: 15 additions & 15 deletions src/components/settings/SettingsTabs.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,21 @@ const SettingsTabs = ({

const tabArray = useMemo(() => {
const initialTabs = [];
if (SETTINGS_PAGE_APPEARANCE_TAB) {
initialTabs.push(
<Tab
key={SETTINGS_TABS_VALUES.appearance}
eventKey={SETTINGS_TABS_VALUES.appearance}
title={SETTINGS_TAB_LABELS.appearance}
>
<SettingsAppearanceTab
enterpriseId={enterpriseId}
enterpriseBranding={enterpriseBranding}
updatePortalConfiguration={updatePortalConfiguration}
/>
</Tab>,
);
}
if (enableLearnerPortal) {
initialTabs.push(
<Tab
Expand Down Expand Up @@ -98,21 +113,6 @@ const SettingsTabs = ({
</Tab>,
);
}
if (SETTINGS_PAGE_APPEARANCE_TAB) {
initialTabs.push(
<Tab
key={SETTINGS_TABS_VALUES.appearance}
eventKey={SETTINGS_TABS_VALUES.appearance}
title={SETTINGS_TAB_LABELS.appearance}
>
<SettingsAppearanceTab
enterpriseId={enterpriseId}
enterpriseBranding={enterpriseBranding}
updatePortalConfiguration={updatePortalConfiguration}
/>
</Tab>,
);
}
return initialTabs;
}, [
FEATURE_SSO_SETTINGS_TAB,
Expand Down
2 changes: 1 addition & 1 deletion src/components/settings/data/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export const SETTINGS_TAB_LABELS = {
};

/** Default tab when no parameter is given */
export const DEFAULT_TAB = ACCESS_TAB;
export const DEFAULT_TAB = APPEARANCE_TAB;

/**
* Url parameter that the set in the router
Expand Down
4 changes: 2 additions & 2 deletions src/components/settings/tests/SettingsPage.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ describe('<SettingsPage />', () => {
jest.clearAllMocks();
});

it('Redirects to access tab when no param given', () => {
it('Redirects to appearance tab when no param given', () => {
render(settingsPageWithRouter('/settings'));
expect(screen.queryByText('404')).toBeFalsy();
expect(screen.queryByText('access')).toBeTruthy();
expect(screen.queryByText('appearance')).toBeTruthy();
});

it('Does not redirect when access is passed', () => {
Expand Down

0 comments on commit 88357d6

Please sign in to comment.