Skip to content

Commit

Permalink
Ci 3806 pin only the major version (#1255)
Browse files Browse the repository at this point in the history
  • Loading branch information
zsolt-vicze authored Nov 6, 2024
1 parent d0f1d5b commit ffc6730
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Meta, StoryObj } from '@storybook/react';
import { useDisclosure } from '@bitrise/bitkit';
import StepApiMocks from '@/core/api/StepApi.mswMocks';
import { withBitriseYml } from '@/contexts/BitriseYmlProvider';
import StepSelectorDrawer from './StepSelectorDrawer';

export default {
Expand All @@ -15,6 +16,7 @@ export default {
args: {
defaultIsOpen: true,
},
decorators: [(Story) => withBitriseYml(TEST_BITRISE_YML, Story)],
parameters: {
msw: {
handlers: [StepApiMocks.getAlgoliaSteps({ status: 'success' })],
Expand Down
9 changes: 6 additions & 3 deletions source/javascripts/pages/WorkflowsPage/WorkflowsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ import {
} from '@/components/unified-editor';
import useBitriseYmlStore from '@/hooks/useBitriseYmlStore';
import useSelectedWorkflow from '@/hooks/useSelectedWorkflow';
import StepService from '@/core/models/StepService';
import { LibraryType } from '@/core/models/Step';
import { useWorkflowsPageStore } from './WorkflowsPage.store';
import DeleteWorkflowDialog from './components.new/DeleteWorkflowDialog/DeleteWorkflowDialog';
import WorkflowCanvasPanel from './components.new/WorkflowCanvasPanel/WorkflowCanvasPanel';
Expand Down Expand Up @@ -74,8 +76,9 @@ const WorkflowsPageContent = () => {
isWorkflowConfigDrawerMounted: dialogMounted['workflow-config-drawer'],
};

const handleAddStep = (cvs: string) => {
addStep(workflowId, cvs, stepIndex);
const handleAddStep = (cvs: string, normalizedVersion: string) => {
const cvsWithLatestMajorVersion = StepService.updateVersion(cvs, LibraryType.BITRISE, normalizedVersion);
addStep(workflowId, cvsWithLatestMajorVersion, stepIndex);
openStepConfigDrawer(workflowId, stepIndex);
};

Expand Down Expand Up @@ -148,7 +151,7 @@ const WorkflowsPageContent = () => {
enabledSteps={enabledSteps}
isOpen={isStepSelectorDrawerOpen}
onClose={closeDialog}
onSelectStep={({ cvs }) => handleAddStep(cvs)}
onSelectStep={({ cvs, resolvedInfo: { normalizedVersion = '' } }) => handleAddStep(cvs, normalizedVersion)}
/>

{isWorkflowConfigDrawerMounted && (
Expand Down

0 comments on commit ffc6730

Please sign in to comment.