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

feat(web.office): add react uapp #13943

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from
Draft
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 @@ -7,7 +7,7 @@ import useServiceLoader from "./useServiceLoader";
import OrderTrigger from '../order/OrderTrigger';
import webShopConfig from '../order/shop-config/web';
import { ShopItem } from '../order/OrderPopupContent';
import getIcon from './GetIcon';
import getIcon from './GetIcon';
import { useFeatureAvailability } from '@ovh-ux/manager-react-components';

export const webFeatures = [
Expand All @@ -23,13 +23,13 @@ export const webFeatures = [
'emails:delegate',
'emails',
'exchange:web-dashboard',
'office',
'office-reseller',
'sharepoint',
'web:microsoft',
'web-paas',
'cloud-web',
'cloud-database',
'web-office',
'zimbra'
];

Expand Down Expand Up @@ -259,21 +259,36 @@ export default function WebSidebar() {
...service,
}));
},
},
features.office && {
id: 'office',
}, features['web-office'] &&
{
id: 'web-office',
label: t('sidebar_license_office'),
icon: getIcon('ms-Icon ms-Icon--OfficeLogo'),
routeMatcher: new RegExp(`/office`),
routeMatcher: new RegExp('^/web-office'),
async loader() {
const services = await loadServices('/license/office');
return services.map((service) => ({
icon: getIcon('ms-Icon ms-Icon--OfficeLogo'),
...service,
}));
return [
{
id: 'web_office_list',
label: t('sidebar_license_office_list'),
href: navigation.getURL(
'web-office',
`#/`
),
icon: getIcon('oui-icon oui-icon-list'),
ignoreSearch: true,
},
...services.map((service) => ({
...service,
icon: getIcon('ms-Icon ms-Icon--OfficeLogo'),
href: navigation.getURL(
'web-office',
`#/license/${service.serviceName}`
),
})),
];
},
}
],
},]
});
} else {
if (features['exchange:web-dashboard']) {
Expand Down Expand Up @@ -324,7 +339,7 @@ export default function WebSidebar() {
return menu;
};

const {data: availability} = useFeatureAvailability(webFeatures);
const { data: availability } = useFeatureAvailability(webFeatures);

useEffect(() => {
if (availability) {
Expand Down
Loading
Loading