diff --git a/packages/components/package-lock.json b/packages/components/package-lock.json index 0bac7f005b..de761edc47 100644 --- a/packages/components/package-lock.json +++ b/packages/components/package-lock.json @@ -1,16 +1,16 @@ { "name": "@labkey/components", - "version": "7.46.1", + "version": "7.46.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@labkey/components", - "version": "7.46.1", + "version": "7.46.2", "license": "SEE LICENSE IN LICENSE.txt", "dependencies": { "@hello-pangea/dnd": "18.0.1", - "@labkey/api": "1.52.1", + "@labkey/api": "1.52.2", "@testing-library/dom": "~10.4.1", "@testing-library/jest-dom": "~6.9.1", "@testing-library/react": "~16.3.2", @@ -3775,9 +3775,9 @@ } }, "node_modules/@labkey/api": { - "version": "1.52.1", - "resolved": "https://labkey.jfrog.io/artifactory/api/npm/libs-client/@labkey/api/-/@labkey/api-1.52.1.tgz", - "integrity": "sha512-SgRJW7a4Vdf5tQgUTtJvA114PJ8BH8xG+0xKH/NiRBE8SiGQDGg+lS1w0tFD89shaoyBWbep2Y2qR91eexkrXQ==", + "version": "1.52.2", + "resolved": "https://labkey.jfrog.io/artifactory/api/npm/libs-client/@labkey/api/-/@labkey/api-1.52.2.tgz", + "integrity": "sha512-LhzL5wwov5cXDm0pUvc5BHDq2qFeNjc9R3Xwa8aNlj1aJoBYC2yV1T9A4h/cVnPqcXgTgqKQTD04IkZ8bOgEvg==", "license": "Apache-2.0" }, "node_modules/@labkey/build": { diff --git a/packages/components/package.json b/packages/components/package.json index 6b1680265f..19780df2e7 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -1,6 +1,6 @@ { "name": "@labkey/components", - "version": "7.46.1", + "version": "7.46.2", "description": "Components, models, actions, and utility functions for LabKey applications and pages", "sideEffects": false, "files": [ @@ -48,7 +48,7 @@ "homepage": "https://github.com/LabKey/labkey-ui-components#readme", "dependencies": { "@hello-pangea/dnd": "18.0.1", - "@labkey/api": "1.52.1", + "@labkey/api": "1.52.2", "@testing-library/dom": "~10.4.1", "@testing-library/jest-dom": "~6.9.1", "@testing-library/react": "~16.3.2", diff --git a/packages/components/src/internal/components/entities/APIWrapper.ts b/packages/components/src/internal/components/entities/APIWrapper.ts index 72ca9c6fe7..8b1719165a 100644 --- a/packages/components/src/internal/components/entities/APIWrapper.ts +++ b/packages/components/src/internal/components/entities/APIWrapper.ts @@ -106,7 +106,7 @@ export interface EntityAPIWrapper { handleEntityFileImport: ( importAction: string, queryInfo: QueryInfo, - file: File, + file: File | File[], insertOption: InsertOptions, useAsync: boolean, importParameters?: Record, diff --git a/packages/components/src/internal/components/entities/actions.ts b/packages/components/src/internal/components/entities/actions.ts index df9edbcd90..e5c68622a5 100644 --- a/packages/components/src/internal/components/entities/actions.ts +++ b/packages/components/src/internal/components/entities/actions.ts @@ -711,7 +711,7 @@ export async function deleteEntityType( export function handleEntityFileImport( importAction: string, queryInfo: QueryInfo, - file: File, + file: File | File[], insertOption: InsertOptions, useAsync: boolean, importParameters?: Record, @@ -738,7 +738,7 @@ export function handleEntityFileImport( if (response.success) { resolve(response); } else { - reject({ msg: response.errors._form }); + reject({ msg: response.errors?._form ?? response.exception }); } }) .catch(error => { diff --git a/packages/components/src/internal/components/notifications/ServerActivityList.tsx b/packages/components/src/internal/components/notifications/ServerActivityList.tsx index 02b1136dda..82e2b4c321 100644 --- a/packages/components/src/internal/components/notifications/ServerActivityList.tsx +++ b/packages/components/src/internal/components/notifications/ServerActivityList.tsx @@ -25,6 +25,10 @@ const defaultActionLinkText = 'View details'; function resolveActionLinkUrl(url: string, rowId: number): string | AppURL { if (!url) return undefined; + + if (url === '#' && !!rowId) + return "#/pipeline/" + rowId; + const resolvedUrl = PIPELINE_MAPPER.resolve(url, Map({ rowId, url }), undefined, undefined, undefined); if (resolvedUrl instanceof AppURL) return resolvedUrl; @@ -123,7 +127,10 @@ const ActivityItem: FC = memo(({ data, onRead, onViewClick }) }); const actionLinkText = capitalizeFirstChar(data.ActionLinkText ? data.ActionLinkText : defaultActionLinkText); - const onClick = useCallback(() => onRead(rowId), [onRead, rowId]); + const onClick = useCallback(() => { + if (!data.inProgress) + onRead(rowId) + }, [onRead, rowId, data]); return (
  • diff --git a/packages/components/src/internal/components/notifications/actions.ts b/packages/components/src/internal/components/notifications/actions.ts index b959489129..c0b9b8880d 100644 --- a/packages/components/src/internal/components/notifications/actions.ts +++ b/packages/components/src/internal/components/notifications/actions.ts @@ -6,9 +6,12 @@ import { ActionURL, Ajax, Filter, Query, Utils } from '@labkey/api'; import { buildURL } from '../../url/AppURL'; import { resolveErrorMessage } from '../../util/messaging'; -import { getContainerFilter, selectRowsDeprecated } from '../../query/api'; +import { getContainerFilter } from '../../query/api'; +import { selectRows } from '../../query/selectRows'; +import { SchemaQuery } from '../../../public/SchemaQuery'; import { ServerActivity, ServerActivityData } from './model'; +import { caseInsensitive } from '../../util/utils'; /** * Used to notify the server that the trial banner has been dismissed @@ -63,27 +66,27 @@ export function getServerNotifications(typeLabels?: string[], maxRows?: number): export function getRunningPipelineJobStatuses(filters?: Filter.IFilter[]): Promise { const statusFilter = Filter.create('Status', ['RUNNING', 'WAITING', 'SPLITWAITING'], Filter.Types.IN); return new Promise((resolve, reject) => { - selectRowsDeprecated({ - schemaName: 'pipeline', - queryName: 'job', + selectRows({ + schemaQuery: new SchemaQuery('pipeline', 'job'), filterArray: [statusFilter].concat(filters ?? []), sort: 'Created', includeTotalCount: true, + includeMetadata: true, }) .then(response => { - const model = response.models[response.key]; - const activities = []; - Object.values(model).forEach(row => { - activities.push( + const activities = response.rows.map( + row => new ServerActivityData({ + ActionLinkUrl: '#', + ActionLinkText: 'View Import', + RowId: caseInsensitive(row, 'rowId').value, inProgress: true, - Content: row['Description']['value'], + Content: caseInsensitive(row, 'Description').value, ContentType: 'text/plain', - Created: row['Created']['formattedValue'], - CreatedBy: row['CreatedBy']['displayValue'], + Created: caseInsensitive(row, 'Created').formattedValue, + CreatedBy: caseInsensitive(row, 'CreatedBy').displayValue, }) - ); - }); + ); resolve({ data: activities, totalRows: response.rowCount, diff --git a/packages/components/src/internal/query/api.ts b/packages/components/src/internal/query/api.ts index 69195d5302..eb4a9719e7 100644 --- a/packages/components/src/internal/query/api.ts +++ b/packages/components/src/internal/query/api.ts @@ -1126,7 +1126,7 @@ export enum InsertFormats { export interface IImportData { auditUserComment?: string; - file?: File; + file?: File | File[]; // must contain file or text but not both format?: InsertFormats; importLookupByAlternateKey?: boolean; diff --git a/packages/components/src/public/files/FileAttachmentForm.tsx b/packages/components/src/public/files/FileAttachmentForm.tsx index 9d2951ed40..5a9331fe18 100644 --- a/packages/components/src/public/files/FileAttachmentForm.tsx +++ b/packages/components/src/public/files/FileAttachmentForm.tsx @@ -97,10 +97,6 @@ export class FileAttachmentForm extends PureComponent(), errorMessage: undefined, @@ -147,7 +143,7 @@ export class FileAttachmentForm extends PureComponent { - return !this.props.allowMultiple && !!this.props.previewGridProps; + return !!this.props.previewGridProps; }; shouldShowPreviewGrid = (): boolean => { diff --git a/packages/components/src/theme/fileupload.scss b/packages/components/src/theme/fileupload.scss index 08d01e6b53..affd32f979 100644 --- a/packages/components/src/theme/fileupload.scss +++ b/packages/components/src/theme/fileupload.scss @@ -22,6 +22,7 @@ padding: 20px 0 25px; text-align: center; margin-bottom: 0; + white-space: pre-wrap; } .file-upload__label--compact {