Skip to content

Commit

Permalink
Relocate cost model components under settings/costModels
Browse files Browse the repository at this point in the history
  • Loading branch information
dlabrecq committed May 8, 2023
1 parent 093988d commit 79765f4
Show file tree
Hide file tree
Showing 120 changed files with 85 additions and 84 deletions.
2 changes: 1 addition & 1 deletion src/routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const AzureBreakdown = lazy(
const AzureDetails = lazy(() => import(/* webpackChunkName: "azureDetails" */ 'routes/views/details/azureDetails'));
const CostModelOld = lazy(() => import(/* webpackChunkName: "costModel" */ 'routes/costModels/costModel'));
const CostModelsDetailsOld = lazy(() => import(/* lazy: "costModelsDetails" */ 'routes/costModels/costModelsDetails'));
const CostModel = lazy(() => import(/* webpackChunkName: "costModel" */ 'routes/settings/costModel'));
const CostModel = lazy(() => import(/* webpackChunkName: "costModel" */ 'routes/settings/costModels/costModel'));
const Explorer = lazy(() => import(/* webpackChunkName: "explorer" */ 'routes/views/explorer'));
const GcpBreakdown = lazy(() => import(/* webpackChunkName: "gcpBreakdown" */ 'routes/views/details/gcpBreakdown'));
const GcpDetails = lazy(() => import(/* webpackChunkName: "gcpDetails" */ 'routes/views/details/gcpDetails'));
Expand Down
2 changes: 1 addition & 1 deletion src/routes/costModels/costModel/addSourceWizard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ class AddSourceWizardBase extends React.Component<AddSourceWizardProps, AddSourc
</GridItem>
<GridItem span={2}>
<TextContent>
<Text component={TextVariants.p}>{intl.formatMessage(messages.costModelsSourceType)}</Text>
<Text component={TextVariants.p}>{intl.formatMessage(messages.sourceType)}</Text>
</TextContent>
</GridItem>
<GridItem span={10}>
Expand Down
2 changes: 1 addition & 1 deletion src/routes/costModels/costModel/table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class TableBase extends React.Component<TableBaseProps, TableBaseState> {
return (
<>
<Title headingLevel="h2" size={TitleSizes.md} style={styles.sourceTypeTitle}>
{intl.formatMessage(messages.costModelsSourceType)}: {current.source_type}
{intl.formatMessage(messages.sourceType)}: {current.source_type}
</Title>
<SourcesToolbar
actionButtonProps={{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ class GeneralInformation extends React.Component<GeneralInformationProps, any> {
direction={SelectDirection.up}
appendMenuTo="inline"
maxHeight={styles.selector.maxHeight}
label={messages.costModelsSourceType}
label={messages.sourceType}
toggleAriaLabel={intl.formatMessage(messages.costModelsWizardEmptySourceTypeLabel)}
placeholderText={intl.formatMessage(messages.costModelsWizardEmptySourceTypeLabel)}
value={getValueLabel(type, sourceTypeOptions)}
Expand Down
2 changes: 1 addition & 1 deletion src/routes/costModels/costModelsDetails/table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class CostModelsTableBase extends React.Component<CostModelsTableProps, CostMode
},
{ title: intl.formatMessage(messages.description) },
{
title: intl.formatMessage(messages.costModelsSourceType),
title: intl.formatMessage(messages.sourceType),
data: { orderName: 'source_type' },
...(rows.length && { transforms: [sortable] }),
},
Expand Down
2 changes: 1 addition & 1 deletion src/routes/costModels/costModelsDetails/utils/filters.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ const sourceTypeFilterMergeProps = (
const chips = query.source_type ? [query.source_type] : [];
return {
chips,
categoryName: intl.formatMessage(messages.costModelsSourceType),
categoryName: intl.formatMessage(messages.sourceType),
deleteChip: onDeleteChipGroup(router, { ...initialCostModelsQuery, ...query }, 'source_type'),
filterType,
intl,
Expand Down
2 changes: 1 addition & 1 deletion src/routes/costModels/costModelsDetails/utils/toolbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const CostModelsFilterSelectorBase: React.FC<CostModelsFilterSelectorProps> = ({
{intl.formatMessage(messages.description)}
</SelectOption>,
<SelectOption key="sourceType" value="sourceType">
{intl.formatMessage(messages.costModelsSourceType)}
{intl.formatMessage(messages.sourceType)}
</SelectOption>,
];
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import userEvent from '@testing-library/user-event';
import type { Rate } from 'api/rates';
import messages from 'locales/messages';
import React from 'react';
import { CostModelContext, defaultCostModelContext } from 'routes/settings/costModelWizard/context';
import { CostModelContext, defaultCostModelContext } from 'routes/settings/costModels/costModelWizard/context';

import AddPriceList from './addPriceList';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ import messages from 'locales/messages';
import React from 'react';
import type { WrappedComponentProps } from 'react-intl';
import { injectIntl } from 'react-intl';
import type { RateFormData } from 'routes/settings/components/rateForm';
import { canSubmit as isReadyForSubmit, RateForm, useRateData } from 'routes/settings/components/rateForm';
import { CostModelContext } from 'routes/settings/costModelWizard/context';
import type { RateFormData } from 'routes/settings/costModels/components/rateForm';
import { canSubmit as isReadyForSubmit, RateForm, useRateData } from 'routes/settings/costModels/components/rateForm';
import { CostModelContext } from 'routes/settings/costModels/costModelWizard/context';

interface AddPriceListOwnProps {
cancel: () => void;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { checkBoxLogic, deleteChip } from 'routes/settings/components/logic/selectCheckbox';
import { checkBoxLogic, deleteChip } from 'routes/settings/costModels/components/logic/selectCheckbox';

export interface PriceListSearchQuery {
primary: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import messages from 'locales/messages';
import React from 'react';
import type { WrappedComponentProps } from 'react-intl';
import { injectIntl } from 'react-intl';
import { RateInput } from 'routes/settings/components/inputs/rateInput';
import { Selector } from 'routes/settings/components/inputs/selector';
import { SimpleInput } from 'routes/settings/components/inputs/simpleInput';
import { RateInput } from 'routes/settings/costModels/components/inputs/rateInput';
import { Selector } from 'routes/settings/costModels/components/inputs/selector';
import { SimpleInput } from 'routes/settings/costModels/components/inputs/simpleInput';
import { unitsLookupKey } from 'utils/format';

import { TaggingRatesForm } from './taggingRatesForm';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import messages from 'locales/messages';
import React from 'react';
import type { WrappedComponentProps } from 'react-intl';
import { injectIntl } from 'react-intl';
import { RateInput } from 'routes/settings/components/inputs/rateInput';
import { SimpleInput } from 'routes/settings/components/inputs/simpleInput';
import { RateInput } from 'routes/settings/costModels/components/inputs/rateInput';
import { SimpleInput } from 'routes/settings/costModels/components/inputs/simpleInput';

import type { UseRateData } from './useRateForm';
import type { RateFormErrors, RateFormTagValue } from './utils';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Select, SelectOption, SelectVariant } from '@patternfly/react-core';
import React from 'react';
import { WithStateMachine } from 'routes/settings/components/hoc/withStateMachine';
import { selectMachineState } from 'routes/settings/components/logic/selectStateMachine';
import type { Option } from 'routes/settings/components/logic/types';
import { WithStateMachine } from 'routes/settings/costModels/components/hoc/withStateMachine';
import { selectMachineState } from 'routes/settings/costModels/components/logic/selectStateMachine';
import type { Option } from 'routes/settings/costModels/components/logic/types';

interface CheckboxSelectorProps {
setSelections: (selection: string) => void;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Select, SelectOption } from '@patternfly/react-core';
import { FilterIcon } from '@patternfly/react-icons/dist/esm/icons/filter-icon';
import React from 'react';
import { WithStateMachine } from 'routes/settings/components/hoc/withStateMachine';
import { selectMachineState } from 'routes/settings/components/logic/selectStateMachine';
import type { Option } from 'routes/settings/components/logic/types';
import { WithStateMachine } from 'routes/settings/costModels/components/hoc/withStateMachine';
import { selectMachineState } from 'routes/settings/costModels/components/logic/selectStateMachine';
import type { Option } from 'routes/settings/costModels/components/logic/types';

export interface PrimarySelectorProps {
setPrimary: (primary: string) => void;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import {
mergeToRequest,
RateForm,
useRateData,
} from 'routes/settings/components/rateForm';
import { initialRateFormData } from 'routes/settings/components/rateForm/utils';
} from 'routes/settings/costModels/components/rateForm';
import { initialRateFormData } from 'routes/settings/costModels/components/rateForm/utils';
import { createMapStateToProps } from 'store/common';
import { costModelsActions, costModelsSelectors } from 'store/costModels';
import { metricsSelectors } from 'store/metrics';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import { injectIntl } from 'react-intl';
import { connect } from 'react-redux';
import { EmptyFilterState } from 'routes/components/state/emptyFilterState';
import { LoadingState } from 'routes/components/state/loadingState';
import { SourcesModalErrorState } from 'routes/settings/components/errorState';
import { addMultiValueQuery, removeMultiValueQuery } from 'routes/settings/components/filterLogic';
import { WarningIcon } from 'routes/settings/components/warningIcon';
import { SourcesModalErrorState } from 'routes/settings/costModels/components/errorState';
import { addMultiValueQuery, removeMultiValueQuery } from 'routes/settings/costModels/components/filterLogic';
import { WarningIcon } from 'routes/settings/costModels/components/warningIcon';
import { createMapStateToProps } from 'store/common';
import { sourcesActions, sourcesSelectors } from 'store/sourceSettings';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import React from 'react';
import type { WrappedComponentProps } from 'react-intl';
import { injectIntl } from 'react-intl';
import { connect } from 'react-redux';
import { parseApiError } from 'routes/settings/costModelWizard/parseError';
import { parseApiError } from 'routes/settings/costModels/costModelWizard/parseError';
import { FetchStatus } from 'store/common';
import { createMapStateToProps } from 'store/common';
import { costModelsSelectors } from 'store/costModels';
Expand Down Expand Up @@ -145,7 +145,7 @@ class AddSourceWizardBase extends React.Component<AddSourceWizardProps, AddSourc
</GridItem>
<GridItem span={2}>
<TextContent>
<Text component={TextVariants.p}>{intl.formatMessage(messages.costModelsSourceType)}</Text>
<Text component={TextVariants.p}>{intl.formatMessage(messages.sourceType)}</Text>
</TextContent>
</GridItem>
<GridItem span={10}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ import React from 'react';
import type { WrappedComponentProps } from 'react-intl';
import { injectIntl } from 'react-intl';
import { connect } from 'react-redux';
import DistributionCard from 'routes/settings/costModel/distribution';
import MarkupCard from 'routes/settings/costModel/markup';
import PriceListTable from 'routes/settings/costModel/priceListTable';
import SourceTable from 'routes/settings/costModel/sourceTable';
import { parseApiError } from 'routes/settings/costModelWizard/parseError';
import DistributionCard from 'routes/settings/costModels/costModel/distribution';
import MarkupCard from 'routes/settings/costModels/costModel/markup';
import PriceListTable from 'routes/settings/costModels/costModel/priceListTable';
import SourceTable from 'routes/settings/costModels/costModel/sourceTable';
import { parseApiError } from 'routes/settings/costModels/costModelWizard/parseError';
import { Loading } from 'routes/state/loading';
import { NotAvailable } from 'routes/state/notAvailable';
import { createMapStateToProps, FetchStatus } from 'store/common';
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import messages from 'locales/messages';
import React from 'react';
import { useIntl } from 'react-intl';
import { connect } from 'react-redux';
import { ReadOnlyTooltip } from 'routes/settings/components/readOnlyTooltip';
import { ReadOnlyTooltip } from 'routes/settings/costModels/components/readOnlyTooltip';
import { createMapStateToProps } from 'store/common';
import { costModelsActions, costModelsSelectors } from 'store/costModels';
import { rbacSelectors } from 'store/rbac';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ import { injectIntl } from 'react-intl';
import { connect } from 'react-redux';
import { Link } from 'react-router-dom';
import { routes } from 'routes';
import { ReadOnlyTooltip } from 'routes/settings/components/readOnlyTooltip';
import { styles } from 'routes/settings/costModel/costModelsDetails.styles';
import Dialog from 'routes/settings/costModel/dialog';
import UpdateCostModelModal from 'routes/settings/costModel/updateCostModel';
import { ReadOnlyTooltip } from 'routes/settings/costModels/components/readOnlyTooltip';
import { styles } from 'routes/settings/costModels/costModel/costModelsDetails.styles';
import Dialog from 'routes/settings/costModels/costModel/dialog';
import UpdateCostModelModal from 'routes/settings/costModels/costModel/updateCostModel';
import { createMapStateToProps } from 'store/common';
import { costModelsActions, costModelsSelectors } from 'store/costModels';
import { rbacSelectors } from 'store/rbac';
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import React from 'react';
import type { WrappedComponentProps } from 'react-intl';
import { injectIntl } from 'react-intl';
import { connect } from 'react-redux';
import { ReadOnlyTooltip } from 'routes/settings/components/readOnlyTooltip';
import { ReadOnlyTooltip } from 'routes/settings/costModels/components/readOnlyTooltip';
import { createMapStateToProps } from 'store/common';
import { costModelsActions, costModelsSelectors } from 'store/costModels';
import { rbacSelectors } from 'store/rbac';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ import { injectIntl } from 'react-intl';
import { connect } from 'react-redux';
import { EmptyFilterState } from 'routes/components/state/emptyFilterState';
import { LoadingState } from 'routes/components/state/loadingState';
import { WithPriceListSearch } from 'routes/settings/components/hoc/withPriceListSearch';
import { PriceListToolbar } from 'routes/settings/components/priceListToolbar';
import { compareBy } from 'routes/settings/components/rateForm/utils';
import { RateTable } from 'routes/settings/components/rateTable';
import { CheckboxSelector } from 'routes/settings/components/toolbar/checkboxSelector';
import { PrimarySelector } from 'routes/settings/components/toolbar/primarySelector';
import { WithPriceListSearch } from 'routes/settings/costModels/components/hoc/withPriceListSearch';
import { PriceListToolbar } from 'routes/settings/costModels/components/priceListToolbar';
import { compareBy } from 'routes/settings/costModels/components/rateForm/utils';
import { RateTable } from 'routes/settings/costModels/components/rateTable';
import { CheckboxSelector } from 'routes/settings/costModels/components/toolbar/checkboxSelector';
import { PrimarySelector } from 'routes/settings/costModels/components/toolbar/primarySelector';
import { FetchStatus } from 'store/common';
import { createMapStateToProps } from 'store/common';
import { costModelsActions, costModelsSelectors } from 'store/costModels';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
import { FilterIcon } from '@patternfly/react-icons/dist/esm/icons/filter-icon';
import { SearchIcon } from '@patternfly/react-icons/dist/esm/icons/search-icon';
import React from 'react';
import { ReadOnlyTooltip } from 'routes/settings/components/readOnlyTooltip';
import { ReadOnlyTooltip } from 'routes/settings/costModels/components/readOnlyTooltip';

interface FilterInputProps {
id: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import type { WrappedComponentProps } from 'react-intl';
import { injectIntl } from 'react-intl';
import { connect } from 'react-redux';
import { EmptyFilterState } from 'routes/components/state/emptyFilterState';
import { addMultiValueQuery, removeMultiValueQuery } from 'routes/settings/components/filterLogic';
import SourcesTable from 'routes/settings/costModel/sourcesTable';
import { addMultiValueQuery, removeMultiValueQuery } from 'routes/settings/costModels/components/filterLogic';
import SourcesTable from 'routes/settings/costModels/costModel/sourcesTable';
import { createMapStateToProps } from 'store/common';
import { rbacSelectors } from 'store/rbac';

Expand Down Expand Up @@ -67,7 +67,7 @@ class TableBase extends React.Component<TableBaseProps, TableBaseState> {
return (
<>
<Title headingLevel="h2" size={TitleSizes.md} style={styles.sourceTypeTitle}>
{intl.formatMessage(messages.costModelsSourceType)}: {current.source_type}
{intl.formatMessage(messages.sourceType)}: {current.source_type}
</Title>
<SourcesToolbar
actionButtonProps={{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ import React from 'react';
import type { WrappedComponentProps } from 'react-intl';
import { injectIntl } from 'react-intl';
import { connect } from 'react-redux';
import { Form } from 'routes/settings/components/forms/form';
import { Form } from 'routes/settings/costModels/components/forms/form';
import {
canSubmit as isReadyForSubmit,
genFormDataFromRate,
hasDiff,
mergeToRequest,
RateForm,
useRateData,
} from 'routes/settings/components/rateForm';
} from 'routes/settings/costModels/components/rateForm';
import { createMapStateToProps } from 'store/common';
import { costModelsActions, costModelsSelectors } from 'store/costModels';
import { metricsSelectors } from 'store/metrics';
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import React from 'react';
import type { WrappedComponentProps } from 'react-intl';
import { injectIntl } from 'react-intl';
import { connect } from 'react-redux';
import { Form } from 'routes/settings/components/forms/form';
import { Form } from 'routes/settings/costModels/components/forms/form';
import { createMapStateToProps } from 'store/common';

import { CostModelContext } from './context';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import type { WrappedComponentProps } from 'react-intl';
import { injectIntl } from 'react-intl';
import { connect } from 'react-redux';
import { currencyOptions } from 'routes/components/currency';
import { Form } from 'routes/settings/components/forms/form';
import { Selector } from 'routes/settings/components/inputs/selector';
import { Form } from 'routes/settings/costModels/components/forms/form';
import { Selector } from 'routes/settings/costModels/components/inputs/selector';
import { createMapStateToProps } from 'store/common';

import { CostModelContext } from './context';
Expand Down Expand Up @@ -130,7 +130,7 @@ class GeneralInformation extends React.Component<GeneralInformationProps, any> {
direction={SelectDirection.up}
appendMenuTo="inline"
maxHeight={styles.selector.maxHeight}
label={messages.costModelsSourceType}
label={messages.sourceType}
toggleAriaLabel={intl.formatMessage(messages.costModelsWizardEmptySourceTypeLabel)}
placeholderText={intl.formatMessage(messages.costModelsWizardEmptySourceTypeLabel)}
value={getValueLabel(type, sourceTypeOptions)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import React from 'react';
import type { WrappedComponentProps } from 'react-intl';
import { injectIntl } from 'react-intl';
import { connect } from 'react-redux';
import { Form } from 'routes/settings/components/forms/form';
import { styles as costCalcStyles } from 'routes/settings/costModel/costCalc.styles';
import { Form } from 'routes/settings/costModels/components/forms/form';
import { styles as costCalcStyles } from 'routes/settings/costModels/costModel/costCalc.styles';
import { createMapStateToProps } from 'store/common';
import { countDecimals, isPercentageFormatValid } from 'utils/format';

Expand Down
Loading

0 comments on commit 79765f4

Please sign in to comment.