Skip to content

Commit 0bd1959

Browse files
committed
hide from preview certain fields
1 parent ca3b875 commit 0bd1959

54 files changed

Lines changed: 104 additions & 1 deletion

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/workflow-block/workflow-block.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,7 @@ export const WorkflowBlock = memo(function WorkflowBlock({
483483

484484
const visibleSubBlocks = config.subBlocks.filter((block) => {
485485
if (block.hidden) return false
486+
if (block.hideFromPreview) return false
486487

487488
if (block.requiresFeature && !isTruthy(getEnv(block.requiresFeature))) {
488489
return false

apps/sim/blocks/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ export interface SubBlockConfig {
144144
showCopyButton?: boolean
145145
connectionDroppable?: boolean
146146
hidden?: boolean
147+
hideFromPreview?: boolean // Hide this subblock from the workflow block preview
147148
requiresFeature?: string // Environment variable name that must be truthy for this subblock to be visible
148149
description?: string
149150
value?: (params: Record<string, any>) => string

apps/sim/hooks/use-display-name.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export function useDisplayName(
3535

3636
// Workflows
3737
if (subBlock.id === 'workflowId') {
38-
return state.cache.workflows['global']?.[value] || null
38+
return state.cache.workflows.global?.[value] || null
3939
}
4040

4141
// Files

apps/sim/triggers/airtable/webhook.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ export const airtableWebhookTrigger: TriggerConfig = {
5050
{
5151
id: 'triggerInstructions',
5252
title: 'Setup Instructions',
53+
hideFromPreview: true,
5354
type: 'text',
5455
defaultValue: [
5556
'Connect your Airtable account using the "Select Airtable credential" button above.',
@@ -70,6 +71,7 @@ export const airtableWebhookTrigger: TriggerConfig = {
7071
id: 'triggerSave',
7172
title: '',
7273
type: 'trigger-save',
74+
hideFromPreview: true,
7375
mode: 'trigger',
7476
triggerId: 'airtable_webhook',
7577
},

apps/sim/triggers/generic/webhook.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ export const genericWebhookTrigger: TriggerConfig = {
5959
{
6060
id: 'triggerInstructions',
6161
title: 'Setup Instructions',
62+
hideFromPreview: true,
6263
type: 'text',
6364
defaultValue: [
6465
'Copy the webhook URL and use it in your external service or API.',
@@ -79,6 +80,7 @@ export const genericWebhookTrigger: TriggerConfig = {
7980
id: 'triggerSave',
8081
title: '',
8182
type: 'trigger-save',
83+
hideFromPreview: true,
8284
mode: 'trigger',
8385
triggerId: 'generic_webhook',
8486
},

apps/sim/triggers/github/issue_closed.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ export const githubIssueClosedTrigger: TriggerConfig = {
7878
{
7979
id: 'triggerInstructions',
8080
title: 'Setup Instructions',
81+
hideFromPreview: true,
8182
type: 'text',
8283
defaultValue: [
8384
'Go to your GitHub Repository > Settings > Webhooks.',
@@ -104,6 +105,7 @@ export const githubIssueClosedTrigger: TriggerConfig = {
104105
id: 'triggerSave',
105106
title: '',
106107
type: 'trigger-save',
108+
hideFromPreview: true,
107109
mode: 'trigger',
108110
triggerId: 'github_issue_closed',
109111
condition: {

apps/sim/triggers/github/issue_comment.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ export const githubIssueCommentTrigger: TriggerConfig = {
7878
{
7979
id: 'triggerInstructions',
8080
title: 'Setup Instructions',
81+
hideFromPreview: true,
8182
type: 'text',
8283
defaultValue: [
8384
'Go to your GitHub Repository > Settings > Webhooks.',
@@ -105,6 +106,7 @@ export const githubIssueCommentTrigger: TriggerConfig = {
105106
id: 'triggerSave',
106107
title: '',
107108
type: 'trigger-save',
109+
hideFromPreview: true,
108110
mode: 'trigger',
109111
triggerId: 'github_issue_comment',
110112
condition: {

apps/sim/triggers/github/issue_opened.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ export const githubIssueOpenedTrigger: TriggerConfig = {
9999
{
100100
id: 'triggerInstructions',
101101
title: 'Setup Instructions',
102+
hideFromPreview: true,
102103
type: 'text',
103104
defaultValue: [
104105
'Go to your GitHub Repository > Settings > Webhooks.',
@@ -125,6 +126,7 @@ export const githubIssueOpenedTrigger: TriggerConfig = {
125126
id: 'triggerSave',
126127
title: '',
127128
type: 'trigger-save',
129+
hideFromPreview: true,
128130
mode: 'trigger',
129131
triggerId: 'github_issue_opened',
130132
condition: {

apps/sim/triggers/github/pr_closed.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ export const githubPRClosedTrigger: TriggerConfig = {
7979
{
8080
id: 'triggerInstructions',
8181
title: 'Setup Instructions',
82+
hideFromPreview: true,
8283
type: 'text',
8384
defaultValue: [
8485
'Go to your GitHub Repository > Settings > Webhooks.',
@@ -105,6 +106,7 @@ export const githubPRClosedTrigger: TriggerConfig = {
105106
id: 'triggerSave',
106107
title: '',
107108
type: 'trigger-save',
109+
hideFromPreview: true,
108110
mode: 'trigger',
109111
triggerId: 'github_pr_closed',
110112
condition: {

apps/sim/triggers/github/pr_comment.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ export const githubPRCommentTrigger: TriggerConfig = {
7878
{
7979
id: 'triggerInstructions',
8080
title: 'Setup Instructions',
81+
hideFromPreview: true,
8182
type: 'text',
8283
defaultValue: [
8384
'Go to your GitHub Repository > Settings > Webhooks.',
@@ -105,6 +106,7 @@ export const githubPRCommentTrigger: TriggerConfig = {
105106
id: 'triggerSave',
106107
title: '',
107108
type: 'trigger-save',
109+
hideFromPreview: true,
108110
mode: 'trigger',
109111
triggerId: 'github_pr_comment',
110112
condition: {

0 commit comments

Comments
 (0)