Skip to content

Commit

Permalink
feat: Fix scroll container, fix image versions order etc (#200)
Browse files Browse the repository at this point in the history
  • Loading branch information
callmevladik committed Apr 19, 2024
1 parent 53e873b commit a5e12cd
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 11 deletions.
13 changes: 9 additions & 4 deletions src/components/HorizontalScrollContainer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,24 @@ export const HorizontalScrollContainer: React.FC = ({ children }) => {
const container = React.useRef<HTMLDivElement | null>(null);

const handler = React.useCallback((e: WheelEvent) => {
e.preventDefault();
if (container.current) {
container.current.scrollLeft += e.deltaY;
if (
(e.deltaY < 0 && container.current.scrollLeft > 0) ||
(e.deltaY > 0 &&
container.current.scrollLeft <
container.current.scrollWidth - container.current.clientWidth)
) {
e.preventDefault();
container.current.scrollLeft += e.deltaY;
}
}
}, []);

React.useEffect(() => {
const el = container.current;

if (el) {
el.addEventListener('wheel', handler, { passive: false });
}

return () => {
if (el) {
el.removeEventListener('wheel', handler);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ export const createImageStreamTags = (
) => {
let base: SelectOption[] =
applicationImageStream && applicationImageStream?.spec?.tags
? applicationImageStream?.spec?.tags.map(({ name }) => ({
label: name,
value: name,
}))
? applicationImageStream?.spec?.tags
.map(({ name }) => ({
label: name,
value: name,
}))
.toReversed()

Check failure on line 15 in src/k8s/EDPCodebaseImageStream/utils/createImageStreamTags/index.ts

View workflow job for this annotation

GitHub Actions / build-lint-kaniko (16.x)

Property 'toReversed' does not exist on type '{ label: string; value: string; }[]'.
: [];

if (applicationImageStream && applicationImageStream?.spec?.tags) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ export const DEPENDENCY_TRACK_INTEGRATION_PAGE_DESCRIPTION: PageDescription = {
label: 'DependencyTrack',
description: 'Monitor and manage vulnerabilities within third-party components.',
routePath: '/configuration/dependency-track-integration',
docLink: EDP_OPERATOR_GUIDE.DEPENDENCY_TRACK.url
docLink: EDP_OPERATOR_GUIDE.DEPENDENCY_TRACK.url,
};
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ export const JIRA_INTEGRATION_PAGE_DESCRIPTION: PageDescription = {
label: 'Jira',
description: 'Track and deliver your projects with Jira.',
routePath: '/configuration/jira-integration',
docLink: EDP_OPERATOR_GUIDE.JIRA.url
docLink: EDP_OPERATOR_GUIDE.JIRA.url,
};
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ export const SONAR_INTEGRATION_PAGE_DESCRIPTION: PageDescription = {
label: 'SonarQube',
description: 'Enable automated code review mechanisms powered by SonarQube.',
routePath: '/configuration/sonar-integration',
docLink: EDP_OPERATOR_GUIDE.SONAR.url
docLink: EDP_OPERATOR_GUIDE.SONAR.url,
};
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,13 @@ export const ValuesOverrideCheckbox = ({
control,
formState: { errors },
register,
setValue,
} = useFormContext();

React.useEffect(() => {
setValue(`${application.metadata.name}::values-override`, defaultValue);
}, [application.metadata.name, defaultValue, setValue]);

return (
<div style={{ width: '100%' }}>
<FormSwitch
Expand Down

0 comments on commit a5e12cd

Please sign in to comment.