Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add help text when entering a redirect URI #515

Merged
merged 1 commit into from
May 23, 2023

Conversation

rossiam
Copy link
Collaborator

@rossiam rossiam commented May 17, 2023

This adds support for help text on inputs in the new item-input module.

Primary changes:

  • added support for helpText to askForString to askForOptionalString functions which adds " (? for help)" text to prompt and displays value of helpText if the user enters "?"
  • added support for helpText to arrayDef, checkboxDef and objectDef
  • used new helpText for these functions in several places
  • updated unit tests for updated code

Secondary cleanup:

  • renamed askForString to askForOptionalString and updated calls to it (now matches naming convention used for optionalStringDef)
  • renamed askForRequiredString to askForString and updated calls to it (now matches naming convention used for stringDef)
  • combined code for askForOptionalString and askForString into a function called by both
  • moved validate argument into options argument for both askForOptionalString and askForString
  • moved validate argument into options argument for both optionalStringDef and stringDef
  • created AskForStringOptions type for options argument to askForString to askForOptionalString
  • use new AskForStringOptions as base for StringDefOptions type for optionalStringDef and stringDef functions

Checklist

  • I have read the CONTRIBUTING document
  • Any required documentation has been added
  • My code follows the code style of this project (npm run lint produces no warnings/errors)
  • I have added tests to cover my changes

@changeset-bot
Copy link

changeset-bot bot commented May 17, 2023

🦋 Changeset detected

Latest commit: d28b34f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@smartthings/cli-lib Minor
@smartthings/cli Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@rossiam rossiam force-pushed the redirect-uri-help-text branch from 0106956 to 03f1a00 Compare May 22, 2023 19:16
export const oauthAppScopeDef = checkboxDef<string>('Scopes', availableScopes, {
helpText: 'More information on OAuth 2 Scopes can be found at:\n' +
' https://www.oauth.com/oauth2-servers/scope/\n\n' +
'To find out which scopes you need for the application, see documentation for the individual endpoints you will use in your app:\n' +
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider using "determine" instead of "find out".

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely! Fixed.

@rossiam rossiam force-pushed the redirect-uri-help-text branch from 03f1a00 to d28b34f Compare May 23, 2023 17:49
@rossiam rossiam merged commit c391bb5 into SmartThingsCommunity:main May 23, 2023
@rossiam rossiam deleted the redirect-uri-help-text branch May 23, 2023 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants