Skip to content
This repository has been archived by the owner on Nov 29, 2023. It is now read-only.

Commit

Permalink
refactor: sort stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
lars-reimann committed Jun 13, 2022
1 parent b8d29b9 commit 04a1037
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions api-editor/gui/src/features/ui/uiSlice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ type UserAction =
| BoundaryUserAction
| CalledAfterUserAction
| ConstantUserAction
| DescriptionUserAction
| GroupUserAction
| EnumUserAction
| RenameUserAction
| OptionalUserAction
| DescriptionUserAction;
| OptionalUserAction;

const NoUserAction = {
type: 'none',
Expand Down Expand Up @@ -57,6 +57,11 @@ interface ConstantUserAction {
readonly target: string;
}

interface DescriptionUserAction {
readonly type: 'description';
readonly target: string;
}

interface EnumUserAction {
readonly type: 'enum';
readonly target: string;
Expand All @@ -78,11 +83,6 @@ interface RenameUserAction {
readonly target: string;
}

interface DescriptionUserAction {
readonly type: 'description';
readonly target: string;
}

export enum HeatMapMode {
None,
Usages,
Expand Down Expand Up @@ -180,6 +180,12 @@ const uiSlice = createSlice({
target: action.payload,
};
},
showDescriptionAnnotationForm(state, action: PayloadAction<string>) {
state.currentUserAction = {
type: 'description',
target: action.payload,
};
},
showGroupAnnotationForm(state, action: PayloadAction<GroupTarget>) {
state.currentUserAction = {
type: 'group',
Expand Down Expand Up @@ -211,12 +217,6 @@ const uiSlice = createSlice({
target: action.payload,
};
},
showDescriptionAnnotationForm(state, action: PayloadAction<string>) {
state.currentUserAction = {
type: 'description',
target: action.payload,
};
},
hideAnnotationForm(state) {
state.currentUserAction = NoUserAction;
},
Expand Down Expand Up @@ -276,12 +276,12 @@ export const {
showBoundaryAnnotationForm,
showCalledAfterAnnotationForm,
showConstantAnnotationForm,
showDescriptionAnnotationForm,
showEnumAnnotationForm,
showGroupAnnotationForm,
showMoveAnnotationForm,
showOptionalAnnotationForm,
showRenameAnnotationForm,
showDescriptionAnnotationForm,
hideAnnotationForm,

toggleIsExpandedInTreeView,
Expand Down

0 comments on commit 04a1037

Please sign in to comment.