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

Task/WG 411 Questionnaire Modal #306

Merged
merged 7 commits into from
Jan 24, 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
23 changes: 22 additions & 1 deletion react/package-lock.json

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

2 changes: 2 additions & 0 deletions react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,13 @@
"@tacc/core-styles": "^2.37.2",
"@tanstack/react-query": "^5.64.1",
"@turf/turf": "^7.2.0",
"@types/jquery": "^3.5.32",
"antd": "^5.23.1",
"axios": "^1.7.9",
"chonky": "^2.3.2",
"dompurify": "^3.2.3",
"formik": "^2.4.6",
"jquery": "^3.7.1",
"jwt-decode": "^4.0.0",
"leaflet": "^1.9.4",
"leaflet.markercluster": "^1.5.3",
Expand Down
7 changes: 5 additions & 2 deletions react/src/components/AssetDetail/AssetButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@ type AssetButtonProps = {
selectedFeature: Feature;
featureSource: string;
isPublicView: boolean;
onQuestionnaireClick?: () => void;
};

const AssetButton: React.FC<AssetButtonProps> = ({
selectedFeature,
featureSource,
isPublicView,
onQuestionnaireClick,
}) => {
const pointCloudURL = DOMPurify.sanitize(featureSource + '/index.html');

Expand All @@ -30,8 +32,9 @@ const AssetButton: React.FC<AssetButtonProps> = ({
</a>
)}
{featureType === FeatureType.Questionnaire && (
//TODO
<Button type="primary">View</Button>
<Button type="primary" onClick={onQuestionnaireClick}>
View
</Button>
)}
{featureType.includes(selectedFeature.geometry.type) && isPublicView && (
//TODO
Expand Down
1 change: 1 addition & 0 deletions react/src/components/AssetDetail/AssetDetail.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ describe('AssetDetail', () => {
onClose: jest.fn(),
selectedFeature: mockImgFeature,
isPublicView: false,
onQuestionnaireClick: jest.fn(),
};

it('renders all main components', async () => {
Expand Down
7 changes: 5 additions & 2 deletions react/src/components/AssetDetail/AssetDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,18 @@ import { FeatureIcon } from '@hazmapper/components/FeatureIcon';
import { Button, LoadingSpinner } from '@tacc/core-components';
import styles from './AssetDetail.module.css';

type AssetModalProps = {
type AssetDetailProps = {
onClose: () => void;
selectedFeature: Feature;
isPublicView: boolean;
onQuestionnaireClick;
};

const AssetDetail: React.FC<AssetModalProps> = ({
const AssetDetail: React.FC<AssetDetailProps> = ({
selectedFeature,
onClose,
isPublicView,
onQuestionnaireClick,
}) => {
const config = useAppConfiguration();
const geoapiUrl = config.geoapiUrl;
Expand Down Expand Up @@ -61,6 +63,7 @@ const AssetDetail: React.FC<AssetModalProps> = ({
selectedFeature={selectedFeature}
featureSource={featureSource}
isPublicView={isPublicView}
onQuestionnaireClick={onQuestionnaireClick}
/>
</Suspense>
</div>
Expand Down
Loading
Loading