Skip to content
Merged
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
12 changes: 6 additions & 6 deletions packages/components/package-lock.json

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

4 changes: 2 additions & 2 deletions packages/components/package.json
Original file line number Diff line number Diff line change
@@ -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": [
Expand Down Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export interface EntityAPIWrapper {
handleEntityFileImport: (
importAction: string,
queryInfo: QueryInfo,
file: File,
file: File | File[],
insertOption: InsertOptions,
useAsync: boolean,
importParameters?: Record<string, any>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, any>,
Expand All @@ -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 => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -123,7 +127,10 @@ const ActivityItem: FC<ActivityItemProps> = 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 (
<li className={className} onClick={onClick}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -63,27 +66,27 @@ export function getServerNotifications(typeLabels?: string[], maxRows?: number):
export function getRunningPipelineJobStatuses(filters?: Filter.IFilter[]): Promise<ServerActivity> {
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,
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/internal/query/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 2 additions & 6 deletions packages/components/src/public/files/FileAttachmentForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,6 @@ export class FileAttachmentForm extends PureComponent<FileAttachmentFormProps, S

this.fileAttachmentContainerRef = React.createRef();

if (props.allowMultiple && props.previewGridProps) {
console.warn('Showing the file preview grid is only supported for single file upload.');
}

this.state = {
attachedFiles: Map<string, File>(),
errorMessage: undefined,
Expand Down Expand Up @@ -147,7 +143,7 @@ export class FileAttachmentForm extends PureComponent<FileAttachmentFormProps, S
const { onFileChange, sizeLimits, fileSpecificCallback, allowMultiple } = this.props;
const { attachedFiles } = this.state;

if (!allowMultiple) {
if (attachedFiles?.size === 1) {
// currently only supporting 1 file for processing contents
const firstFile = attachedFiles.valueSeq().first();
const sizeCheck = fileSizeLimitCompare(firstFile, sizeLimits);
Expand Down Expand Up @@ -241,7 +237,7 @@ export class FileAttachmentForm extends PureComponent<FileAttachmentFormProps, S
}

isShowPreviewGrid = (): boolean => {
return !this.props.allowMultiple && !!this.props.previewGridProps;
return !!this.props.previewGridProps;
};

shouldShowPreviewGrid = (): boolean => {
Expand Down
1 change: 1 addition & 0 deletions packages/components/src/theme/fileupload.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
padding: 20px 0 25px;
text-align: center;
margin-bottom: 0;
white-space: pre-wrap;
}

.file-upload__label--compact {
Expand Down