Skip to content

Commit 38f2ecc

Browse files
authored
feat: add support muxing rules v2 (#311)
* chore: add dnd-kit, uuid and upgrade ui-kit * feat: create SortableArea generic component * feat: replacing zustand store with useFormState, rename filename * feat: replace drag icon * feat: add models dropdown * feat: create a remove queries utility fn * refactor: simplify logic for handling dirty and reset form state * feat: update muxing rules * feat: show remove button if multiple rules * feat: add link to doc and manager providers link * refactor: remove unneeded div wrapper * feat: use form buttons * leftover * feat: change notfication message * chore: update msw handlers * fix: update rules and add tests case * refactor: rename filename * refactor: revert changes * chore: update openapi * fix: matcher_type for filename * feat: set the default muxing rule as catch all * fix: update workspace name and models * test: update muxing model * fix: type * fix: drag sortable area * fix: catch all rule spacing * fix: fields alignment * fix: models unique identifier * fix: invalidate models * test: update muxing logic * prettier * refactor: review
1 parent 35ba1a4 commit 38f2ecc

26 files changed

+1171
-391
lines changed

icons/drag.svg

+8
Loading

package-lock.json

+73
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+3
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
"generate-icons": "npx @svgr/cli --typescript --no-dimensions --replace-attr-values '#2E323A=currentColor' --jsx-runtime automatic --out-dir ./src/components/icons/ -- icons"
2222
},
2323
"dependencies": {
24+
"@dnd-kit/core": "^6.3.1",
25+
"@dnd-kit/sortable": "^10.0.0",
2426
"@hey-api/client-fetch": "^0.7.1",
2527
"@jsonforms/core": "^3.5.1",
2628
"@jsonforms/react": "^3.5.1",
@@ -52,6 +54,7 @@
5254
"tailwind-variants": "^0.3.1",
5355
"tailwindcss-animate": "^1.0.7",
5456
"ts-pattern": "^5.6.2",
57+
"uuid": "^11.0.5",
5558
"zod": "^3.24.1"
5659
},
5760
"devDependencies": {

src/api/generated/types.gen.ts

+13-6
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ export type Alert = {
3535
| {
3636
[key: string]: unknown
3737
}
38-
| null
39-
trigger_type: string
40-
trigger_category: string | null
41-
timestamp: string
42-
}
38+
| null;
39+
trigger_type: string;
40+
trigger_category: AlertSeverity;
41+
timestamp: string;
42+
};
4343

4444
/**
4545
* Represents an alert with it's respective conversation.
@@ -59,6 +59,11 @@ export type AlertConversation = {
5959
timestamp: string
6060
}
6161

62+
export enum AlertSeverity {
63+
INFO = "info",
64+
CRITICAL = "critical",
65+
}
66+
6267
/**
6368
* Represents a chat message.
6469
*/
@@ -140,7 +145,9 @@ export type ModelByProvider = {
140145
* Represents the different types of matchers we support.
141146
*/
142147
export enum MuxMatcherType {
143-
CATCH_ALL = 'catch_all',
148+
CATCH_ALL = "catch_all",
149+
FILENAME_MATCH = "filename_match",
150+
REQUEST_TYPE_MATCH = "request_type_match",
144151
}
145152

146153
/**

0 commit comments

Comments
 (0)