File tree Expand file tree Collapse file tree 2 files changed +36
-1
lines changed
routes/page/agent/[agentId]/agent-components Expand file tree Collapse file tree 2 files changed +36
-1
lines changed Original file line number Diff line number Diff line change 132132/**
133133 * @typedef {Object } AgentUtility
134134 * @property {string } name
135- * @property {boolean } disabled
135+ * @property {boolean } disabled
136+ * @property {string? } [visibility_expression]
136137 * @property {import('$commonTypes').NameBase[] } functions
137138 * @property {import('$commonTypes').NameBase[] } templates
138139 */
Original file line number Diff line number Diff line change 4242 return {
4343 name: x .name ,
4444 disabled: x .disabled ,
45+ visibility_expression: x .visibility_expression ,
4546 functions: functions,
4647 templates: templates
4748 };
176177 handleAgentChange ();
177178 }
178179
180+ /**
181+ * @param {any} e
182+ * @param {number} uid
183+ */
184+ function changeUtilityVisibility (e , uid ) {
185+ const found = innerUtilities .find ((_ , index ) => index === uid);
186+ if (! found) return ;
187+
188+ found .visibility_expression = e .target .value || null ;
189+ innerRefresh (innerUtilities);
190+ handleAgentChange ();
191+ }
192+
179193 /**
180194 * @param {number} uid
181195 * @param {number} id
246260 return {
247261 name: x .name ,
248262 disabled: x .disabled ,
263+ visibility_expression: x .visibility_expression ,
249264 functions: x .functions .map (f => ({ ... f })),
250265 templates: x .templates .map (t => ({ ... t }))
251266 }
341356 < / div>
342357
343358 < div class = " utility-row utility-row-secondary" >
359+ < div class = " utility-content" >
360+ < div class = " utility-list-item" >
361+ < div class = " utility-label line-align-center" >
362+ {' Visibility expression' }
363+ < / div>
364+ < div class = " utility-value" >
365+ < div class = " utility-input line-align-center" >
366+ < Input
367+ type= " text"
368+ disabled= {utility .disabled }
369+ maxlength= {1000 }
370+ value= {utility .visibility_expression }
371+ on: change= {e => changeUtilityVisibility (e, uid)}
372+ / >
373+ < / div>
374+ < div class = " utility-delete line-align-center" >< / div>
375+ < / div>
376+ < / div>
377+ < / div>
344378 < div class = " utility-content" >
345379 {#each utility .functions as fn, fid (fid)}
346380 < div class = " utility-list-item" >
You can’t perform that action at this time.
0 commit comments