Skip to content

Commit 5376f94

Browse files
committed
Fix locale and link prep
1 parent 6b67009 commit 5376f94

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

src/chart/ChartUtils.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,11 @@ export function getRecordType(value) {
140140
return 'objectNumber';
141141
}
142142
return 'object';
143+
} else if (typeof value === 'string' || value instanceof String) {
144+
if (value.startsWith('http') || value.startsWith('https')) {
145+
return 'link';
146+
}
147+
return 'string';
143148
}
144149

145150
// Use string as default type

src/chart/parameter/component/NodePropertyParameterSelect.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,9 @@ const NodePropertyParameterSelectComponent = (props: ParameterSelectProps) => {
120120

121121
handleParametersUpdate(newValue, newDisplay, manualParameterSave);
122122
};
123+
console.log(extraRecords);
124+
console.log(displayValueRowIndex);
125+
console.log(inputDisplayText);
123126
return (
124127
<div className={'n-flex n-flex-row n-flex-wrap n-items-center'}>
125128
<Autocomplete
@@ -151,7 +154,7 @@ const NodePropertyParameterSelectComponent = (props: ParameterSelectProps) => {
151154
variant='outlined'
152155
/>
153156
)}
154-
getOptionLabel={(option) => RenderSubValue(option)}
157+
getOptionLabel={(option) => option?.toString() || ''}
155158
/>
156159
{manualParameterSave ? <SelectionConfirmationButton onClick={() => manualHandleParametersUpdate()} /> : <></>}
157160
</div>

src/report/ReportRecordProcessing.tsx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ function RenderPath(value) {
248248
function RenderArray(value) {
249249
const mapped = value.map((v, i) => {
250250
return (
251-
<div key={String(`k${ i}`) + v}>
251+
<div key={String(`k${i}`) + v}>
252252
{RenderSubValue(v)}
253253
{i < value.length - 1 && !valueIsNode(v) && !valueIsRelationship(v) ? <span>,&nbsp;</span> : <></>}
254254
</div>
@@ -269,6 +269,14 @@ function RenderString(value) {
269269
return str;
270270
}
271271

272+
function RenderLink(value) {
273+
return (
274+
<TextLink key={value} externalLink target='_blank' href={value}>
275+
{value}
276+
</TextLink>
277+
);
278+
}
279+
272280
function RenderPoint(value) {
273281
return (
274282
<HtmlTooltip
@@ -379,6 +387,10 @@ export const rendererForType: any = {
379387
type: 'string',
380388
renderValue: (c) => RenderString(c.value),
381389
},
390+
link: {
391+
type: 'link',
392+
renderValue: (c) => RenderLink(c.value),
393+
},
382394
};
383395

384396
export function getRendererForValue(value) {

0 commit comments

Comments
 (0)