Skip to content

Commit

Permalink
update UI for schema changes
Browse files Browse the repository at this point in the history
  • Loading branch information
mastercactapus committed Feb 22, 2024
1 parent 02385bb commit 45c653b
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 59 deletions.
2 changes: 1 addition & 1 deletion graphql2/graphqlapp/destinationtypes.go
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ func (q *Query) DestinationTypes(ctx context.Context) ([]graphql2.DestinationTyp
Label: "Slack User",
PlaceholderText: "member ID",
InputType: "text",
// IsSearchSelectable: true, // TODO: implement search select functionality for users
// supportsSearch: true, // TODO: implement search select functionality for users
Hint: `Go to your Slack profile, click the three dots, and select "Copy member ID".`,
}},
},
Expand Down
2 changes: 1 addition & 1 deletion web/src/app/selection/DestinationField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export default function DestinationField(
)?.message || '',
)

if (field.isSearchSelectable)
if (field.supportsSearch)
return (
<Grid key={field.fieldID} item xs={12} sm={12} md={12}>
<DestinationSearchSelect
Expand Down
15 changes: 6 additions & 9 deletions web/src/app/selection/DestinationInputDirect.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,11 @@ export const WebookWithDocLink: Story = {
hint: 'Webhook Documentation',
hintURL: '/docs#webhooks',
inputType: 'url',
labelSingular: 'Webhook URL',
label: 'Webhook URL',
placeholderText: 'https://example.com',
prefix: '',
supportsValidation: true,
isSearchSelectable: false,
labelPlural: 'Webhook URLs',
supportsSearch: false,

destType: 'builtin-webhook',
},
Expand Down Expand Up @@ -104,12 +103,11 @@ export const PhoneNumbers: Story = {
hint: 'Include country code e.g. +1 (USA), +91 (India), +44 (UK)',
hintURL: '',
inputType: 'tel',
labelSingular: 'Phone Number',
label: 'Phone Number',
placeholderText: '11235550123',
prefix: '+',
supportsValidation: true,
labelPlural: 'Phone Numbers',
isSearchSelectable: false,
supportsSearch: false,

destType: 'builtin-twilio-sms',
},
Expand Down Expand Up @@ -153,12 +151,11 @@ export const Email: Story = {
hint: '',
hintURL: '',
inputType: 'email',
labelSingular: 'Email Address',
label: 'Email Address',
placeholderText: 'foobar@example.com',
prefix: '',
supportsValidation: true,
isSearchSelectable: false,
labelPlural: 'Email Addresses',
supportsSearch: false,

destType: 'builtin-smtp-email',
},
Expand Down
2 changes: 1 addition & 1 deletion web/src/app/selection/DestinationInputDirect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export default function DestinationInputDirect(
InputProps={iprops}
type={props.inputType}
placeholder={props.placeholderText}
label={props.labelSingular}
label={props.label}
helperText={
props.hintURL ? (
<AppLink newTab to={props.hintURL}>
Expand Down
32 changes: 13 additions & 19 deletions web/src/app/selection/DestinationSearchSelect.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const meta = {
argTypes: {
inputType: { table: { disable: true } },
placeholderText: { table: { disable: true } },
isSearchSelectable: { table: { disable: true } },
supportsSearch: { table: { disable: true } },
supportsValidation: { table: { disable: true } },
prefix: { table: { disable: true } },
},
Expand Down Expand Up @@ -104,9 +104,8 @@ export const Default: Story = {
hint: '',
hintURL: '',
inputType: 'text',
isSearchSelectable: true,
labelPlural: 'Select Values',
labelSingular: 'Select Value',
supportsSearch: true,
label: 'Select Value',
placeholderText: 'asdf',
prefix: '',
supportsValidation: false,
Expand All @@ -123,9 +122,8 @@ export const OptionSelected: Story = {
hint: '',
hintURL: '',
inputType: 'text',
isSearchSelectable: true,
labelPlural: 'Select Values',
labelSingular: 'Select Value',
supportsSearch: true,
label: 'Select Value',
placeholderText: '',
prefix: '',
supportsValidation: false,
Expand All @@ -142,9 +140,8 @@ export const Disabled: Story = {
hint: '',
hintURL: '',
inputType: 'text',
isSearchSelectable: true,
labelPlural: 'Select Values',
labelSingular: 'Select Value',
supportsSearch: true,
label: 'Select Value',
placeholderText: '',
prefix: '',
supportsValidation: false,
Expand All @@ -162,9 +159,8 @@ export const InvalidOptionSelected: Story = {
hint: '',
hintURL: '',
inputType: 'text',
isSearchSelectable: true,
labelPlural: 'Select Values',
labelSingular: 'Select Value',
supportsSearch: true,
label: 'Select Value',
placeholderText: '',
prefix: '',
supportsValidation: false,
Expand All @@ -181,9 +177,8 @@ export const NoOptions: Story = {
hint: '',
hintURL: '',
inputType: 'text',
isSearchSelectable: true,
labelPlural: 'Select Values',
labelSingular: 'Select Value',
supportsSearch: true,
label: 'Select Value',
placeholderText: '',
prefix: '',
supportsValidation: false,
Expand All @@ -209,9 +204,8 @@ export const QueryError: Story = {
hint: '',
hintURL: '',
inputType: 'text',
isSearchSelectable: true,
labelPlural: 'Select Values',
labelSingular: 'Select Value',
supportsSearch: true,
label: 'Select Value',
placeholderText: '',
prefix: '',
supportsValidation: false,
Expand Down
2 changes: 1 addition & 1 deletion web/src/app/selection/DestinationSearchSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export default function DestinationSearchSelect(
error={props.error}
onInputChange={(val) => setInputValue(val)}
value={value as unknown as SelectOption}
label={props.labelSingular}
label={props.label}
helperText={
props.hintURL ? (
<AppLink newTab to={props.hintURL}>
Expand Down
35 changes: 14 additions & 21 deletions web/src/app/storybook/defaultDestTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,13 @@ export const destTypes: DestinationTypeInfo[] = [
requiredFields: [
{
fieldID: 'phone-number',
labelSingular: 'Phone Number',
labelPlural: 'Phone Numbers',
label: 'Phone Number',
hint: 'Include country code e.g. +1 (USA), +91 (India), +44 (UK)',
hintURL: '',
placeholderText: '11235550123',
prefix: '+',
inputType: 'tel',
isSearchSelectable: false,
supportsSearch: false,
supportsValidation: true,
},
],
Expand All @@ -45,38 +44,35 @@ export const destTypes: DestinationTypeInfo[] = [
requiredFields: [
{
fieldID: 'first-field',
labelSingular: 'First Item',
labelPlural: 'First Items',
label: 'First Item',
hint: 'Some hint text',
hintURL: '',
placeholderText: '11235550123',
prefix: '+',
inputType: 'tel',
isSearchSelectable: false,
supportsSearch: false,
supportsValidation: true,
},
{
fieldID: 'second-field',
labelSingular: 'Second Item',
labelPlural: 'Second Items',
label: 'Second Item',
hint: '',
hintURL: '',
placeholderText: 'foobar@example.com',
prefix: '',
inputType: 'email',
isSearchSelectable: false,
supportsSearch: false,
supportsValidation: true,
},
{
fieldID: 'third-field',
labelSingular: 'Third Item',
labelPlural: 'Third Items',
label: 'Third Item',
hint: 'docs',
hintURL: '/docs',
placeholderText: 'slack user ID',
prefix: '',
inputType: 'string',
isSearchSelectable: false,
supportsSearch: false,
supportsValidation: true,
},
],
Expand All @@ -97,14 +93,13 @@ export const destTypes: DestinationTypeInfo[] = [
requiredFields: [
{
fieldID: 'disabled',
labelSingular: '',
labelPlural: '',
label: '',
hint: '',
hintURL: '',
placeholderText: 'This field is disabled.',
prefix: '',
inputType: 'url',
isSearchSelectable: false,
supportsSearch: false,
supportsValidation: false,
},
],
Expand All @@ -125,14 +120,13 @@ export const destTypes: DestinationTypeInfo[] = [
requiredFields: [
{
fieldID: 'phone-number',
labelSingular: 'Phone Number',
labelPlural: 'Phone Numbers',
label: 'Phone Number',
hint: 'Include country code e.g. +1 (USA), +91 (India), +44 (UK)',
hintURL: '',
placeholderText: '11235550123',
prefix: '+',
inputType: 'tel',
isSearchSelectable: false,
supportsSearch: false,
supportsValidation: true,
},
],
Expand All @@ -153,14 +147,13 @@ export const destTypes: DestinationTypeInfo[] = [
requiredFields: [
{
fieldID: 'phone-number',
labelSingular: 'Phone Number',
labelPlural: 'Phone Numbers',
label: 'Phone Number',
hint: 'Include country code e.g. +1 (USA), +91 (India), +44 (UK)',
hintURL: '',
placeholderText: '11235550123',
prefix: '+',
inputType: 'tel',
isSearchSelectable: false,
supportsSearch: false,
supportsValidation: true,
},
],
Expand Down
5 changes: 2 additions & 3 deletions web/src/app/util/RequireConfig.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,13 @@ const expDestQuery = gql`
requiredFields {
fieldID
labelSingular
labelPlural
label
hint
hintURL
placeholderText
prefix
inputType
isSearchSelectable
supportsSearch
supportsValidation
}
}
Expand Down
5 changes: 2 additions & 3 deletions web/src/schema.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -360,11 +360,10 @@ export interface DestinationFieldConfig {
hint: string
hintURL: string
inputType: string
isSearchSelectable: boolean
labelPlural: string
labelSingular: string
label: string
placeholderText: string
prefix: string
supportsSearch: boolean
supportsValidation: boolean
}

Expand Down

0 comments on commit 45c653b

Please sign in to comment.