Skip to content

Commit 3278343

Browse files
Adding app sort and filter opts, discord async options (#18105)
* Adding app sort and filter opts, discord async options * Update SelectApp.tsx * Update SelectApp.tsx * Update SelectApp.tsx
1 parent 700d827 commit 3278343

File tree

6 files changed

+70
-16
lines changed

6 files changed

+70
-16
lines changed

packages/connect-react/CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,19 @@
22

33
# Changelog
44

5+
## [1.5.0] - 2025-08-18
6+
7+
### Fixed
8+
9+
- Added special handling to support `$.discord.channel[]` prop type
10+
11+
### Added
12+
13+
- Support for app sorting and filtering in `SelectApp` component and `useApps` hook
14+
- Added `appsOptions` prop to `SelectApp` for controlling sort order and filtering
15+
- Apps can now be sorted by `name`, `featured_weight`, or `name_slug`
16+
- Support for filtering apps by whether they have actions, triggers, or components
17+
518
## [1.4.0] - 2025-08-01
619

720
### Added

packages/connect-react/README.md

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,34 @@ This allows you to use your own OAuth applications for specific integrations, pr
183183
184184
**Note**: OAuth app IDs are not sensitive, and are safe to expose in the client.
185185
186+
### App Sorting and Filtering
187+
188+
When using the `SelectApp` component or `useApps` hook, you can control how apps are sorted and filtered:
189+
190+
```tsx
191+
<SelectApp
192+
value={selectedApp}
193+
onChange={setSelectedApp}
194+
appsOptions={{
195+
sortKey: "featured_weight", // Sort by: "name" | "featured_weight" | "name_slug"
196+
sortDirection: "desc", // "asc" | "desc"
197+
hasActions: true, // Only show apps with actions
198+
hasTriggers: false, // Exclude apps with triggers
199+
}}
200+
/>
201+
```
202+
203+
The `useApps` hook accepts the same options:
204+
205+
```tsx
206+
const { apps, isLoading } = useApps({
207+
q: "slack", // Search query
208+
sortKey: "featured_weight",
209+
sortDirection: "desc",
210+
hasActions: true,
211+
});
212+
```
213+
186214
## Customization
187215
188216
Style individual components using the `CustomizeProvider` and a `CustomizationConfig`.
@@ -454,7 +482,7 @@ customization options available.
454482
- `useFrontendClient` — _allows use of provided Pipedream frontendClient_
455483
- `useAccounts` — _react-query wrapper to list Pipedream connect accounts (for app, external user, etc.)_
456484
- `useApp` — _react-query wrapper to retrieve a Pipedream app_
457-
- `useApps` — _react-query wrapper to list Pipedream apps_
485+
- `useApps` — _react-query wrapper to list Pipedream apps with support for sorting and filtering_
458486
- `useComponent` — _react-query wrapper to retrieve a Pipedream component (action or trigger)_
459487
- `useComponents` — _react-query wrapper to list Pipedream components (actions or triggers)_
460488

packages/connect-react/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/connect-react",
3-
"version": "1.4.0",
3+
"version": "1.5.0",
44
"description": "Pipedream Connect library for React",
55
"files": [
66
"dist"

packages/connect-react/src/components/Control.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ export function Control<T extends ConfigurableProps, U extends ConfigurableProp>
3232
const app = "app" in field.extra
3333
? field.extra.app
3434
: undefined;
35-
36-
if (prop.remoteOptions || prop.type === "$.discord.channel") {
35+
if (prop.remoteOptions || prop.type === "$.discord.channel" || prop.type === "$.discord.channel[]") {
3736
return <RemoteOptionsContainer queryEnabled={queryDisabledIdx == null || queryDisabledIdx >= idx} />;
3837
}
3938

packages/connect-react/src/components/SelectApp.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,21 @@ import {
33
} from "react";
44
import Select, { components } from "react-select";
55
import { useApps } from "../hooks/use-apps";
6-
import { AppResponse } from "@pipedream/sdk";
6+
import type {
7+
AppResponse, GetAppsOpts,
8+
} from "@pipedream/sdk";
79

810
type SelectAppProps = {
911
value?: Partial<AppResponse> & { name_slug: string; };
1012
onChange?: (app?: AppResponse) => void;
13+
/**
14+
* Additional options for fetching apps (sorting, filtering, etc.)
15+
*/
16+
appsOptions?: Omit<GetAppsOpts, "q">;
1117
};
1218

1319
export function SelectApp({
14-
value, onChange,
20+
value, onChange, appsOptions,
1521
}: SelectAppProps) {
1622
const [
1723
inputValue,
@@ -40,6 +46,7 @@ export function SelectApp({
4046
// TODO error
4147
apps,
4248
} = useApps({
49+
...appsOptions ?? {},
4350
q,
4451
});
4552
const {

pnpm-lock.yaml

Lines changed: 17 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)