Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
3 changes: 3 additions & 0 deletions packages/components/releaseNotes/components.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# @labkey/components
Components, models, actions, and utility functions for LabKey applications and pages

### version TBD
- Remove support for discussions in lists

### version 7.5.1
*Released*: 24 December 2025
- Add `displaySelectedOptions` prop and respect setting when passing `selectedOptions` to the underlying `SelectInput`
Expand Down
1 change: 0 additions & 1 deletion packages/components/src/internal/app/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ export const EXPERIMENTAL_PRODUCT_ALL_FOLDER_LOOKUPS = 'queryProductAllFolderLoo
export const EXPERIMENTAL_PRODUCT_FOLDER_DATA_LISTING_SCOPED = 'queryProductProjectDataListingScoped';
export const EXPERIMENTAL_REQUESTS_MENU = 'experimental-biologics-requests-menu';
export const EXPERIMENTAL_SAMPLE_ALIQUOT_SELECTOR = 'experimental-sample-aliquot-selector';
export const DEPRECATED_OBJECT_LEVEL_DISCUSSIONS = 'deprecatedObjectLevelDiscussions';

export const FOLDER_DATA_TYPE_EXCLUSIONS = 'dataTypeExclusions';
export const ARCHIVED_FOLDERS = 'archivedContainers';
Expand Down
5 changes: 0 additions & 5 deletions packages/components/src/internal/app/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import {
ARCHIVED_FOLDERS,
ASSAYS_KEY,
BIOLOGICS_APP_PROPERTIES,
DEPRECATED_OBJECT_LEVEL_DISCUSSIONS,
EXPERIMENTAL_PRODUCT_ALL_FOLDER_LOOKUPS,
EXPERIMENTAL_PRODUCT_FOLDER_DATA_LISTING_SCOPED,
EXPERIMENTAL_REQUESTS_MENU,
Expand Down Expand Up @@ -417,10 +416,6 @@ export function isSampleAliquotSelectorEnabled(moduleContext?: ModuleContext): b
return resolveModuleContext(moduleContext)?.samplemanagement?.[EXPERIMENTAL_SAMPLE_ALIQUOT_SELECTOR] === true;
}

export function isObjectLevelDiscussionsEnabled(moduleContext?: ModuleContext): boolean {
return resolveModuleContext(moduleContext)?.core?.[DEPRECATED_OBJECT_LEVEL_DISCUSSIONS] === true;
}

