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

### version 7.??.?
*Released*: ? March 2026
- SchemaQuery.isEqual: add optional includeViewName argument, defaults to true
- UnidentifiedPill: add schemaQuery prop
- EMPTY_SEQUENCE_WARNING renamed to EMPTY_NS_SEQUENCE_WARNING

### version 7.23.1
*Released*: 11 March 2026
- Merge from release26.3-SNAPSHOT to develop
Expand Down
4 changes: 2 additions & 2 deletions packages/components/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ import {
AssayUploadTabs,
DataViewInfoTypes,
EDIT_METHOD,
EMPTY_SEQUENCE_WARNING,
EMPTY_NS_SEQUENCE_WARNING,
EXPORT_TYPES,
GRID_CHECKBOX_OPTIONS,
IMPORT_DATA_FORM_TYPES,
Expand Down Expand Up @@ -1266,7 +1266,7 @@ export {
EditInlineField,
EditorMode,
EditorModel,
EMPTY_SEQUENCE_WARNING,
EMPTY_NS_SEQUENCE_WARNING,
encodeFormDataQuote,
encodePart,
ensureAllFieldsInAllRows,
Expand Down
16 changes: 13 additions & 3 deletions packages/components/src/internal/UnidentifiedPill.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,28 @@ import { createPortal } from 'react-dom';
import { generateId } from './util/utils';
import { useOverlayTriggerState } from './OverlayTrigger';
import { Popover } from './Popover';
import { EMPTY_SEQUENCE_WARNING } from './constants';
import { EMPTY_PS_SEQUENCE_WARNING, EMPTY_NS_SEQUENCE_WARNING } from './constants';
import { SchemaQuery } from '../public/SchemaQuery';
import { SCHEMAS } from './schemas';

export const UnidentifiedPill: FC = () => {
interface Props {
schemaQuery: SchemaQuery;
}

// TODO: take schemaQuery property and use that to determine the appropriate popover content
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO done?

export const UnidentifiedPill: FC<Props> = ({ schemaQuery }) => {
const id = useMemo(() => generateId('unidentified-sequence-overlay-trigger'), []);
// Note: we use useOverlayTriggerState instead of OverlayTrigger because the wrapping div from OverlayTrigger
// causes layout problems.
const { onMouseEnter, onMouseLeave, portalEl, show, targetRef } = useOverlayTriggerState(id, true, false);
const message = schemaQuery.isEqual(SCHEMAS.DATA_CLASSES.PROTEIN_SEQUENCE, false)
? EMPTY_PS_SEQUENCE_WARNING
: EMPTY_NS_SEQUENCE_WARNING;

const popover = useMemo(
() => (
<Popover id="unidentified-sequence-popover" placement="top" targetRef={targetRef}>
<div className="unidentified-sequence-popover">{EMPTY_SEQUENCE_WARNING}</div>
<div className="unidentified-sequence-popover">{message}</div>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add message to dependency array

</Popover>
),
[targetRef]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export const NodeDetailHeader: FC<NodeDetailHeaderProps> = memo(({ model, node,
return (
<DetailHeader header={header} iconSrc={node.iconProps.iconURL}>
{/* Triple eq is important here; we only want false, not falsey values */}
{identified === false && <UnidentifiedPill />}
{identified === false && <UnidentifiedPill schemaQuery={model.schemaQuery} />}
{displayType && <div>{displayType}</div>}
</DetailHeader>
);
Expand Down
184 changes: 93 additions & 91 deletions packages/components/src/internal/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ export const MAX_EDITABLE_GRID_ROWS = MAX_SELECTION_ACTION_ROWS;
export const LOOKUP_DEFAULT_SIZE = 25;

export enum AssayUploadTabs {
Files = 2,
Grid = 1,
Files = 2,
}

export enum EXPORT_TYPES {
Expand All @@ -61,84 +61,85 @@ export enum EDIT_METHOD {
}

export enum KEYS {
Backspace = 8,
Tab = 9,
Enter = 13,
Shift = 16,
Ctrl = 17,
A = 65,
Add = 107,
Alt = 18,
PauseBreak = 19,
CapsLock = 20,
Escape = 27,
Space = 32,
PageUp = 33,
PageDown = 34,
End = 35,
Home = 36,

LeftArrow = 37,
UpArrow = 38,
RightArrow = 39,
DownArrow = 40,

Insert = 45,
Delete = 46,

Zero = 48,
ClosedParen = Zero,
One = 49,
ExclamationMark = One,
Two = 50,
AtSign = Two,
Three = 51,
PoundSign = Three,
Hash = PoundSign,
Four = 52,
DollarSign = Four,
Five = 53,
PercentSign = Five,
Six = 54,
Caret = Six,
Hat = Caret,
Seven = 55,
Ampersand = Seven,
Eight = 56,
Star = Eight,
Asterik = Star,
Nine = 57,
OpenParen = Nine,

A = 65,
Two = 50,
AtSign = Two,
B = 66,
Backspace = 8,
C = 67,
CapsLock = 20,

Six = 54,
Caret = Six,
ClosedBracket = 221,
Zero = 48,

ClosedParen = Zero,
Comma = 188,

Ctrl = 17,
D = 68,
Dash = 189,
DecimalPoint = 110,
Delete = 46,
Divide = 111,
Four = 52,
DollarSign = Four,
DownArrow = 40,
E = 69,
End = 35,
Enter = 13,
Equals = 187,
Escape = 27,
One = 49,
ExclamationMark = One,
F = 70,
F1 = 112,
F2 = 113,
F3 = 114,
F4 = 115,
F5 = 116,
F6 = 117,

F7 = 118,
F8 = 119,
F9 = 120,
F10 = 121,
F11 = 122,
F12 = 123,
FFLeftMetaKey = 224, // Firefox
Five = 53,
ForwardSlash = 191,
G = 71,
Tilde = 192,
GraveAccent = Tilde,
H = 72,
Three = 51,
PoundSign = Three,
Hash = PoundSign,
Hat = Caret,
Home = 36,
I = 73,
Insert = 45,
J = 74,
K = 75,
L = 76,
LeftArrow = 37,
LeftMetaKey = 91,
M = 77,
N = 78,
O = 79,
P = 80,
Q = 81,
R = 82,
S = 83,
T = 84,
U = 85,
V = 86,
W = 87,
X = 88,
Y = 89,
Z = 90,

LeftMetaKey = 91,
RightMetaKey = 92,
SelectKey = 93,
Multiply = 106,
N = 78,
Nine = 57,

NumLock = 144,
Numpad0 = 96,
Numpad1 = 97,
Numpad2 = 98,
Expand All @@ -148,46 +149,45 @@ export enum KEYS {
Numpad6 = 102,
Numpad7 = 103,
Numpad8 = 104,
Numpad9 = 105,

Multiply = 106,
Add = 107,
Subtract = 109,
DecimalPoint = 110,
Divide = 111,
Numpad9 = 105,
O = 79,
OpenBracket = 219,
OpenParen = Nine,
P = 80,

F1 = 112,
F2 = 113,
F3 = 114,
F4 = 115,
F5 = 116,
F6 = 117,
F7 = 118,
F8 = 119,
F9 = 120,
F10 = 121,
F11 = 122,
F12 = 123,
PageDown = 34,
PageUp = 33,
PauseBreak = 19,
PercentSign = Five,
Period = 190,
PlusSign = Equals,
Q = 81,
Quote = 222,
R = 82,
RightArrow = 39,
RightMetaKey = 92,
S = 83,

NumLock = 144,
ScrollLock = 145,
SelectKey = 93,

SemiColon = 186,
Equals = 187,
Comma = 188,
Dash = 189,
Period = 190,
Shift = 16,
Space = 32,
Subtract = 109,
T = 84,
Tab = 9,
U = 85,
UnderScore = Dash,
PlusSign = Equals,
ForwardSlash = 191,
Tilde = 192,
GraveAccent = Tilde,
UpArrow = 38,
V = 86,

OpenBracket = 219,
ClosedBracket = 221,
Quote = 222,
W = 87,
X = 88,
Y = 89,

FFLeftMetaKey = 224, // Firefox
Z = 90,
}

// This is used for filtering search results. Since we first check for search hits containing
Expand Down Expand Up @@ -261,5 +261,7 @@ export const APP_FIELD_CANNOT_BE_REMOVED_MESSAGE = 'This application field canno

export const CELL_SELECTION_HANDLE_CLASSNAME = 'cell-selection-handle';

export const EMPTY_SEQUENCE_WARNING =
export const EMPTY_NS_SEQUENCE_WARNING =
'Without a sequence, Protein sequence translations cannot be done automatically, and the system cannot prevent duplicates.';
export const EMPTY_PS_SEQUENCE_WARNING =
'No sequence added. The structure format and physical properties of molecules using this sequence cannot be calculated.';
7 changes: 3 additions & 4 deletions packages/components/src/internal/util/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -905,9 +905,8 @@ export const isTestEnv = (): boolean => IS_NODE_TEST_ENV || IS_TEST_ENV;

export function hasIdentifiedCol(schemaQuery: SchemaQuery): boolean {
// Drop the viewName from the schemaQuery so we can properly compare
const sqNoView = new SchemaQuery(schemaQuery.schemaName, schemaQuery.queryName);
const isNucSeq = sqNoView.isEqual(SCHEMAS.DATA_CLASSES.NUC_SEQUENCE);
const isProtSeq = sqNoView.isEqual(SCHEMAS.DATA_CLASSES.PROTEIN_SEQUENCE);
const isMolecule = sqNoView.isEqual(SCHEMAS.DATA_CLASSES.MOLECULE);
const isNucSeq = schemaQuery.isEqual(SCHEMAS.DATA_CLASSES.NUC_SEQUENCE, false);
const isProtSeq = schemaQuery.isEqual(SCHEMAS.DATA_CLASSES.PROTEIN_SEQUENCE, false);
const isMolecule = schemaQuery.isEqual(SCHEMAS.DATA_CLASSES.MOLECULE, false);
return isNucSeq || isProtSeq || isMolecule;
}
4 changes: 2 additions & 2 deletions packages/components/src/public/SchemaQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ export class SchemaQuery {
this.viewName = viewName;
}

isEqual(sq: SchemaQuery): boolean {
isEqual(sq: SchemaQuery, includeViewName = true): boolean {
if (!sq) return false;
return this.toString().toLowerCase() === sq.toString().toLowerCase();
return this.toString(includeViewName).toLowerCase() === sq.toString(includeViewName).toLowerCase();
}

hasSchema(schemaName: string): boolean {
Expand Down
Loading