-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* adding fixes for sync diagram
- Loading branch information
Showing
21 changed files
with
210 additions
and
85 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import { register, createReduxStore } from '@wordpress/data'; | ||
|
||
export const FORMS_STORE_NAME = `eightshift-forms`; | ||
|
||
// Set default store state. | ||
const DEFAULT_STATE = { | ||
syncDialog: {}, | ||
isSyncDialogOpen: false, | ||
}; | ||
|
||
// Define selectors - only getters. | ||
const selectors = { | ||
getSyncDialog(state) { | ||
return state?.syncDialog ?? DEFAULT_STATE.syncDialog; | ||
}, | ||
getIsSyncDialogOpen(state) { | ||
return state?.isSyncDialogOpen ?? DEFAULT_STATE.isSyncDialogOpen; | ||
}, | ||
}; | ||
|
||
// Define actions - getters and setters. | ||
const actions = { | ||
setSyncDialog(syncDialog) { | ||
return { | ||
type: 'SET_SYNC_DIALOG', | ||
syncDialog, | ||
}; | ||
}, | ||
setIsSyncDialogOpen(isSyncDialogOpen) { | ||
return { | ||
type: 'SET_IS_SYNC_DIALOG_OPEN', | ||
isSyncDialogOpen, | ||
}; | ||
}, | ||
}; | ||
|
||
// Define reducers - only setters. | ||
const reducer = ( state = DEFAULT_STATE, action ) => { // eslint-disable-line consistent-return | ||
switch (action.type) { | ||
case 'SET_SYNC_DIALOG': { | ||
return { | ||
...state, | ||
syncDialog: action.syncDialog, | ||
}; | ||
} | ||
case 'SET_IS_SYNC_DIALOG_OPEN': { | ||
return { | ||
...state, | ||
isSyncDialogOpen: action.isSyncDialogOpen, | ||
}; | ||
} | ||
} | ||
}; | ||
|
||
register(createReduxStore(FORMS_STORE_NAME, { | ||
selectors, | ||
actions, | ||
reducer, | ||
})); |
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
12 changes: 12 additions & 0 deletions
12
src/Blocks/custom/form-selector/form-selector-overrides.js
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,12 @@ | ||
// eslint-disable-next-line no-unused-vars | ||
/* global esFormsLocalization */ | ||
|
||
import manifest from './manifest.json'; | ||
|
||
export const overrides = { | ||
...manifest, | ||
forms: [ | ||
...manifest.forms, | ||
...esFormsLocalization.formsSelectorTemplates, | ||
], | ||
}; |
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
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.