-
-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #87 from raycharius/v2.5.0
✨ Release v2.5.0
- Loading branch information
Showing
19 changed files
with
328 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Option Collection | ||
|
||
?> **Note:** This document is a reference for creating a collection of options in **Block Builder**. For information on the business logic for the options in the context of the Slack Block Kit framework, visit [the official doc site](https://api.slack.com/block-kit) from Slack. | ||
|
||
### Creating an Option Collection | ||
|
||
An option collection is an array of built option objects. The function that creates a collection, `OptionCollection`, is available as both a top-level import and as a member of its 'category', `Utilities`: | ||
|
||
```javascript | ||
import { OptionCollection } from 'slack-block-builder'; | ||
|
||
const myOptions = OptionCollection(options); | ||
|
||
``` | ||
|
||
```javascript | ||
import { Utilities } from 'slack-block-builder'; | ||
|
||
const myOptions = Utilities.OptionCollection(options); | ||
``` | ||
|
||
This function behaves in the same way as any other [methods that append](../setter-methods.md). | ||
|
||
### When To Use an Option Collection | ||
|
||
The `OptionCollection` function is meant to be used to create a response to requests to your service made from select menus with external data sources, where you return an array of options: | ||
|
||
```javascript | ||
return { options: OptionCollection( /* Pass in options */ ) }; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Option Group Collection | ||
|
||
?> **Note:** This document is a reference for creating a collection of option groups in **Block Builder**. For information on the business logic for the option groups in the context of the Slack Block Kit framework, visit [the official doc site](https://api.slack.com/block-kit) from Slack. | ||
|
||
### Creating an Option Group Collection | ||
|
||
An option group collection is an array of built option group objects. The function that creates a collection, `OptionGroupCollection`, is available as both a top-level import and as a member of its 'category', `Utilities`: | ||
|
||
```javascript | ||
import { OptionGroupCollection } from 'slack-block-builder'; | ||
|
||
const myOptionGroups = OptionGroupCollection(optionGroups); | ||
|
||
``` | ||
|
||
```javascript | ||
import { Utilities } from 'slack-block-builder'; | ||
|
||
const myOptionGroups = Utilities.OptionGroupCollection(optionGroups); | ||
``` | ||
|
||
This function behaves in the same way as any other [methods that append](../setter-methods.md). | ||
|
||
### When To Use an Option Group Collection | ||
|
||
The `OptionGroupCollection` function is meant to be used to create a response to requests to your service made from select menus with external data sources, where you return an array of options or option groups: | ||
|
||
```javascript | ||
return { options: OptionGroupCollection( /* Pass in option groups */ ) }; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { CompositeBuilderClassConfig } from '../test-config-types'; | ||
import { Prop } from '../../src/internal/constants'; | ||
import { methodArgMocks } from '../mocks/method-arg-mocks'; | ||
import { SlackDto } from '../../src/internal'; | ||
import * as checks from '../checks'; | ||
|
||
export const accessibilityLabel = (params: CompositeBuilderClassConfig): void => { | ||
const config = { | ||
...params, | ||
methodArgMock: methodArgMocks.altText, | ||
methodName: Prop.AccessibilityLabel, | ||
propSetterPropName: Prop.AccessibilityLabel, | ||
slackDtoParamName: SlackDto.mapParam(Prop.AccessibilityLabel), | ||
}; | ||
|
||
checks.settableProperty(config); | ||
checks.literalBuild(config); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.