Skip to content

Commit

Permalink
Merge branch 'main' into task/WG-427-add-file-modal-to-point-cloud
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanfranklin committed Feb 13, 2025
2 parents 4796013 + 0b9281a commit 8289378
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 37 deletions.
2 changes: 1 addition & 1 deletion react/src/components/AssetsPanel/AssetsPanel.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@

.middleSection > div {
flex: 1;
overflow: auto;
max-height: 95%;
}
62 changes: 37 additions & 25 deletions react/src/components/AssetsPanel/AssetsPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import React, { useState } from 'react';
import styles from './AssetsPanel.module.css';
import FeatureFileTree from '@hazmapper/components/FeatureFileTree';
import { FeatureCollection, Project, TapisFilePath } from '@hazmapper/types';
import { Button } from '@tacc/core-components';
import { Flex, Layout, Button } from 'antd';
import { PlusOutlined } from '@ant-design/icons';
import { useFeatures, useImportFeature } from '@hazmapper/hooks';
import { IMPORTABLE_FEATURE_TYPES } from '@hazmapper/utils/fileUtils';
import FileBrowserModal from '../FileBrowserModal/FileBrowserModal';
Expand Down Expand Up @@ -51,7 +52,11 @@ const DownloadFeaturesButton: React.FC<DownloadFeaturesButtonProps> = ({
});

return (
<Button isLoading={isDownloading} onClick={() => triggerDownload()}>
<Button
loading={isDownloading}
onClick={() => triggerDownload()}
type="primary"
>
Export to GeoJSON
</Button>
);
Expand Down Expand Up @@ -95,30 +100,37 @@ const AssetsPanel: React.FC<Props> = ({
setIsModalOpen(!isModalOpen);
};

const { Content, Header, Footer } = Layout;

return (
<div className={styles.root}>
<div className={styles.topSection}>
<FileBrowserModal
isOpen={isModalOpen}
toggle={toggleModal}
onImported={handleFileImport}
allowedFileExtensions={IMPORTABLE_FEATURE_TYPES}
/>
<Button onClick={toggleModal} type="secondary" iconNameBefore="add">
Import from DesignSafe
</Button>
</div>
<div className={styles.middleSection}>
<FeatureFileTree
projectId={project.id}
isPublicView={isPublicView}
featureCollection={featureCollection}
/>
</div>
<div className={styles.bottomSection}>
<DownloadFeaturesButton project={project} isPublicView={isPublicView} />
</div>
</div>
<>
<Flex vertical className={styles.root} flex={1}>
<Header className={styles.topSection}>
<Button onClick={toggleModal} icon={<PlusOutlined />}>
Import from DesignSafe
</Button>
</Header>
<Content className={styles.middleSection}>
<FeatureFileTree
projectId={project.id}
isPublicView={isPublicView}
featureCollection={featureCollection}
/>
</Content>
<Footer className={styles.bottomSection}>
<DownloadFeaturesButton
project={project}
isPublicView={isPublicView}
/>
</Footer>
</Flex>
<FileBrowserModal
isOpen={isModalOpen}
toggle={toggleModal}
onImported={handleFileImport}
allowedFileExtensions={IMPORTABLE_FEATURE_TYPES}
/>
</>
);
};

Expand Down
2 changes: 1 addition & 1 deletion react/src/components/Panel/Panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const Panel: React.FC<LayoutProps & { panelTitle: string }> = ({

return (
<Layout {...props}>
<Flex vertical className={styles.root}>
<Flex vertical className={styles.root} flex={1}>
<Header className={styles.header}>{panelTitle}</Header>
<Content>{children}</Content>
</Flex>
Expand Down
11 changes: 2 additions & 9 deletions react/src/pages/MapProject/MapProject.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,11 @@
height: 100vh;
}

.container {
.basePanelContainer {
height: calc(
100vh - var(--hazmapper-header-navbar-height) -
100% - var(--hazmapper-header-navbar-height) -
var(--hazmapper-control-bar-height)
);
width: 100%;
display: flex;
flex: 1;
}

.basePanelContainer {
height: 100%;
background-color: var(--global-color-primary--xx-light);
position: fixed;
left: var(--hazmapper-panel-navbar-width);
Expand Down
1 change: 0 additions & 1 deletion react/src/pages/MapProject/MapProject.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,6 @@ const LoadedMapProject: React.FC<LoadedMapProject> = ({
<Sider width="auto">
<Flex
style={{
overflowY: 'auto',
height: '100%',
}}
>
Expand Down

0 comments on commit 8289378

Please sign in to comment.