Skip to content

Commit

Permalink
Merge pull request #189 from jetstreamapp/feat/46
Browse files Browse the repository at this point in the history
Set GDrive as default if selected #46
  • Loading branch information
paustint authored Mar 4, 2023
2 parents fff9ea0 + 05db4e3 commit 7301a64
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ export const LoadRecordsSelectObjectAndFile: FunctionComponent<LoadRecordsSelect
<GridCol>
<FileOrGoogleSelector
omitGoogle={!hasGoogleInputConfigured}
initialSelectedTab={hasGoogleInputConfigured && inputFileType === 'google' && inputFilename ? 'google' : 'local'}
fileSelectorProps={{
id: 'load-record-file',
label: 'File to Load',
Expand Down
4 changes: 3 additions & 1 deletion libs/ui/src/lib/form/file-selector/FileOrGoogleSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ export interface FileOrGoogleSelectorProps {
fileSelectorProps: FileSelectorProps;
googleSelectorProps: GoogleFileSelectorProps;
omitGoogle?: boolean;
initialSelectedTab?: 'local' | 'google';
}

export const FileOrGoogleSelector: FunctionComponent<FileOrGoogleSelectorProps> = ({
fileSelectorProps,
googleSelectorProps,
omitGoogle,
initialSelectedTab = 'local',
}) => {
return (
// eslint-disable-next-line react/jsx-no-useless-fragment
Expand All @@ -21,7 +23,7 @@ export const FileOrGoogleSelector: FunctionComponent<FileOrGoogleSelectorProps>
<FileSelector {...fileSelectorProps}></FileSelector>
) : (
<Tabs
initialActiveId="local"
initialActiveId={initialSelectedTab}
tabs={[
{
id: 'local',
Expand Down

0 comments on commit 7301a64

Please sign in to comment.