-
-
Notifications
You must be signed in to change notification settings - Fork 135
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature: Add popup for workspace rebase
- Loading branch information
Showing
21 changed files
with
372 additions
and
163 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
69 changes: 69 additions & 0 deletions
69
packages/neos-ui-redux-store/src/UI/SyncWorkspaceModal/index.ts
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,69 @@ | ||
import produce from 'immer'; | ||
import {action as createAction, ActionType} from 'typesafe-actions'; | ||
|
||
import {InitAction} from '../../System'; | ||
|
||
export interface State extends Readonly<{ | ||
isOpen: boolean; | ||
}> {} | ||
|
||
export const defaultState: State = { | ||
isOpen: false | ||
}; | ||
|
||
// | ||
// Export the action types | ||
// | ||
export enum actionTypes { | ||
OPEN = '@neos/neos-ui/UI/SyncWorkspaceModal/OPEN', | ||
CANCEL = '@neos/neos-ui/UI/SyncWorkspaceModal/CANCEL', | ||
APPLY = '@neos/neos-ui/UI/SyncWorkspaceModal/APPLY' | ||
} | ||
|
||
/** | ||
* Opens the add node modal. | ||
*/ | ||
const open = () => createAction(actionTypes.OPEN); | ||
|
||
/** | ||
* Closes the add node modal. | ||
*/ | ||
const cancel = () => createAction(actionTypes.CANCEL); | ||
|
||
/** | ||
* Closes the add node modal. | ||
*/ | ||
const apply = () => createAction(actionTypes.APPLY); | ||
|
||
// | ||
// Export the actions | ||
// | ||
export const actions = { | ||
open, | ||
cancel, | ||
apply | ||
}; | ||
|
||
export type Action = ActionType<typeof actions>; | ||
|
||
// | ||
// Export the reducer | ||
// | ||
export const reducer = (state: State = defaultState, action: InitAction | Action) => produce(state, draft => { | ||
switch (action.type) { | ||
case actionTypes.OPEN: { | ||
draft.isOpen = true; | ||
break; | ||
} | ||
case actionTypes.CANCEL: { | ||
draft.isOpen = false; | ||
break; | ||
} | ||
case actionTypes.APPLY: { | ||
draft.isOpen = false; | ||
break; | ||
} | ||
} | ||
}); | ||
|
||
export const selectors = {}; |
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
Oops, something went wrong.