diff --git a/packages/components/releaseNotes/components.md b/packages/components/releaseNotes/components.md index 4321f482a8..d69977e58e 100644 --- a/packages/components/releaseNotes/components.md +++ b/packages/components/releaseNotes/components.md @@ -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 diff --git a/packages/components/src/index.ts b/packages/components/src/index.ts index 30edb6a55d..fd6d4ffbab 100644 --- a/packages/components/src/index.ts +++ b/packages/components/src/index.ts @@ -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, @@ -1266,7 +1266,7 @@ export { EditInlineField, EditorMode, EditorModel, - EMPTY_SEQUENCE_WARNING, + EMPTY_NS_SEQUENCE_WARNING, encodeFormDataQuote, encodePart, ensureAllFieldsInAllRows, diff --git a/packages/components/src/internal/UnidentifiedPill.tsx b/packages/components/src/internal/UnidentifiedPill.tsx index 4ba3c8f45d..7a5e32f8f9 100644 --- a/packages/components/src/internal/UnidentifiedPill.tsx +++ b/packages/components/src/internal/UnidentifiedPill.tsx @@ -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 +export const UnidentifiedPill: FC = ({ 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( () => ( -
{EMPTY_SEQUENCE_WARNING}
+
{message}
), [targetRef] diff --git a/packages/components/src/internal/components/lineage/node/NodeDetailHeader.tsx b/packages/components/src/internal/components/lineage/node/NodeDetailHeader.tsx index 51ee2dd1bd..da3f37b2b4 100644 --- a/packages/components/src/internal/components/lineage/node/NodeDetailHeader.tsx +++ b/packages/components/src/internal/components/lineage/node/NodeDetailHeader.tsx @@ -59,7 +59,7 @@ export const NodeDetailHeader: FC = memo(({ model, node, return ( {/* Triple eq is important here; we only want false, not falsey values */} - {identified === false && } + {identified === false && } {displayType &&
{displayType}
}
); diff --git a/packages/components/src/internal/constants.ts b/packages/components/src/internal/constants.ts index ded81ccfe7..7b9684f115 100644 --- a/packages/components/src/internal/constants.ts +++ b/packages/components/src/internal/constants.ts @@ -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 { @@ -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, @@ -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 @@ -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.'; diff --git a/packages/components/src/internal/util/utils.ts b/packages/components/src/internal/util/utils.ts index f1efe6d3fd..f4612e111a 100644 --- a/packages/components/src/internal/util/utils.ts +++ b/packages/components/src/internal/util/utils.ts @@ -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; } diff --git a/packages/components/src/public/SchemaQuery.ts b/packages/components/src/public/SchemaQuery.ts index 049ede9b2d..c378c8e313 100644 --- a/packages/components/src/public/SchemaQuery.ts +++ b/packages/components/src/public/SchemaQuery.ts @@ -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 {