File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11{
22 "name" : " @diamondlightsource/cs-web-lib" ,
33 "type" : " module" ,
4- "version" : " 0.10.21 " ,
4+ "version" : " 0.10.22 " ,
55 "description" : " Control system web library" ,
66 "main" : " ./dist/index.cjs" ,
77 "scripts" : {
Original file line number Diff line number Diff line change @@ -149,10 +149,11 @@ export function useRules(props: AnyProps): AnyProps {
149149 log . debug ( newProps ) ;
150150 } else {
151151 // 'Output expression' - evaluate 'value' and set the prop to the result.
152- const expression = "return " + ( exp . convertedValue ?? exp . value ) ;
152+ const expression = "return " + ( exp . convertedValue ?? exp . value . _text ) ;
153153 log . debug ( `Output expression ${ expression } ` ) ;
154154 // eslint-disable-next-line no-new-func
155155 const f = Function ( ...Object . keys ( pvVars ) , expression ) ;
156+
156157 newProps [ prop ] = f ( ...Object . values ( pvVars ) ) ;
157158 }
158159 log . debug ( "Props after rule evaluation:" ) ;
Original file line number Diff line number Diff line change @@ -295,7 +295,7 @@ export const opiParseRules = (
295295 const expArray = toArray ( ruleElement . exp ) ;
296296 const expressions = expArray . map (
297297 ( expression : ElementCompact ) : Expression => {
298- const value = expression . value ;
298+ const value = expression . value ?? expression . expression ;
299299 return {
300300 boolExp : expression . _attributes ?. bool_exp as string ,
301301 value : value
You can’t perform that action at this time.
0 commit comments