Skip to content

Commit

Permalink
Merge pull request #97 from buildingSMART/IVS_103_Embed_Feedback_Form
Browse files Browse the repository at this point in the history
IVS-103 Embed feedback form
  • Loading branch information
rw-bsi authored Sep 6, 2024
2 parents f294862 + e3f9622 commit 4d938b9
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 8 deletions.
24 changes: 24 additions & 0 deletions frontend/package-lock.json

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

3 changes: 2 additions & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bsi-valsvc-ui",
"description": "WebUI of the bSI Validation Service",
"description": "WebUI of the bSI Validation Service",
"author": "buildingSMART International Ltd.",
"license": "MIT",
"private": true,
Expand All @@ -15,6 +15,7 @@
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
"@typeform/embed-react": "^4.1.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^6.4.3",
Expand Down
15 changes: 10 additions & 5 deletions frontend/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ import Grid from '@mui/material/Grid';
import Box from '@mui/material/Box';
import SideMenu from './SideMenu';
import VerticalLinearStepper from './VerticalLinearStepper'
import FeedbackWidget from './FeedbackWidget';

import { useEffect, useState } from 'react';
import { FETCH_PATH } from './environment'
import { FETCH_PATH } from './environment';

import {PageContext} from './Page';
import { useContext } from 'react';
Expand All @@ -23,7 +24,7 @@ function App() {
const [user, setUser] = useState(null)

const [prTitle, setPrTitle] = useState("")

useEffect(() => {
fetch(context.sandboxId ? `${FETCH_PATH}/api/sandbox/me/${context.sandboxId}` : `${FETCH_PATH}/api/me`, { credentials: 'include' })
.then(response => response.json())
Expand All @@ -43,6 +44,7 @@ function App() {

document.body.style.overflow = "hidden";
if (isLoggedIn) {

return (
<div class="home">
<Grid direction="column"
Expand All @@ -59,7 +61,7 @@ function App() {
}}
>
<SideMenu />

<Grid
container
flex={1}
Expand Down Expand Up @@ -124,7 +126,7 @@ function App() {
<VerticalLinearStepper />
</Box>
</Box>

<div style={{alignSelf:"start", backgroundColor: '#ffffffe0', padding: '0.5em 5em', boxSizing: 'border-box', borderTop: 'thin solid rgb(238, 238, 238)', width: '100%'}}>
<Typography style={{fontWeight: 'bold'}} sx={{paddingTop: '2em'}}>What it is</Typography>
<Typography align='left' paragraph>The bSI Validation Service is a free, online platform for validating IFC files, developed by buildingSMART – with the help of software vendors and bSI projects.</Typography>
Expand Down Expand Up @@ -163,10 +165,13 @@ function App() {

<Footer/>
</div>

</Grid>
</div>
</Grid>

<FeedbackWidget user={user} />

</Grid>
</Grid>
</div>
Expand Down
6 changes: 5 additions & 1 deletion frontend/src/Dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import Dz from './Dz'
import ResponsiveAppBar from './ResponsiveAppBar'
import DashboardTable from './DashboardTable'
import Disclaimer from './Disclaimer';
import Footer from './Footer'
import Footer from './Footer';
import FeedbackWidget from './FeedbackWidget';
import Grid from '@mui/material/Grid';
import VerticalLinearStepper from './VerticalLinearStepper'
import Button from '@mui/material/Button';
Expand Down Expand Up @@ -126,6 +127,9 @@ function Dashboard() {
</div>
</Grid>
</Grid>

<FeedbackWidget user={user} />

</Grid>
</div>
);
Expand Down
22 changes: 22 additions & 0 deletions frontend/src/FeedbackWidget.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { Sidetab } from '@typeform/embed-react';
import { VERSION, COMMIT_HASH } from './environment'

function FeedbackWidget({ user }) {

// Typeform widget
return (

<Sidetab
id="cttcZ07p"
medium="bsi-validation-service"
hidden={{
version: { VERSION },
commit_hash: { COMMIT_HASH },
user: user["email"]
}}
buttonText="Share feedback"
/>
)
}

export default FeedbackWidget;
6 changes: 5 additions & 1 deletion frontend/src/Report.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ import SchemaResult from './SchemaResult';
import BsddTreeView from './BsddTreeView';
import GherkinResults from './GherkinResult';
import SideMenu from './SideMenu';
import FeedbackWidget from './FeedbackWidget';
import SearchOffOutlinedIcon from '@mui/icons-material/SearchOffOutlined';

import { useEffect, useState, useContext } from 'react';
import { FETCH_PATH } from './environment';
import { FETCH_PATH } from './environment'
import { PageContext } from './Page';
import HandleAsyncError from './HandleAsyncError';

Expand Down Expand Up @@ -190,6 +191,9 @@ function Report({ kind }) {
</div>
</Grid>
</Grid>

<FeedbackWidget user={user} />

</Grid>
</div>
);
Expand Down

0 comments on commit 4d938b9

Please sign in to comment.