Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VULCAN Sprint 43 - Neodash Features #158

Merged
merged 4 commits into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ const NodePropertyParameterSelectComponent = (props: ParameterSelectProps) => {
<div className={'n-flex n-flex-row n-flex-wrap n-items-center'}>
<Autocomplete
id='autocomplete'
autoHighlight
multiple={multiSelector}
options={options}
disabled={disabled}
Expand Down
15 changes: 15 additions & 0 deletions src/chart/table/TableChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,21 @@ export const NeoTableChart = (props: ChartProps) => {
}
onCellDoubleClick={(e) => {
let rules = getRule(e, actionsRules, 'doubleClick');
let ruleCellCopy = getRule(e, actionsRules, 'ruleCellCopy');

if (ruleCellCopy?.length > 0) {
const fieldDetails = ruleCellCopy.find((rule) => rule.field === e.field);
if (fieldDetails) {
const regex = new RegExp(fieldDetails?.customizationValue, 'g');
setNotificationOpen(true);
navigator.clipboard.writeText(e.value.replace(regex, ''));
} else {
setNotificationOpen(true);
navigator.clipboard.writeText(e.value);
}
return;
}

if (rules !== null) {
rules.forEach((rule) => executeActionRule(rule, e, { ...props, pageNames: pageNames }, 'table'));
} else {
Expand Down
10 changes: 8 additions & 2 deletions src/extensions/actions/ActionsRuleCreationModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ const RULE_CONDITIONS = {
disableFieldSelection: true,
multiple: true,
},
{
value: 'ruleCellCopy',
label: 'Cell Copy',
disableFieldSelection: true,
multiple: true,
},
],
bar: [
{
Expand Down Expand Up @@ -375,7 +381,7 @@ export const NeoCustomReportActionsModal = ({
const td2Styling = (type) => ({ width: type === 'bar' ? '15%' : '30%' });
const td2DropdownClassname = (type) => `n-align-middle n-pr-1 ${type === 'bar' ? 'n-w-full' : 'n-w-2/5'}`;
const td2Autocomplete = (type, index, rule) =>
(type !== 'bar' && rule.condition !== 'rowCheck' ? (
type !== 'bar' && rule.condition !== 'rowCheck' ? (
<Autocomplete
className='n-align-middle n-inline-block n-w-/5'
disableClearable={true}
Expand Down Expand Up @@ -406,7 +412,7 @@ export const NeoCustomReportActionsModal = ({
/>
) : (
<></>
));
);
const td4Styling = (type) => ({ width: type === 'bar' ? '45%' : '40%' });
const td4DropdownClassname = 'n-align-middle, n-w-1/3';
const td6Styling = (type) => ({ width: type === 'bar' ? '30%' : '20%' });
Expand Down
8 changes: 8 additions & 0 deletions src/index.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@
@tailwind components;
@tailwind utilities;

.anchor {
text-decoration: underline;
text-decoration-thickness: 2px;
text-underline-offset: 4px;
text-decoration-color: blue;
color: blue;
}

/* Create CSS class based components */
/* https://tailwindcss.com/docs/reusing-styles#extracting-classes-with-apply */
@layer components {
Expand Down
5 changes: 5 additions & 0 deletions src/report/ReportRecordProcessing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,11 @@ function RenderArray(value, transposedTable = false) {

export function RenderString(value) {
const str = value?.toString() || '';

if (str.startsWith('<a href=')) {
return <div dangerouslySetInnerHTML={{ __html: str }} className='anchor' />;
}

if (str.startsWith('http') || str.startsWith('https')) {
return (
<TextLink key={value} externalLink target='_blank' href={str}>
Expand Down
Loading