Skip to content

Commit

Permalink
Merge branch 'master' into refactor/secret-page-follow-up
Browse files Browse the repository at this point in the history
  • Loading branch information
zoltanszabo-bitrise committed Sep 13, 2024
2 parents 8c387d0 + 7c28fe3 commit 8f8c814
Show file tree
Hide file tree
Showing 74 changed files with 2,172 additions and 1,405 deletions.
1 change: 0 additions & 1 deletion .storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ const config: StorybookConfig = {
...resolve,
alias: {
...alias,
"@/services/app-service": path.resolve(__dirname, "../source/javascripts/services/app-service.mock.ts"),
"@": path.resolve(__dirname, "../source/javascripts"),
},
};
Expand Down
44 changes: 38 additions & 6 deletions .storybook/preview.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import React from "react";
import "@/typings/globals.d.ts";

import { Provider } from "@bitrise/bitkit";
import type { Preview } from "@storybook/react";
import { initialize, mswLoader } from "msw-storybook-addon";
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";

initialize();

Expand All @@ -13,9 +14,42 @@ const queryClient = new QueryClient({
retry: 3,
},
},
})
});

const preview: Preview = {
beforeEach: () => {
process.env.MODE = "website";
window.parent.globalProps = {
user: {
slug: "user-1",
username: "ninja",
},
account: {
slug: "account-1",
name: "Mando",
},
};
window.parent.pageProps = {
abilities: {
canRunBuilds: true,
},
limits: {
uniqueStepLimit: undefined,
},
project: {
slug: "asd-123",
name: "Mock Project",
defaultBranch: "main",
buildTriggerToken: "bt-1",
},
};

return () => {
process.env.MODE = "cli";
window.parent.globalProps = undefined;
window.parent.pageProps = undefined;
};
},
parameters: {
actions: { argTypesRegex: "^on[A-Z].*" },
controls: {
Expand All @@ -34,9 +68,7 @@ const preview: Preview = {
</Provider>
),
],
loaders: [
mswLoader,
],
loaders: [mswLoader],
};

export default preview;
6 changes: 3 additions & 3 deletions bitrise-plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: workflow-editor
description: |-
Bitrise Workflow Editor.
executable:
osx: https://github.com/bitrise-io/bitrise-workflow-editor/releases/download/1.3.502/workflow-editor-Darwin-x86_64
osx-arm64: https://github.com/bitrise-io/bitrise-workflow-editor/releases/download/1.3.502/workflow-editor-Darwin-arm64
linux: https://github.com/bitrise-io/bitrise-workflow-editor/releases/download/1.3.502/workflow-editor-Linux-x86_64
osx: https://github.com/bitrise-io/bitrise-workflow-editor/releases/download/1.3.510/workflow-editor-Darwin-x86_64
osx-arm64: https://github.com/bitrise-io/bitrise-workflow-editor/releases/download/1.3.510/workflow-editor-Darwin-arm64
linux: https://github.com/bitrise-io/bitrise-workflow-editor/releases/download/1.3.510/workflow-editor-Linux-x86_64
requirements:
- tool: bitrise
min_version: 1.18.0
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"author": "Bitrise",
"license": "MIT",
"name": "bitrise-workflow-editor",
"version": "1.3.502",
"version": "1.3.510",
"description": "Bitrise workflow editor",
"homepage": "https://github.com/bitrise-io/bitrise-workflow-editor#readme",
"repository": {
Expand Down
11 changes: 3 additions & 8 deletions source/javascripts/_componentRegister.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,25 +140,21 @@ angular
.component(
"rWorkflowToolbar",
register(WorkflowToolbar, [
"organizationSlug",
"defaultBranch",
"uniqueStepCount",
"uniqueStepLimit",
"workflows",
"selectedWorkflow",
"selectWorkflow",
"createWorkflow",
"chainWorkflow",
"deleteSelectedWorkflow",
"deleteWorkflow",
"rearrangeWorkflows",
"uniqueStepCount",
"canRunWorkflow",
"isRunWorkflowDisabled",
"runWorkflow",
]),
)
.component(
"rWorkflowEmptyState",
register(WorkflowEmptyState, ["onAddWorkflow"]),
register(WorkflowEmptyState, ["onCreateWorkflow"]),
)
.component(
"rWorkflowRecipesInfoBanner",
Expand Down Expand Up @@ -213,7 +209,6 @@ angular
"onLoadSecrets",
"onCreateEnvVar",
"onLoadEnvVars",
"appSlug",
"secretsWriteNew",
]),
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import CopyToClipboard from 'react-copy-to-clipboard';
import useGetAppConfigFromRepoCallback from '@/hooks/api/useGetAppConfigFromRepoCallback';
import useUpdatePipelineConfigCallback from '@/hooks/api/useUpdatePipelineConfigCallback';
import usePostAppConfigCallback from '@/hooks/api/usePostAppConfigCallback';
import useFeatureFlag from '@/hooks/useFeatureFlag';
import { AppConfig } from '@/models/AppConfig';
import DateFormatter from '@/utils/dateFormatter';
import { segmentTrack } from '@/utils/segmentTracking';
Expand Down Expand Up @@ -187,8 +186,6 @@ const ConfigurationYmlSourceDialog = (props: ConfigurationYmlSourceDialogProps)

const isDialogDisabled = getAppConfigFromRepoLoading || updatePipelineConfigLoading || postAppConfigLoading;

const isModularYAMLMentionsEnabled = useFeatureFlag('enable-modular-yaml-mentions');

const onCopyClick = () => {
toast({
title: ' Copied to clipboard',
Expand Down Expand Up @@ -258,18 +255,16 @@ const ConfigurationYmlSourceDialog = (props: ConfigurationYmlSourceDialogProps)
>
<Radio
helperText={
isModularYAMLMentionsEnabled ? (
<>
Multiple configuration files will be merged into a single file.{' '}
<Link
href="https://devcenter.bitrise.io/builds/bitrise-yml-online/"
colorScheme="purple"
isExternal
>
Learn more
</Link>
</>
) : undefined
<>
Multiple configuration files will be merged into a single file.{' '}
<Link
href="https://devcenter.bitrise.io/builds/bitrise-yml-online/"
colorScheme="purple"
isExternal
>
Learn more
</Link>
</>
}
marginBlockEnd="12"
value="git"
Expand Down Expand Up @@ -353,28 +348,26 @@ const ConfigurationYmlSourceDialog = (props: ConfigurationYmlSourceDialogProps)
</Link>
</Text>
</ListItem>
{isModularYAMLMentionsEnabled && (
<ListItem>
Split up your configuration{' '}
<Text as="span" color="text/secondary">
(optional)
</Text>
<Text textStyle="body/md/regular" color="text/secondary">
<Link
href="https://devcenter.bitrise.io/en/builds/yaml-configuration/modular-yaml-configuration.html"
colorScheme="purple"
isExternal
>
Follow this guide
</Link>{' '}
to split up your configuration into smaller, more manageable files. This feature is only available
for Workspaces on{' '}
<Text as="span" textStyle="body/md/semibold">
Enterprise plan.
</Text>
<ListItem>
Split up your configuration{' '}
<Text as="span" color="text/secondary">
(optional)
</Text>
<Text textStyle="body/md/regular" color="text/secondary">
<Link
href="https://devcenter.bitrise.io/en/builds/yaml-configuration/modular-yaml-configuration.html"
colorScheme="purple"
isExternal
>
Follow this guide
</Link>{' '}
to split up your configuration into smaller, more manageable files. This feature is only available for
Workspaces on{' '}
<Text as="span" textStyle="body/md/semibold">
Enterprise plan.
</Text>
</ListItem>
)}
</Text>
</ListItem>
</List>
</>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import YmlNotFoundInRepositoryError from '../common/notifications/YmlNotFoundInR
import YmlInRepositoryInvalidError from '../common/notifications/YmlInRepositoryInvalidError';
import { useFormattedYml } from '../common/RepoYmlStorageActions';
import { AppConfig } from '../../models/AppConfig';
import useFeatureFlag from '../../hooks/useFeatureFlag';
import { segmentTrack } from '../../utils/segmentTracking';

type UpdateConfigurationDialogProps = {
Expand Down Expand Up @@ -51,8 +50,6 @@ const UpdateConfigurationDialog = (props: UpdateConfigurationDialogProps) => {

const toast = useToast();

const isModularYAMLMentionsEnabled = useFeatureFlag('enable-modular-yaml-mentions');

const onCopyClick = () => {
toast({
title: ' Copied to clipboard',
Expand Down Expand Up @@ -107,14 +104,10 @@ const UpdateConfigurationDialog = (props: UpdateConfigurationDialogProps) => {
</Button>
</CopyToClipboard>
</Box>
{isModularYAMLMentionsEnabled && (
<>
<Text textStyle="heading/h4" marginBlockEnd="4">
Using multiple configuration files
</Text>
<Text>You need to re-create the changes in the relevant configuration file on your Git repository.</Text>
</>
)}
<Text textStyle="heading/h4" marginBlockEnd="4">
Using multiple configuration files
</Text>
<Text>You need to re-create the changes in the relevant configuration file on your Git repository.</Text>
{getAppConfigFromRepoFailed && renderError()}
</DialogBody>
<DialogFooter>
Expand Down
19 changes: 0 additions & 19 deletions source/javascripts/components/WorkflowEmptyState.tsx

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { Box, Button, DataWidget, DataWidgetItem, Text, Tooltip, useDisclosure }
import { useUserMetaData } from '@/hooks/useUserMetaData';
import { AppConfig } from '@/models/AppConfig';
import ConfigurationYmlSourceDialog from '../ConfigurationYmlSource/ConfigurationYmlSourceDialog';
import useFeatureFlag from '../../hooks/useFeatureFlag';
import { segmentTrack } from '../../utils/segmentTracking';
import SplitNotification from './SplitNotification';
import GitNotification from './GitNotification';
Expand Down Expand Up @@ -63,8 +62,6 @@ const YmlEditorHeader = (props: YmlEditorHeaderProps) => {

const isChangeEnabled = repositoryYmlAvailable || initialUsesRepositoryYml === true;

const isModularYAMLMentionsEnabled = useFeatureFlag('enable-modular-yaml-mentions');

const onYmlSourceChangeClick = () => {
onOpen();
segmentTrack('Change Configuration Yml Source Button Clicked', {
Expand Down Expand Up @@ -127,7 +124,7 @@ const YmlEditorHeader = (props: YmlEditorHeaderProps) => {
</DataWidget>
)}
</Box>
{isModularYAMLMentionsEnabled && isSplitNotiVisible && (
{isSplitNotiVisible && (
<SplitNotification modularYamlSupported={modularYamlSupported} lines={lines} onClose={closeSplitNoti} />
)}
{isGitNotiVisible && <GitNotification onClose={closeGitNoti} />}
Expand Down
Loading

0 comments on commit 8f8c814

Please sign in to comment.