1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-09-24 17:51:14 +02:00

Don't render anything if the flag isn't on

This commit is contained in:
Thomas Heartman 2025-09-10 15:50:02 +02:00
parent 61a90a0950
commit 2ff56be7af
No known key found for this signature in database
GPG Key ID: BD1F880DAED1EE78

View File

@ -17,6 +17,7 @@ import { AvatarCell } from 'component/changeRequest/ProjectChangeRequests/Change
import { HighlightCell } from 'component/common/Table/cells/HighlightCell/HighlightCell'; import { HighlightCell } from 'component/common/Table/cells/HighlightCell/HighlightCell';
import { GlobalChangeRequestTitleCell } from './GlobalChangeRequestTitleCell.js'; import { GlobalChangeRequestTitleCell } from './GlobalChangeRequestTitleCell.js';
import { FeaturesCell } from '../ProjectChangeRequests/ChangeRequestsTabs/FeaturesCell.js'; import { FeaturesCell } from '../ProjectChangeRequests/ChangeRequestsTabs/FeaturesCell.js';
import { useUiFlag } from 'hooks/useUiFlag.js';
// Mock data with varied projects and change requests // Mock data with varied projects and change requests
const mockChangeRequests = [ const mockChangeRequests = [
@ -143,7 +144,7 @@ const mockChangeRequests = [
}, },
]; ];
export const ChangeRequests = () => { const ChangeRequestsInner = () => {
const loading = false; const loading = false;
const columns = useMemo( const columns = useMemo(
() => [ () => [
@ -277,3 +278,15 @@ export const ChangeRequests = () => {
</PageContent> </PageContent>
); );
}; };
export const ChangeRequests = () => {
if (!useUiFlag('globalChangeRequestList')) {
return (
<PageContent header={<PageHeader title='Change requests' />}>
<p>Nothing to see here. Move along.</p>
</PageContent>
);
}
return <ChangeRequestsInner />;
};