Skip to content

Commit

Permalink
Merge pull request #39 from phillipivan/main
Browse files Browse the repository at this point in the history
Minor Fixes
  • Loading branch information
phillipivan authored Sep 22, 2024
2 parents 6fda424 + 00f27e2 commit 7449cdf
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 34 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "generic-emberplus",
"version": "2.4.0",
"version": "2.4.2",
"main": "dist/index.js",
"scripts": {
"prepare": "husky",
Expand Down
52 changes: 19 additions & 33 deletions src/feedback.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,17 @@ export enum FeedbackId {
TargetBackgroundSelected = 'targetBackgroundSelected',
}

const styles = {
blackOnWhite: {
bgcolor: combineRgb(255, 255, 255),
color: combineRgb(0, 0, 0),
},
blackOnRed: {
bgcolor: combineRgb(255, 0, 0),
color: combineRgb(0, 0, 0),
},
}

export function GetFeedbacksList(
_self: EmberPlusInstance, //InstanceBase<EmberPlusConfig>,
_emberClient: EmberClient,
Expand All @@ -26,10 +37,7 @@ export function GetFeedbacksList(
name: 'Parameter Equals',
description: 'Checks the current value of a paramter',
type: 'boolean',
defaultStyle: {
bgcolor: combineRgb(255, 255, 255),
color: combineRgb(0, 0, 0),
},
defaultStyle: styles.blackOnWhite,
options: [
{
type: 'dropdown',
Expand Down Expand Up @@ -61,10 +69,7 @@ export function GetFeedbacksList(
name: 'Parameter Equals String',
description: 'Checks the current value of a paramter against a String',
type: 'boolean',
defaultStyle: {
bgcolor: combineRgb(255, 255, 255),
color: combineRgb(0, 0, 0),
},
defaultStyle: styles.blackOnWhite,
options: [
{
type: 'dropdown',
Expand All @@ -84,11 +89,8 @@ export function GetFeedbacksList(
},
],
callback: async (feedback, context) => {
const path = await resolvePath(
_self,
await context.parseVariablesInString(feedback.options['path']?.toString() ?? ''),
)
const value: string = await context.parseVariablesInString(feedback.options['value']?.toString() ?? '')
const path = await resolvePath(context, feedback.options['path']?.toString() ?? '')
const value = await context.parseVariablesInString(feedback.options['value']?.toString() ?? '')
return state.parameters.get(path) == value
},
subscribe: async (feedback, context) => {
Expand All @@ -99,10 +101,7 @@ export function GetFeedbacksList(
name: 'Take is possible',
description: 'Shows if there is take possible',
type: 'boolean',
defaultStyle: {
bgcolor: combineRgb(255, 255, 255),
color: combineRgb(255, 0, 0),
},
defaultStyle: styles.blackOnWhite,
options: [],
callback: () => {
return state.selected.target != -1 && state.selected.source != -1 && state.selected.matrix != -1
Expand All @@ -112,10 +111,7 @@ export function GetFeedbacksList(
name: 'Clear is possible',
description: 'Changes when a selection is made.',
type: 'boolean',
defaultStyle: {
bgcolor: combineRgb(255, 255, 255),
color: combineRgb(255, 0, 0),
},
defaultStyle: styles.blackOnRed,
options: [],
callback: () => {
return state.selected.target != -1 || state.selected.source != -1 || state.selected.matrix != -1
Expand All @@ -125,12 +121,7 @@ export function GetFeedbacksList(
name: 'Source Background If Selected',
description: 'Change Background of Source, when it is currently selected.',
type: 'boolean',
defaultStyle: {
// The default style change for a boolean feedback
// The user will be able to customise these values as well as the fields that will be changed
bgcolor: combineRgb(255, 0, 0),
color: combineRgb(0, 0, 0),
},
defaultStyle: styles.blackOnRed,
options: [
{
type: 'number',
Expand Down Expand Up @@ -161,12 +152,7 @@ export function GetFeedbacksList(
name: 'Target Background if Selected',
description: 'Change Background of Target, when it is currently selected.',
type: 'boolean',
defaultStyle: {
// The default style change for a boolean feedback
// The user will be able to customise these values as well as the fields that will be changed
bgcolor: combineRgb(255, 0, 0),
color: combineRgb(0, 0, 0),
},
defaultStyle: styles.blackOnRed,
options: [
{
type: 'number',
Expand Down

0 comments on commit 7449cdf

Please sign in to comment.