Skip to content

Commit c301952

Browse files
authored
Merge pull request #3944 from dlabrecq/ocp-projects
OCP unallocated and unattributed projects should be exportable
2 parents 24ff798 + b95077f commit c301952

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

src/routes/components/dataToolbar/dataToolbar.styles.ts

+3
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,7 @@ export const styles = {
1111
paddingBottom: global_spacer_md.value,
1212
paddingTop: global_spacer_md.value,
1313
},
14+
platformCosts: {
15+
marginTop: '6px',
16+
},
1417
} as { [className: string]: React.CSSProperties };

src/routes/components/dataToolbar/utils/actions.tsx

+5-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { ExportIcon } from '@patternfly/react-icons/dist/esm/icons/export-icon';
33
import { intl } from 'components/i18n';
44
import messages from 'locales/messages';
55
import React from 'react';
6+
import { styles } from 'routes/components/dataToolbar/dataToolbar.styles';
67
import { DropdownWrapper } from 'routes/components/dropdownWrapper';
78

89
// Column management
@@ -64,7 +65,10 @@ export const getPlatformCosts = ({
6465
onPlatformCostsChanged?: (checked: boolean) => void;
6566
}) => {
6667
return (
67-
<ToolbarItem visibility={{ default: 'hidden', '2xl': 'visible', xl: 'visible', lg: 'hidden' }}>
68+
<ToolbarItem
69+
visibility={{ default: 'hidden', '2xl': 'visible', xl: 'visible', lg: 'hidden' }}
70+
style={styles.platformCosts}
71+
>
6872
<Switch
6973
id="platform-costs"
7074
label={intl.formatMessage(messages.sumPlatformCosts)}

src/routes/details/ocpDetails/detailsTable.tsx

+3-6
Original file line numberDiff line numberDiff line change
@@ -226,14 +226,11 @@ class DetailsTableBase extends React.Component<DetailsTableProps, DetailsTableSt
226226
((item.cost.platformDistributed && item.cost.platformDistributed.value > 0) ||
227227
(item.cost.workerUnallocatedDistributed && item.cost.workerUnallocatedDistributed.value > 0));
228228
const desc = item.id && item.id !== item.label ? <div style={styles.infoDescription}>{item.id}</div> : null;
229-
const isDisabled =
230-
label === `${noPrefix}${groupBy}` ||
231-
label === `${noPrefix}${groupByTagKey}` ||
232-
isUnallocatedProject ||
233-
isUnattributedCosts;
229+
const isDisabled = label === `${noPrefix}${groupBy}` || label === `${noPrefix}${groupByTagKey}`;
230+
const isLinkDisabled = isDisabled || isUnallocatedProject || isUnattributedCosts;
234231
const actions = this.getActions(item, isDisabled);
235232

236-
const name = isDisabled ? (
233+
const name = isLinkDisabled ? (
237234
(label as any)
238235
) : (
239236
<Link

0 commit comments

Comments
 (0)