Skip to content

Commit 5b6f6bc

Browse files
committed
chore: remove postman upload attachment flag
1 parent b439397 commit 5b6f6bc

File tree

3 files changed

+3
-21
lines changed

3 files changed

+3
-21
lines changed

packages/frontend/src/components/AttachmentSuggestions/hooks/useAttachmentOptions.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import { reformatToCheckboxVariables } from '../utils'
1515

1616
export function useAttachmentOptions(
1717
flowData: GetFlowQuery,
18-
hideUploadAttachments: boolean,
1918
priorExecutionSteps: IExecutionStep[],
2019
variableTypes: TDataOutMetadatumType[] | null,
2120
) {
@@ -51,20 +50,14 @@ export function useAttachmentOptions(
5150

5251
return [
5352
...filteredVars,
54-
!hideUploadAttachments && {
53+
{
5554
id: 'uploaded',
5655
name: 'Uploaded attachments',
5756
output: uploadedItems,
5857
addNew: true,
5958
},
6059
].filter(Boolean) as StepWithVariables[]
61-
}, [
62-
setOptions,
63-
hideUploadAttachments,
64-
priorExecutionSteps,
65-
uploadedItems,
66-
variableTypes,
67-
])
60+
}, [setOptions, priorExecutionSteps, uploadedItems, variableTypes])
6861

6962
return {
7063
options,

packages/frontend/src/components/AttachmentSuggestions/index.tsx

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ import { useQuery } from '@apollo/client'
77
import { FormControl, useDisclosure, useOutsideClick } from '@chakra-ui/react'
88
import { FormErrorMessage, FormLabel } from '@opengovsg/design-system-react'
99

10-
import { HIDE_POSTMAN_UPLOAD_ATTACHMENT_FLAG } from '@/config/flags'
11-
import { LaunchDarklyContext } from '@/contexts/LaunchDarkly'
1210
import { StepExecutionsContext } from '@/contexts/StepExecutions'
1311
import { GET_FLOW } from '@/graphql/queries/get-flow'
1412
import { type Variable } from '@/helpers/variables'
@@ -44,16 +42,10 @@ function AttachmentSuggestions(props: AttachmentSuggestionsProps) {
4442
const wrapperRef = useRef(null)
4543
const { control, setError, getValues } = useFormContext()
4644
const [currentTab, setCurrentTab] = useState<number>(0)
47-
48-
// TODO (kevinkim-ogp): remove this after we confirm that upload is stable
49-
const launchDarkly = useContext(LaunchDarklyContext)
50-
const hideUploadAttachments =
51-
launchDarkly.flags?.[HIDE_POSTMAN_UPLOAD_ATTACHMENT_FLAG]
45+
const [selectedFile, setSelectedFile] = useState<Variable | null>(null)
5246

5347
const flowId = getValues('flowId')
5448

55-
const [selectedFile, setSelectedFile] = useState<Variable | null>(null)
56-
5749
const {
5850
isOpen: isDialogOpen,
5951
onOpen: onDialogOpen,
@@ -102,7 +94,6 @@ function AttachmentSuggestions(props: AttachmentSuggestionsProps) {
10294

10395
const { options, suggestions, uploadedItems } = useAttachmentOptions(
10496
flowData,
105-
hideUploadAttachments,
10697
priorExecutionSteps,
10798
variableTypes,
10899
)

packages/frontend/src/config/flags.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ export const SINGLE_STEP_TEST_KILL_SWITCH = 'single_step_test_kill_switch'
1616
export const BULK_RETRY_EXECUTIONS_FLAG = 'bulk-retry-failed-executions-v1'
1717
export const SGID_FEATURE_FLAG = 'sgid-login'
1818
export const NESTED_IFTHEN_FEATURE_FLAG = 'feature_nested_if_then'
19-
export const HIDE_POSTMAN_UPLOAD_ATTACHMENT_FLAG =
20-
'hide-postman-upload-attachment'
2119

2220
/**
2321
* App/events flags

0 commit comments

Comments
 (0)