-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Clean up Builder file * Add definitions for Range * Remove temp variables * Add Javascript skeleton * Add Javascript reducer * Add ConfigJavascript * Fix toggle not listening to target changes * Add getWidgetByName method * Add javacript run before model run * Add debounce to Toggle closes #48 closes #47
- Loading branch information
1 parent
6df5827
commit 7988d13
Showing
141 changed files
with
849 additions
and
338 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { | ||
ADD_WIDGET, | ||
RENAME_WIDGET | ||
} from '@actions/types' | ||
|
||
import generateID from '@helpers/generateID' | ||
import WidgetType from '@enum/WidgetType' | ||
|
||
export const addJavascript = () => ({ | ||
type: ADD_WIDGET, | ||
payload: { | ||
id: generateID(), | ||
type: WidgetType.JAVASCRIPT | ||
} | ||
}) | ||
|
||
export const renameJavascript = (javascript, name) => ({ | ||
type: RENAME_WIDGET, | ||
payload: { | ||
widget: javascript, | ||
name | ||
} | ||
}) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { | ||
ADD_WIDGET, | ||
REMOVE_WIDGET, | ||
UPDATE_WIDGET_CONFIG | ||
} from '@actions/types' | ||
|
||
import { | ||
addWidget, | ||
removeWidget, | ||
getWidgetsForDropdown, | ||
getWidget, | ||
} from '../commons/widget' | ||
|
||
import { | ||
updateWidgetConfig | ||
} from '../commons/config' | ||
|
||
import WidgetType from '@enum/WidgetType' | ||
import memoize from 'memoize-one' | ||
|
||
const type = WidgetType.JAVASCRIPT | ||
|
||
export default function (state = {}, action) { | ||
switch (action.type) { | ||
case ADD_WIDGET: | ||
return addWidget(state, action.payload, type) | ||
case REMOVE_WIDGET: | ||
return removeWidget(state, action.payload, type) | ||
case UPDATE_WIDGET_CONFIG: | ||
return updateWidgetConfig(state, action.payload, type) | ||
} | ||
return state | ||
} | ||
|
||
export const get = memoize(getWidget) | ||
export const getAll = state => state | ||
export const getForDropdown = memoize(getWidgetsForDropdown) |
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.