Skip to content

Commit

Permalink
OCP unallocated and unattributed projects should be exportable
Browse files Browse the repository at this point in the history
  • Loading branch information
dlabrecq committed Jul 18, 2024
1 parent 24ff798 commit b95077f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
3 changes: 3 additions & 0 deletions src/routes/components/dataToolbar/dataToolbar.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,7 @@ export const styles = {
paddingBottom: global_spacer_md.value,
paddingTop: global_spacer_md.value,
},
platformCosts: {
marginTop: '6px',
},
} as { [className: string]: React.CSSProperties };
6 changes: 5 additions & 1 deletion src/routes/components/dataToolbar/utils/actions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { ExportIcon } from '@patternfly/react-icons/dist/esm/icons/export-icon';
import { intl } from 'components/i18n';
import messages from 'locales/messages';
import React from 'react';
import { styles } from 'routes/components/dataToolbar/dataToolbar.styles';
import { DropdownWrapper } from 'routes/components/dropdownWrapper';

// Column management
Expand Down Expand Up @@ -64,7 +65,10 @@ export const getPlatformCosts = ({
onPlatformCostsChanged?: (checked: boolean) => void;
}) => {
return (
<ToolbarItem visibility={{ default: 'hidden', '2xl': 'visible', xl: 'visible', lg: 'hidden' }}>
<ToolbarItem
visibility={{ default: 'hidden', '2xl': 'visible', xl: 'visible', lg: 'hidden' }}
style={styles.platformCosts}
>
<Switch
id="platform-costs"
label={intl.formatMessage(messages.sumPlatformCosts)}
Expand Down
9 changes: 3 additions & 6 deletions src/routes/details/ocpDetails/detailsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -226,14 +226,11 @@ class DetailsTableBase extends React.Component<DetailsTableProps, DetailsTableSt
((item.cost.platformDistributed && item.cost.platformDistributed.value > 0) ||
(item.cost.workerUnallocatedDistributed && item.cost.workerUnallocatedDistributed.value > 0));
const desc = item.id && item.id !== item.label ? <div style={styles.infoDescription}>{item.id}</div> : null;
const isDisabled =
label === `${noPrefix}${groupBy}` ||
label === `${noPrefix}${groupByTagKey}` ||
isUnallocatedProject ||
isUnattributedCosts;
const isDisabled = label === `${noPrefix}${groupBy}` || label === `${noPrefix}${groupByTagKey}`;
const isLinkDisabled = isDisabled || isUnallocatedProject || isUnattributedCosts;
const actions = this.getActions(item, isDisabled);

const name = isDisabled ? (
const name = isLinkDisabled ? (
(label as any)
) : (
<Link
Expand Down

0 comments on commit b95077f

Please sign in to comment.