Skip to content

Commit

Permalink
Task/WG 411 Questionnaire Modal (#306)
Browse files Browse the repository at this point in the history
* Initial commit
- Lifts questionnaireBuilder directly from angular
- Only change is the way newer version of uuid imports uuidv4

* - Adds questionnaire functionality to existing components

* Source of truth for questionnaireBuilder

* - Adds questionnaireBuilder and component
 - styles, hooks, and package imports

* - Updates linting, prettier, and ts ignore
to questionnaireBuilder

* - Fixing merge ommission
  • Loading branch information
sophia-massie authored Jan 24, 2025
1 parent 7e289e6 commit fd4a82e
Show file tree
Hide file tree
Showing 12 changed files with 4,048 additions and 7 deletions.
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

0 comments on commit fd4a82e

Please sign in to comment.