-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #71 from Phuire-Research/UI
Additional qualities added for advanced usage.
- Loading branch information
Showing
14 changed files
with
111 additions
and
25 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
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
21 changes: 21 additions & 0 deletions
21
src/concepts/axium/qualities/clearBadActionTypeFromBadActionList.quality.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,21 @@ | ||
import { defaultMethodCreator, createQuality } from '../../../model/concept'; | ||
import { Action, ActionType, prepareActionCreator } from '../../../model/action'; | ||
import { AxiumState } from '../axium.concept'; | ||
|
||
export const axiumClearBadActionTypeFromBadActionListType: ActionType = 'clear ActionType from Axium\'s badAction list'; | ||
export const axiumClearBadActionTypeFromBadActionList = prepareActionCreator(axiumClearBadActionTypeFromBadActionListType); | ||
export type ClearBadActionTypeFromBadActionListPayload = ActionType; | ||
|
||
function clearBadActionTypeFromBadActionListReducer(state: AxiumState, action: Action): AxiumState { | ||
const actionType = action.payload as ClearBadActionTypeFromBadActionListPayload; | ||
return { | ||
...state, | ||
badActions: state.badActions.filter(act => act.type !== actionType), | ||
}; | ||
} | ||
|
||
export const clearBadActionTypeFromBadActionListQuality = createQuality( | ||
axiumClearBadActionTypeFromBadActionListType, | ||
clearBadActionTypeFromBadActionListReducer, | ||
defaultMethodCreator, | ||
); |
21 changes: 21 additions & 0 deletions
21
src/concepts/axium/qualities/clearBadPlanFromBadPlanList.quality.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,21 @@ | ||
import { defaultMethodCreator, createQuality } from '../../../model/concept'; | ||
import { Action, ActionType, prepareActionCreator } from '../../../model/action'; | ||
import { AxiumState } from '../axium.concept'; | ||
|
||
export const axiumClearBadPlanFromBadPlanListType: ActionType = 'clear Plan Topic from Axium\'s badPlan list'; | ||
export const axiumClearBadPlanFromBadPlanList = prepareActionCreator(axiumClearBadPlanFromBadPlanListType); | ||
export type ClearBadPlanFromBadPlanListPayload = string; | ||
|
||
function clearBadPlanFromBadPlanListReducer(state: AxiumState, action: Action): AxiumState { | ||
const title = action.payload as ClearBadPlanFromBadPlanListPayload; | ||
return { | ||
...state, | ||
badPlans: state.badPlans.filter(act => act.title !== title), | ||
}; | ||
} | ||
|
||
export const clearBadPlanFromBadPlanListQuality = createQuality( | ||
axiumClearBadPlanFromBadPlanListType, | ||
clearBadPlanFromBadPlanListReducer, | ||
defaultMethodCreator, | ||
); |
28 changes: 28 additions & 0 deletions
28
src/concepts/axium/qualities/clearBadStrategyTopicFromBadActionList.quality.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,28 @@ | ||
import { defaultMethodCreator, createQuality } from '../../../model/concept'; | ||
import { Action, ActionType, prepareActionCreator } from '../../../model/action'; | ||
import { AxiumState } from '../axium.concept'; | ||
|
||
export const axiumClearBadStrategyTopicFromBadActionListType: ActionType = 'clear Strategy Topic from Axium\'s badAction list'; | ||
export const axiumClearBadStrategyTopicFromBadActionList = prepareActionCreator(axiumClearBadStrategyTopicFromBadActionListType); | ||
export type ClearBadStrategyTopicFromBadActionListPayload = string; | ||
|
||
function clearBadStrategyTopicFromBadActionListReducer(state: AxiumState, action: Action): AxiumState { | ||
const strategyTopic = action.payload as ClearBadStrategyTopicFromBadActionListPayload; | ||
const badActions = state.badActions.filter(act => { | ||
if (act.strategy && act.strategy.topic !== strategyTopic) { | ||
return true; | ||
} else { | ||
return false; | ||
} | ||
}); | ||
return { | ||
...state, | ||
badActions, | ||
}; | ||
} | ||
|
||
export const clearBadStrategyTopicFromBadActionListQuality = createQuality( | ||
axiumClearBadStrategyTopicFromBadActionListType, | ||
clearBadStrategyTopicFromBadActionListReducer, | ||
defaultMethodCreator, | ||
); |
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