diff --git a/src/component/1d/Chart1D.tsx b/src/component/1d/Chart1D.tsx index 38e5e2ae0..d70accd67 100644 --- a/src/component/1d/Chart1D.tsx +++ b/src/component/1d/Chart1D.tsx @@ -28,10 +28,11 @@ function Chart1D({ mode, width, height, margin, displayerKey }) { return ( diff --git a/src/component/1d/SpectraLegends.tsx b/src/component/1d/SpectraLegends.tsx index 2cba69e3c..d3963a987 100644 --- a/src/component/1d/SpectraLegends.tsx +++ b/src/component/1d/SpectraLegends.tsx @@ -71,7 +71,7 @@ function InnerSpectraLegends({ fill: (spectrum as Spectrum1D).display.color, }} /> - + {legendsFields.map((field) => { const predefinedField = field as PredefinedLegendField; diff --git a/src/component/1d/jCouplingGraph/JsCoupling.tsx b/src/component/1d/jCouplingGraph/JsCoupling.tsx index d1f40d405..5d6a769b0 100644 --- a/src/component/1d/jCouplingGraph/JsCoupling.tsx +++ b/src/component/1d/jCouplingGraph/JsCoupling.tsx @@ -13,10 +13,7 @@ export default function JsCoupling({ value }: JsCouplingProps) { if (!scaleY) return null; return ( - + setOver(true)} onMouseLeave={() => setOver(false)} @@ -27,7 +24,7 @@ export default function JsCoupling({ value }: JsCouplingProps) { pointerEvents="all" /> {isOver && ( - + diff --git a/src/component/elements/SVGGroup.tsx b/src/component/elements/SVGGroup.tsx index b3f070df9..47ab58f0a 100644 --- a/src/component/elements/SVGGroup.tsx +++ b/src/component/elements/SVGGroup.tsx @@ -23,10 +23,10 @@ export function SVGGroup(props: SVGGroupProps) { if (element) { const boundary = element.getBoundingClientRect(); if (direction === 'row') { - element.style.transform = `translate(${shift}px,0)`; + element.setAttribute('transform', `translate(${shift} 0)`); shift += boundary.width + space; } else { - element.style.transform = `translate(0,${shift}px)`; + element.setAttribute('transform', `translate(0 ${shift})`); shift += boundary.height + space; } } diff --git a/src/component/elements/linearAxis/LinearVerticalAxis.tsx b/src/component/elements/linearAxis/LinearVerticalAxis.tsx index 86d36ba65..1f732aac3 100644 --- a/src/component/elements/linearAxis/LinearVerticalAxis.tsx +++ b/src/component/elements/linearAxis/LinearVerticalAxis.tsx @@ -56,7 +56,12 @@ const VerticalAxis = forwardRef( /> )} - + {label} diff --git a/src/component/elements/resizer/SVGResizer.tsx b/src/component/elements/resizer/SVGResizer.tsx index 49e09600b..74bf1aa79 100644 --- a/src/component/elements/resizer/SVGResizer.tsx +++ b/src/component/elements/resizer/SVGResizer.tsx @@ -82,7 +82,7 @@ function SVGResizerHandle(props: { diff --git a/src/component/modal/ExportAsJcampModal.tsx b/src/component/modal/ExportAsJcampModal.tsx index 2ea695a34..339b345ba 100644 --- a/src/component/modal/ExportAsJcampModal.tsx +++ b/src/component/modal/ExportAsJcampModal.tsx @@ -61,7 +61,7 @@ function ExportAsJcampModal(props: ExportAsJCAMPProps) { function submitHandler(options) { void (async () => { const hideLoading = await alert.showLoading( - 'export as JCAMP in progress', + 'export as JCAMP-DX in progress', ); try { exportAsJcamp(spectrum, options); diff --git a/src/component/panels/SpectrumsPanel/SpectraTable.tsx b/src/component/panels/SpectrumsPanel/SpectraTable.tsx index 700924dd4..b4bd08007 100644 --- a/src/component/panels/SpectrumsPanel/SpectraTable.tsx +++ b/src/component/panels/SpectrumsPanel/SpectraTable.tsx @@ -81,7 +81,7 @@ const Spectra2DContextMenuOptions: ContextMenuItem[] = [ data: { id: SpectraContextMenuOptionsKeys.Delete }, }, { - text: 'Export as jcamp', + text: 'Export as JCAMP-DX', icon: , data: { id: SpectraContextMenuOptionsKeys.ExportAsJcamp }, }, @@ -90,7 +90,7 @@ const Spectra2DContextMenuOptions: ContextMenuItem[] = [ const Spectra1DContextMenuOptions: ContextMenuItem[] = [ ...Spectra2DContextMenuOptions, { - text: 'Export as jcamp', + text: 'Export as JCAMP-DX', icon: , data: { id: SpectraContextMenuOptionsKeys.ExportAsJcamp }, }, diff --git a/src/component/reducer/actions/utilities/__tests__/data/test.json b/src/component/reducer/actions/utilities/__tests__/data/test.json index d047b0e14..8faad9441 100644 --- a/src/component/reducer/actions/utilities/__tests__/data/test.json +++ b/src/component/reducer/actions/utilities/__tests__/data/test.json @@ -1194,13 +1194,13 @@ "format": "" }, { - "label": "Number Of Scan", + "label": "Number of scans", "jpath": ["info", "numberOfScans"], "visible": true, "format": "0" }, { - "label": "Pulse Sequence", + "label": "Pulse sequence", "jpath": ["info", "pulseSequence"], "visible": true, "format": "" diff --git a/src/component/utility/export.ts b/src/component/utility/export.ts index 5929f621e..17b4136be 100644 --- a/src/component/utility/export.ts +++ b/src/component/utility/export.ts @@ -248,6 +248,9 @@ function getBlob( _svg.append(floatingMoleculesGroup); const nmrCss = ` + * { + font-family: Arial, Helvetica, sans-serif; + } .grid line,.grid path{stroke:none;} .peaks-text{fill:#730000} .x path{stroke-width:1px} .x text{ font-size: 12px; font-weight: bold; diff --git a/src/component/workspaces/workspaceDefaultProperties.ts b/src/component/workspaces/workspaceDefaultProperties.ts index 37b8472fd..6a2322d42 100644 --- a/src/component/workspaces/workspaceDefaultProperties.ts +++ b/src/component/workspaces/workspaceDefaultProperties.ts @@ -99,16 +99,16 @@ export const workspaceDefaultProperties: Required = { infoBlock: { visible: false, fields: [ - { label: 'name', jpath: ['info', 'name'], visible: true, format: '' }, + { label: 'Name', jpath: ['info', 'name'], visible: true, format: '' }, { - label: 'Number Of Scan', + label: 'Number of scans', jpath: ['info', 'numberOfScans'], visible: true, format: '0', }, { - label: 'Pulse Sequence', + label: 'Pulse sequence', jpath: ['info', 'pulseSequence'], visible: true, format: '', diff --git a/src/demo/views/CustomWorkspace.tsx b/src/demo/views/CustomWorkspace.tsx index 42bc44484..30edb0bc9 100644 --- a/src/demo/views/CustomWorkspace.tsx +++ b/src/demo/views/CustomWorkspace.tsx @@ -94,16 +94,16 @@ const customWorkspaces: CustomWorkspaces = { infoBlock: { visible: false, fields: [ - { label: 'name', jpath: ['info', 'name'], visible: true, format: '' }, + { label: 'Name', jpath: ['info', 'name'], visible: true, format: '' }, { - label: 'Number Of Scan', + label: 'Number of scans', jpath: ['info', 'numberOfScans'], visible: true, format: '0', }, { - label: 'Pulse Sequence', + label: 'Pulse sequence', jpath: ['info', 'pulseSequence'], visible: true, format: '', diff --git a/src/demo/views/SnapshotView.tsx b/src/demo/views/SnapshotView.tsx index 08f356143..310fee18c 100644 --- a/src/demo/views/SnapshotView.tsx +++ b/src/demo/views/SnapshotView.tsx @@ -389,16 +389,16 @@ const customWorkspaces: CustomWorkspaces = { infoBlock: { visible: false, fields: [ - { label: 'name', jpath: ['info', 'name'], visible: true, format: '' }, + { label: 'Name', jpath: ['info', 'name'], visible: true, format: '' }, { - label: 'Number Of Scan', + label: 'Number of scans', jpath: ['info', 'numberOfScans'], visible: true, format: '0', }, { - label: 'Pulse Sequence', + label: 'Pulse sequence', jpath: ['info', 'pulseSequence'], visible: true, format: '', diff --git a/test-e2e/panels/peaks.test.ts b/test-e2e/panels/peaks.test.ts index c506dce10..ad1a288dd 100644 --- a/test-e2e/panels/peaks.test.ts +++ b/test-e2e/panels/peaks.test.ts @@ -5,10 +5,12 @@ import { test, expect } from '@playwright/test'; import NmriumPage from '../NmriumPage'; import { selectRange } from '../utilities/selectRange'; +const PEAK_ANNOTATIONS_SELECTOR = + '_react=Peaks[peaksSource="peaks"] >> _react=PeakAnnotation'; +const FIRST_PEAK_ANNOTATION_SELECTOR = `${PEAK_ANNOTATIONS_SELECTOR} >> nth=0 >> text`; + async function addPeaks(nmrium: NmriumPage) { - const peaksAnnotationLocator = nmrium.page.locator( - '_react=Peaks[peaksSource="peaks"] >> _react=PeakAnnotation', - ); + const peaksAnnotationLocator = nmrium.page.locator(PEAK_ANNOTATIONS_SELECTOR); // select peak picking tool await nmrium.clickTool('peakPicking'); @@ -38,13 +40,11 @@ async function addPeaks(nmrium: NmriumPage) { } async function shiftX(nmrium: NmriumPage) { - const peakLocator = nmrium.page.locator( - '_react=Peaks[peaksSource="peaks"] >> _react=PeakAnnotation >> nth=0 >> text', - ); + const peakLocator = nmrium.page.locator(FIRST_PEAK_ANNOTATION_SELECTOR); await peakLocator.click(); const peakInputLocator = nmrium.page.locator('_react=PeakEditionField'); - await peakInputLocator.type('10'); + await peakInputLocator.pressSequentially('10'); await peakInputLocator.press('Enter'); await expect(peakLocator).toHaveText('10.00'); @@ -58,28 +58,22 @@ async function shiftSpectraByDeltaColumn(nmrium: NmriumPage) { await ppmColumnLocator.dblclick(); const inputLocator = ppmColumnLocator.locator('input'); await inputLocator.selectText(); - await inputLocator.type('20'); + await inputLocator.fill('20'); await inputLocator.press('Enter'); - const peakInputLocator = nmrium.page.locator( - '_react=Peaks[peaksSource="peaks"] >> _react=PeakAnnotation >> nth=0 >>text', - ); + const peakInputLocator = nmrium.page.locator(FIRST_PEAK_ANNOTATION_SELECTOR); await expect(peakInputLocator).toHaveText('20.00'); } async function deletePeak(nmrium: NmriumPage) { const peakAnnotationLocator = nmrium.page.locator( - '_react=Peaks[peaksSource="peaks"] >> _react=PeakAnnotation >> nth=0', + FIRST_PEAK_ANNOTATION_SELECTOR, ); await peakAnnotationLocator.hover(); await nmrium.page.keyboard.press('Delete'); // Test that the peak deleted - await expect( - nmrium.page.locator( - '_react=Peaks[peaksSource="peaks"] >> _react=PeakAnnotation', - ), - ).toHaveCount(1); + await expect(nmrium.page.locator(PEAK_ANNOTATIONS_SELECTOR)).toHaveCount(1); } test('add/shift/delete peaks', async ({ page }) => { @@ -111,11 +105,7 @@ test('Automatic peak picking should work', async ({ page }) => { //apply auto ranges detection await nmrium.page.click('button >> text=Apply'); - await expect( - nmrium.page.locator( - '_react=Peaks[peaksSource="peaks"] >> _react=PeakAnnotation', - ), - ).toHaveCount(50); + await expect(nmrium.page.locator(PEAK_ANNOTATIONS_SELECTOR)).toHaveCount(50); }); test('Processed spectra peaks', async ({ page }) => { const nmrium = await NmriumPage.create(page); diff --git a/test-e2e/panels/ranges.test.ts b/test-e2e/panels/ranges.test.ts index fd2d68bf0..5ea9a859c 100644 --- a/test-e2e/panels/ranges.test.ts +++ b/test-e2e/panels/ranges.test.ts @@ -25,7 +25,7 @@ async function shiftSignal(nmrium: NmriumPage) { await signalColumnLocator.dblclick(); const inputLocator = signalColumnLocator.locator('input'); await inputLocator.selectText(); - await inputLocator.type('100'); + await inputLocator.fill('100'); await inputLocator.press('Enter'); const trackerLocator = nmrium.page.locator('_react=XAxis >> text=100'); await expect(trackerLocator).toHaveCount(1);