Put project related tabs in the correct order

This commit is contained in:
mabashian 2019-10-03 09:57:36 -04:00
parent b8fe3f648e
commit f502fbfad6
2 changed files with 15 additions and 8 deletions

View File

@ -129,22 +129,29 @@ class Project extends Component {
const tabsArray = [
{ name: i18n._(t`Details`), link: `${match.url}/details`, id: 0 },
{ name: i18n._(t`Access`), link: `${match.url}/access`, id: 1 },
{ name: i18n._(t`Schedules`), link: `${match.url}/schedules`, id: 2 },
{
name: i18n._(t`Job Templates`),
link: `${match.url}/job_templates`,
id: 3,
},
];
if (canSeeNotificationsTab) {
tabsArray.push({
name: i18n._(t`Notifications`),
link: `${match.url}/notifications`,
id: 4,
id: 2,
});
}
tabsArray.push(
{
name: i18n._(t`Job Templates`),
link: '/job_templates',
id: canSeeNotificationsTab ? 3 : 2,
},
{
name: i18n._(t`Schedules`),
link: '/schedules',
id: canSeeNotificationsTab ? 4 : 3,
}
);
const CardHeader = styled(PFCardHeader)`
--pf-c-card--first-child--PaddingTop: 0;
--pf-c-card--child--PaddingLeft: 0;

View File

@ -45,7 +45,7 @@ describe.only('<Project />', () => {
'.pf-c-tabs__item',
el => el.length === 5
);
expect(tabs.last().text()).toEqual('Notifications');
expect(tabs.at(2).text()).toEqual('Notifications');
done();
});