export function hasModule(moduleName: string, moduleContext?: ModuleContext): boolean {
return resolveModuleContext(moduleContext).api?.moduleNames?.indexOf(moduleName.toLowerCase()) >= 0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,13 @@ import getDomainDetailsJSON from '../../../../test/data/list-getDomainDetails.js

import { DomainField } from '../models';

import { AdvancedSettings, DisplayTitle, SearchIndexing, IndexField } from './ListPropertiesAdvancedSettings';
import { AdvancedSettings, DisplayTitle, IndexField, SearchIndexing } from './ListPropertiesAdvancedSettings';
import { ListModel } from './models';

const emptyNewModel = ListModel.create(null, DEFAULT_LIST_SETTINGS);
const populatedExistingModel = ListModel.create(getDomainDetailsJSON);

describe('AdvancedSettings', () => {
beforeEach(() => {
LABKEY.moduleContext = {
core: {
deprecatedObjectLevelDiscussions: false,
},
};
});

test('default properties', () => {
const advancedSettings = (
<AdvancedSettings title="Advanced Settings" model={emptyNewModel} applyAdvancedProperties={jest.fn()} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import classNames from 'classnames';

import { Modal } from '../../../Modal';

import { getSubmitButtonClass, isObjectLevelDiscussionsEnabled } from '../../../app/utils';
import { getSubmitButtonClass } from '../../../app/utils';

import { DomainFieldLabel } from '../DomainFieldLabel';

Expand Down Expand Up @@ -33,8 +33,6 @@ export const DISPLAY_TITLE_TIP = (
</ul>
</>
);
export const DISCUSSION_LINKS_TIP =
'Optionally allow one or more discussion links to be shown on the details view of each list item.';
export const SEARCH_INDEXING_TIP = 'Controls how this list is indexed for search within LabKey Server.';

interface DisplayTitleProps {
Expand Down Expand Up @@ -66,45 +64,6 @@ export const DisplayTitle: FC<DisplayTitleProps> = memo(({ model, onSelectChange
});
DisplayTitle.displayName = 'DisplayTitle';

interface DiscussionLinksProps {
discussionSetting: number;
onRadioChange: (evt: any) => void;
}

// TODO: use RadioGroupInput instead
const DISCUSSION_RADIO_NAME = 'discussionSetting';
const DiscussionInputs: FC<DiscussionLinksProps> = memo(({ onRadioChange, discussionSetting }) => (
<div className="form-group">
<DomainDesignerRadio
name={DISCUSSION_RADIO_NAME}
value={0}
checked={discussionSetting === 0}
onChange={onRadioChange}
>
Disable discussions
</DomainDesignerRadio>

<DomainDesignerRadio
name={DISCUSSION_RADIO_NAME}
value={1}
checked={discussionSetting === 1}
onChange={onRadioChange}
>
Allow one discussion per item
</DomainDesignerRadio>

<DomainDesignerRadio
name={DISCUSSION_RADIO_NAME}
value={2}
checked={discussionSetting === 2}
onChange={onRadioChange}
>
Allow multiple discussions per item
</DomainDesignerRadio>
</div>
));
DiscussionInputs.displayName = 'DiscussionInputs';

interface TitleIndexFieldProps {
name: string;
onInputChange: (evt: any) => void;
Expand Down Expand Up @@ -435,7 +394,6 @@ export class AdvancedSettings extends React.PureComponent<AdvancedSettingsProps,

return {
titleColumn: model.titleColumn,
discussionSetting: model.discussionSetting,
fileAttachmentIndex: model.fileAttachmentIndex,

// entire list
Expand Down Expand Up @@ -503,7 +461,6 @@ export class AdvancedSettings extends React.PureComponent<AdvancedSettingsProps,
render(): ReactNode {
const {
modalOpen,
discussionSetting,
fileAttachmentIndex,
entireListIndex,
entireListTitleTemplate,
Expand Down Expand Up @@ -568,15 +525,6 @@ export class AdvancedSettings extends React.PureComponent<AdvancedSettingsProps,
/>
</SettingsContainer>

{isObjectLevelDiscussionsEnabled() && (
<SettingsContainer title="Discussion Threads" tipBody={DISCUSSION_LINKS_TIP}>
<DiscussionInputs
onRadioChange={this.onRadioChange}
discussionSetting={discussionSetting}
/>
</SettingsContainer>
)}

<SettingsContainer title="Search Indexing Options" tipBody={SEARCH_INDEXING_TIP}>
<SearchIndexing
onRadioChange={this.onRadioChange}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ describe('ListModel', () => {
expect(options).not.toHaveProperty('domain');
expect(options).toHaveProperty('name');
expect(options).toHaveProperty('description');
expect(options).toHaveProperty('discussionSetting');

const PKFieldName = existingModel
.getIn(['domain', 'fields'])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ export interface EntireListSettings {
}

export interface AdvancedSettingsForm extends EachItemSettings, EntireListSettings {
discussionSetting: number;
eachItemIndex: boolean;
entireListIndex: boolean;
fileAttachmentIndex: boolean;
Expand All @@ -60,7 +59,6 @@ export class ListModel extends Record({
titleColumn: undefined,
domainId: undefined,
keyType: undefined,
discussionSetting: undefined,
allowDelete: undefined,
allowUpload: undefined,
allowExport: undefined,
Expand All @@ -75,7 +73,6 @@ export class ListModel extends Record({
eachItemBodyTemplate: undefined,
fileAttachmentIndex: undefined,
listId: undefined,
discussionSettingEnum: undefined,
containerPath: undefined,
category: undefined,
}) {
Expand All @@ -89,7 +86,6 @@ export class ListModel extends Record({
declare titleColumn: string;
declare domainId: number;
declare keyType: string;
declare discussionSetting: number;
declare allowDelete: true;
declare allowUpload: true;
declare allowExport: true;
Expand All @@ -104,7 +100,6 @@ export class ListModel extends Record({
declare eachItemBodyTemplate: string;
declare fileAttachmentIndex: false;
declare listId: number;
declare discussionSettingEnum: string;
declare containerPath: string;
declare category: string;

Expand Down
1 change: 0 additions & 1 deletion packages/components/src/test/data/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ export const DEFAULT_LIST_SETTINGS = {
allowDelete: true,
allowUpload: true,
allowExport: true,
discussionSetting: 0,
entireListTitleTemplate: '',
entireListIndexSetting: 0,
entireListBodySetting: 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@
"allowDelete" : true,
"allowUpload" : true,
"allowExport" : true,
"discussionSetting" : 0,
"entireListTitleTemplate" : null,
"entireListIndexSetting" : 0,
"entireListBodySetting" : 0,
Expand Down
2 changes: 0 additions & 2 deletions packages/components/src/test/data/list-getDomainDetails.json
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,6 @@
"listId" : 277,
"domainId" : 2280,
"keyType" : "Integer",
"discussionSetting" : 1,
"allowDelete" : true,
"allowUpload" : true,
"allowExport" : true,
Expand All @@ -703,7 +702,6 @@
"eachItemBodySetting" : 0,
"eachItemBodyTemplate" : null,
"fileAttachmentIndex" : false,
"discussionSettingEnum" : "OnePerItem",
"entireListIndexSettingEnum" : "MetaData",
"entireListTitleSettingEnum" : "Standard",
"entireListBodySettingEnum" : "AllFields",
Expand Down