Skip to content

Commit 1a9740d

Browse files
authored
Merge pull request #157 from mercedes-benz/TryOut
link out feature
2 parents 9f7c856 + c032a8f commit 1a9740d

File tree

5 files changed

+37
-2
lines changed

5 files changed

+37
-2
lines changed

src/chart/parameter/component/NodePropertyParameterSelect.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ const NodePropertyParameterSelectComponent = (props: ParameterSelectProps) => {
171171
<div className={'n-flex n-flex-row n-flex-wrap n-items-center'}>
172172
<Autocomplete
173173
id='autocomplete'
174+
autoHighlight
174175
multiple={multiSelector}
175176
options={options}
176177
disabled={disabled}

src/chart/table/TableChart.tsx

+15
Original file line numberDiff line numberDiff line change
@@ -496,6 +496,21 @@ export const NeoTableChart = (props: ChartProps) => {
496496
}
497497
onCellDoubleClick={(e) => {
498498
let rules = getRule(e, actionsRules, 'doubleClick');
499+
let ruleCellCopy = getRule(e, actionsRules, 'ruleCellCopy');
500+
501+
if (ruleCellCopy?.length > 0) {
502+
const fieldDetails = ruleCellCopy.find((rule) => rule.field === e.field);
503+
if (fieldDetails) {
504+
const regex = new RegExp(fieldDetails?.customizationValue, 'g');
505+
setNotificationOpen(true);
506+
navigator.clipboard.writeText(e.value.replace(regex, ''));
507+
} else {
508+
setNotificationOpen(true);
509+
navigator.clipboard.writeText(e.value);
510+
}
511+
return;
512+
}
513+
499514
if (rules !== null) {
500515
rules.forEach((rule) => executeActionRule(rule, e, { ...props, pageNames: pageNames }, 'table'));
501516
} else {

src/extensions/actions/ActionsRuleCreationModal.tsx

+8-2
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@ const RULE_CONDITIONS = {
5555
disableFieldSelection: true,
5656
multiple: true,
5757
},
58+
{
59+
value: 'ruleCellCopy',
60+
label: 'Cell Copy',
61+
disableFieldSelection: true,
62+
multiple: true,
63+
},
5864
],
5965
bar: [
6066
{
@@ -375,7 +381,7 @@ export const NeoCustomReportActionsModal = ({
375381
const td2Styling = (type) => ({ width: type === 'bar' ? '15%' : '30%' });
376382
const td2DropdownClassname = (type) => `n-align-middle n-pr-1 ${type === 'bar' ? 'n-w-full' : 'n-w-2/5'}`;
377383
const td2Autocomplete = (type, index, rule) =>
378-
(type !== 'bar' && rule.condition !== 'rowCheck' ? (
384+
type !== 'bar' && rule.condition !== 'rowCheck' ? (
379385
<Autocomplete
380386
className='n-align-middle n-inline-block n-w-/5'
381387
disableClearable={true}
@@ -406,7 +412,7 @@ export const NeoCustomReportActionsModal = ({
406412
/>
407413
) : (
408414
<></>
409-
));
415+
);
410416
const td4Styling = (type) => ({ width: type === 'bar' ? '45%' : '40%' });
411417
const td4DropdownClassname = 'n-align-middle, n-w-1/3';
412418
const td6Styling = (type) => ({ width: type === 'bar' ? '30%' : '20%' });

src/index.pcss

+8
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22
@tailwind components;
33
@tailwind utilities;
44

5+
.anchor {
6+
text-decoration: underline;
7+
text-decoration-thickness: 2px;
8+
text-underline-offset: 4px;
9+
text-decoration-color: blue;
10+
color: blue;
11+
}
12+
513
/* Create CSS class based components */
614
/* https://tailwindcss.com/docs/reusing-styles#extracting-classes-with-apply */
715
@layer components {

src/report/ReportRecordProcessing.tsx

+5
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,11 @@ function RenderArray(value, transposedTable = false) {
284284

285285
export function RenderString(value) {
286286
const str = value?.toString() || '';
287+
288+
if (str.startsWith('<a href=')) {
289+
return <div dangerouslySetInnerHTML={{ __html: str }} className='anchor' />;
290+
}
291+
287292
if (str.startsWith('http') || str.startsWith('https')) {
288293
return (
289294
<TextLink key={value} externalLink target='_blank' href={str}>

0 commit comments

Comments
 (0)