Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
6dced92
update API call controller and actions and update params to match new…
cnathe Dec 13, 2023
779674c
2.396.3-fb-moveRowsAPI.0
cnathe Dec 13, 2023
d260842
jest snapshot update
cnathe Dec 13, 2023
12b8590
Merge branch 'develop' into fb_moveRowsAPI
cnathe Dec 13, 2023
26b3ea8
2.397.1-fb-moveRowsAPI.0
cnathe Dec 13, 2023
4a9c319
2.397.1-fb-moveRowsAPI.0
cnathe Dec 13, 2023
fb9b83d
Merge branch 'develop' into fb_moveRowsAPI
cnathe Dec 13, 2023
d02d2b0
2.397.2-fb-moveRowsAPI.0
cnathe Dec 13, 2023
0411497
Update move controller/action for data classes / sources
cnathe Dec 13, 2023
b200d25
2.397.2-fb-moveRowsAPI.1
cnathe Dec 13, 2023
a0df35b
Update move controller/action for assay runs
cnathe Dec 13, 2023
36eabec
2.397.2-fb-moveRowsAPI.2
cnathe Dec 13, 2023
95647e1
Remove EntityDataType moveControllerName and moveActionName
cnathe Dec 13, 2023
a63009b
2.397.2-fb-moveRowsAPI.3
cnathe Dec 13, 2023
3969414
Convert DataClassDesigner jest test from enzyme to RTL
cnathe Dec 14, 2023
9d916f1
Clean up some jest output noise
cnathe Dec 14, 2023
7d548f4
fix comment typo
cnathe Dec 14, 2023
29b6cf2
Merge branch 'develop' into fb_moveRowsAPI
cnathe Dec 15, 2023
5969229
2.398.0-fb-moveRowsAPI.0
cnathe Dec 15, 2023
7c4301c
update moveRows api param names
cnathe Dec 15, 2023
02d4eb1
2.398.0-fb-moveRowsAPI.1
cnathe Dec 15, 2023
80302e3
npm run lint-branch-fix
cnathe Dec 15, 2023
8622901
Update release notes with version number and release date
cnathe Dec 15, 2023
d457e13
2.399.0
cnathe Dec 15, 2023
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
4 changes: 2 additions & 2 deletions packages/components/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/components/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@labkey/components",
"version": "2.398.0",
"version": "2.399.0",
"description": "Components, models, actions, and utility functions for LabKey applications and pages",
"sideEffects": false,
"files": [
Expand Down
5 changes: 5 additions & 0 deletions packages/components/releaseNotes/components.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# @labkey/components
Components, models, actions, and utility functions for LabKey applications and pages.

### version 2.399.0
*Released*: 15 December 2023
- Consolidate move entities to MoveRowsAction in query controller
- update API call controller and actions and update params to match new moveRows API format

### version 2.398.0
*Released*: 14 December 2023
- In-app messaging for product updates
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,10 @@ describe('Grid', () => {
});

describe('GridHeader', () => {
beforeAll(() => {
global.console.error = jest.fn();
});

const DEFAULT_PROPS = {
showHeader: true,
columns: List.of(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -727,8 +727,6 @@ exports[`AssayDesignerPanels appPropertiesOnly for new assay 1`] = `
"schemaName": "exp",
"viewName": undefined,
},
"moveActionName": "moveAssayRuns",
"moveControllerName": "assay",
"nounAsParentPlural": "Assay Runs",
"nounAsParentSingular": "Assay Run",
"nounPlural": "runs",
Expand Down Expand Up @@ -2564,8 +2562,6 @@ exports[`AssayDesignerPanels appPropertiesOnly with initModel 1`] = `
"schemaName": "exp",
"viewName": undefined,
},
"moveActionName": "moveAssayRuns",
"moveControllerName": "assay",
"nounAsParentPlural": "Assay Runs",
"nounAsParentSingular": "Assay Run",
"nounPlural": "runs",
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
import React from 'react';
import { act, screen } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import { List } from 'immutable';

import { getTestAPIWrapper } from '../../../APIWrapper';
import { renderWithAppContext } from '../../../test/reactTestLibraryHelpers';

import { PROPERTIES_PANEL_ERROR_MSG } from '../constants';
import getDomainDetailsJSON from '../../../../test/data/dataclass-getDomainDetails.json';

import { DataClassModel } from './models';
import { DataClassDesigner, DataClassDesignerImpl } from './DataClassDesigner';

const BASE_PROPS = {
api: getTestAPIWrapper(jest.fn),
onComplete: jest.fn(),
onCancel: jest.fn(),
loadNameExpressionOptions: jest.fn(async () => ({ prefix: '', allowUserSpecifiedNames: true })),
testMode: true,
};

describe('DataClassDesigner', () => {
beforeAll(() => {
global.console.error = jest.fn();
});

test('default properties', async () => {
const component = (
<DataClassDesignerImpl
{...BASE_PROPS}
currentPanelIndex={0}
firstState={true}
onFinish={jest.fn()}
onTogglePanel={jest.fn()}
setSubmitting={jest.fn()}
submitting={false}
validatePanel={0}
visitedPanels={List()}
/>
);
await act(async () => {
const { container } = renderWithAppContext(component);
expect(container).toMatchSnapshot();
});

expect(document.querySelectorAll('#dataclass-properties-hdr').length).toBe(1);
expect(document.querySelectorAll('.domain-form-panel').length).toBe(2);
expect(screen.getByText('Import or infer fields from file')).toBeInTheDocument();
});

test('custom properties', async () => {
const component = (
<DataClassDesignerImpl
{...BASE_PROPS}
nounSingular="Source"
nounPlural="Sources"
nameExpressionInfoUrl="https://www.labkey.org/Documentation"
nameExpressionPlaceholder="name expression placeholder test"
headerText="header text test"
appPropertiesOnly={true}
saveBtnText="Finish it up"
currentPanelIndex={0}
firstState={true}
onFinish={jest.fn()}
onTogglePanel={jest.fn()}
setSubmitting={jest.fn()}
submitting={false}
validatePanel={0}
visitedPanels={List()}
/>
);
await act(async () => {
const { container } = renderWithAppContext(component);
expect(container).toMatchSnapshot();
});

expect(document.querySelectorAll('#dataclass-properties-hdr').length).toBe(1);
expect(document.querySelectorAll('.domain-form-panel').length).toBe(2);
expect(screen.getByText('Import or infer fields from file')).toBeInTheDocument();
});

test('initModel', async () => {
const component = (
<DataClassDesignerImpl
{...BASE_PROPS}
initModel={DataClassModel.create(getDomainDetailsJSON)}
currentPanelIndex={0}
firstState={true}
onFinish={jest.fn()}
onTogglePanel={jest.fn()}
setSubmitting={jest.fn()}
submitting={false}
validatePanel={0}
visitedPanels={List()}
/>
);
await act(async () => {
const { container } = renderWithAppContext(component);
expect(container).toMatchSnapshot();
});

expect(document.querySelectorAll('#dataclass-properties-hdr').length).toBe(1);
expect(document.querySelectorAll('.domain-form-panel').length).toBe(2);
expect(screen.queryByText('Import or infer fields from file')).not.toBeInTheDocument();
});

test('open fields panel', async () => {
const component = <DataClassDesigner {...BASE_PROPS} />;
await act(async () => {
renderWithAppContext(component);
});

let panelHeader = document.querySelector('div#domain-header');
expect(panelHeader?.classList.contains('domain-panel-header-collapsed')).toBeTruthy();
expect(panelHeader?.classList.contains('domain-panel-header-expanded')).toBeFalsy();
userEvent.click(panelHeader);

panelHeader = document.querySelector('div#domain-header');
expect(panelHeader?.classList.contains('domain-panel-header-collapsed')).toBeFalsy();
expect(panelHeader?.classList.contains('domain-panel-header-expanded')).toBeTruthy();
expect(screen.queryByText('Import or infer fields from file')).toBeInTheDocument();
expect(document.querySelectorAll('.domain-system-fields').length).toBe(1);

expect(document.querySelectorAll('.alert').length).toBe(2);
expect(screen.queryByText(PROPERTIES_PANEL_ERROR_MSG)).toBeInTheDocument();
expect(screen.queryByText('Please correct errors in the properties panel before saving.')).toBeInTheDocument();
});
});
Loading