Skip to content

Commit

Permalink
Fixes #36492 - duplicate content warning for composite CVs for non-do…
Browse files Browse the repository at this point in the history
…cker repos
  • Loading branch information
sjha4 committed Oct 5, 2023
1 parent 7089672 commit 7bb76f2
Show file tree
Hide file tree
Showing 9 changed files with 501 additions and 17 deletions.
2 changes: 1 addition & 1 deletion app/views/katello/api/v2/content_views/base.json.rabl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ extends 'katello/api/v2/common/identifier'
extends 'katello/api/v2/common/org_reference'

attributes :composite
attributes :component_ids
attributes :component_ids, :duplicate_repositories_to_publish
attributes :default
attributes :version_count
attributes :latest_version, :latest_version_id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ import {
selectCVDetails,
selectCVDetailStatus,
} from '../../Details/ContentViewDetailSelectors';
import { addComponent } from '../ContentViewDetailActions';
import { CONTENT_VIEW_NEEDS_PUBLISH } from '../../ContentViewsConstants';
import getContentViewDetails, { addComponent } from '../ContentViewDetailActions';

const ComponentContentViewAddModal = ({
cvId, componentCvId, componentId, latest, componentVersionId, show, setIsOpen,
Expand Down Expand Up @@ -67,12 +66,12 @@ const ComponentContentViewAddModal = ({
dispatch(addComponent({
compositeContentViewId: cvId,
components: getUpdateParams(),
}, () => dispatch({ type: CONTENT_VIEW_NEEDS_PUBLISH })));
}, () => dispatch(getContentViewDetails(cvId))));
} else {
dispatch(addComponent({
compositeContentViewId: cvId,
components: getAddParams(),
}, () => dispatch({ type: CONTENT_VIEW_NEEDS_PUBLISH })));
}, () => dispatch(getContentViewDetails(cvId))));
}
setIsOpen(false);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
import { OutlinedQuestionCircleIcon } from '@patternfly/react-icons';
import { useDispatch } from 'react-redux';
import { translate as __ } from 'foremanReact/common/I18n';
import { addComponent } from '../ContentViewDetailActions';
import getContentViewDetails, { addComponent } from '../ContentViewDetailActions';

const ComponentContentViewBulkAddModal = ({ cvId, rowsToAdd, onClose }) => {
const dispatch = useDispatch();
Expand Down Expand Up @@ -37,7 +37,7 @@ const ComponentContentViewBulkAddModal = ({ cvId, rowsToAdd, onClose }) => {
dispatch(addComponent({
compositeContentViewId: cvId,
components: bulkAddParams(),
}));
}, () => dispatch(getContentViewDetails(cvId))));
onClose();
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import AddedStatusLabel from '../../../../components/AddedStatusLabel';
import ComponentVersion from './ComponentVersion';
import ComponentEnvironments from './ComponentEnvironments';
import ContentViewIcon from '../../components/ContentViewIcon';
import { ADDED, ALL_STATUSES, CONTENT_VIEW_NEEDS_PUBLISH, NOT_ADDED } from '../../ContentViewsConstants';
import { ADDED, ALL_STATUSES, NOT_ADDED } from '../../ContentViewsConstants';
import SelectableDropdown from '../../../../components/SelectableDropdown/SelectableDropdown';
import '../../../../components/EditableTextInput/editableTextInput.scss';
import ComponentContentViewAddModal from './ComponentContentViewAddModal';
Expand Down Expand Up @@ -98,7 +98,7 @@ const ContentViewComponents = ({ cvId, details }) => {
dispatch(addComponent({
compositeContentViewId: cvId,
components: [{ latest: true, content_view_id: componentCvId }],
}, () => dispatch({ type: CONTENT_VIEW_NEEDS_PUBLISH })));
}, () => dispatch(getContentViewDetails(cvId))));
}
}, [cvId, dispatch]);

Expand All @@ -108,7 +108,7 @@ const ContentViewComponents = ({ cvId, details }) => {
dispatch(removeComponent({
compositeContentViewId: cvId,
component_ids: componentIds,
}, () => dispatch({ type: CONTENT_VIEW_NEEDS_PUBLISH })));
}, () => dispatch(getContentViewDetails(cvId))));
};

const addBulk = () => {
Expand All @@ -122,7 +122,7 @@ const ContentViewComponents = ({ cvId, details }) => {
dispatch(removeComponent({
compositeContentViewId: cvId,
component_ids: [componentIdToRemove],
}, () => dispatch({ type: CONTENT_VIEW_NEEDS_PUBLISH })));
}, () => dispatch(getContentViewDetails(cvId))));
};

const toggleBulkAction = () => {
Expand Down
Loading

0 comments on commit 7bb76f2

Please sign in to comment.