Skip to content
This repository was archived by the owner on Jan 19, 2025. It is now read-only.

Commit 04a1037

Browse files
committed
refactor: sort stuff
1 parent b8d29b9 commit 04a1037

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

api-editor/gui/src/features/ui/uiSlice.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ type UserAction =
2525
| BoundaryUserAction
2626
| CalledAfterUserAction
2727
| ConstantUserAction
28+
| DescriptionUserAction
2829
| GroupUserAction
2930
| EnumUserAction
3031
| RenameUserAction
31-
| OptionalUserAction
32-
| DescriptionUserAction;
32+
| OptionalUserAction;
3333

3434
const NoUserAction = {
3535
type: 'none',
@@ -57,6 +57,11 @@ interface ConstantUserAction {
5757
readonly target: string;
5858
}
5959

60+
interface DescriptionUserAction {
61+
readonly type: 'description';
62+
readonly target: string;
63+
}
64+
6065
interface EnumUserAction {
6166
readonly type: 'enum';
6267
readonly target: string;
@@ -78,11 +83,6 @@ interface RenameUserAction {
7883
readonly target: string;
7984
}
8085

81-
interface DescriptionUserAction {
82-
readonly type: 'description';
83-
readonly target: string;
84-
}
85-
8686
export enum HeatMapMode {
8787
None,
8888
Usages,
@@ -180,6 +180,12 @@ const uiSlice = createSlice({
180180
target: action.payload,
181181
};
182182
},
183+
showDescriptionAnnotationForm(state, action: PayloadAction<string>) {
184+
state.currentUserAction = {
185+
type: 'description',
186+
target: action.payload,
187+
};
188+
},
183189
showGroupAnnotationForm(state, action: PayloadAction<GroupTarget>) {
184190
state.currentUserAction = {
185191
type: 'group',
@@ -211,12 +217,6 @@ const uiSlice = createSlice({
211217
target: action.payload,
212218
};
213219
},
214-
showDescriptionAnnotationForm(state, action: PayloadAction<string>) {
215-
state.currentUserAction = {
216-
type: 'description',
217-
target: action.payload,
218-
};
219-
},
220220
hideAnnotationForm(state) {
221221
state.currentUserAction = NoUserAction;
222222
},
@@ -276,12 +276,12 @@ export const {
276276
showBoundaryAnnotationForm,
277277
showCalledAfterAnnotationForm,
278278
showConstantAnnotationForm,
279+
showDescriptionAnnotationForm,
279280
showEnumAnnotationForm,
280281
showGroupAnnotationForm,
281282
showMoveAnnotationForm,
282283
showOptionalAnnotationForm,
283284
showRenameAnnotationForm,
284-
showDescriptionAnnotationForm,
285285
hideAnnotationForm,
286286

287287
toggleIsExpandedInTreeView,

0 commit comments

Comments
 (0)