Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cross folder import templates. #1678

Merged
merged 2 commits into from
Jan 4, 2025
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
4 changes: 2 additions & 2 deletions packages/components/package-lock.json

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

2 changes: 1 addition & 1 deletion packages/components/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@labkey/components",
"version": "6.10.0",
"version": "6.10.1",
"description": "Components, models, actions, and utility functions for LabKey applications and pages",
"sideEffects": false,
"files": [
Expand Down
4 changes: 4 additions & 0 deletions packages/components/releaseNotes/components.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# @labkey/components
Components, models, actions, and utility functions for LabKey applications and pages

### version 6.10.1
*Released*: 3 January 2025
- Fix cross folder import templates

### version 6.10.0
*Released*: 30 December 2024
- Customizable File Templates for Sources, Sample Types & Assay Designs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import { SchemaQuery } from '../SchemaQuery';
import { useAppContext } from '../../internal/AppContext';
import { downloadAttachment } from '../../internal/util/utils';
import { DisableableMenuItem } from '../../internal/components/samples/DisableableMenuItem';
import { useServerContext } from '../../internal/components/base/ServerContext';
import { getAppHomeFolderPath } from '../../internal/app/utils';

interface Props {
className?: string;
Expand All @@ -36,6 +38,9 @@ export const TemplateDownloadButton: FC<Props> = memo(props => {
} = props;
const [customTemplates, setCustomTemplates] = useState<ImportTemplate[]>();
const [loadingTemplates, setLoadingTemplates] = useState<boolean>(false);
const { container, moduleContext } = useServerContext();
const homeFolderPath = getAppHomeFolderPath(container, moduleContext);

const { api } = useAppContext();

useEffect(() => {
Expand All @@ -52,6 +57,7 @@ export const TemplateDownloadButton: FC<Props> = memo(props => {
const queryInfo = await api.query.getQueryDetails({
schemaName: schemaQuery.schemaName,
queryName: schemaQuery.queryName,
containerPath: homeFolderPath
});
const customTemplates_ = queryInfo.getCustomTemplates();
setCustomTemplates(customTemplates_);
Expand All @@ -61,7 +67,7 @@ export const TemplateDownloadButton: FC<Props> = memo(props => {
} finally {
setLoadingTemplates(false);
}
}, [schemaQuery, setLoadingTemplates, setCustomTemplates]);
}, [schemaQuery, setLoadingTemplates, setCustomTemplates, homeFolderPath]);

const showDropdown = useMemo(() => {
return customTemplates?.length > 0 || (isGridRenderer && !customTemplates);
Expand Down