Skip to content
Open
Show file tree
Hide file tree
Changes from 5 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
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,25 @@ npm install --g --production windows-build-tools --legacy-peer-deps

This section is under development.

## For environments problems

1. When your environment variable has problems. You can use this commands:
a. `source .env`
b. `echo $REACT_APP_API_HOST`
c. `npm run start`

## for nvm problems

## for nvm problems
use:

```
npm --build-from-source install node-pre-gyp
```


## Prettify:

To format document with eslintrc rules run:

```bash
npm run lint:fix
```
Expand Down
70 changes: 22 additions & 48 deletions src/app/views/feedback/survey-dashboard/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,58 +87,32 @@ const Survey = ({ match }) => {
</Button>
</DowndownMenu>
</div>
{answered && answered.length > 0 ? <Grid container spacing={2}>
<Grid item md={4} xs={12}>
<Alert severity="warning" className="mb-3">
<AlertTitle className="m-auto">{survey && survey.expired < 0 ? `This survey expires ${Math.round(survey.expired/24)*-1} days ago`: `This survey expires in ${survey.expired} hours`}</AlertTitle>
</Alert>
<GaugeProgressCard score={survey.scores?.total || overallScore} />
<Grid container spacing={2}>
<Grid item sm={6} xs={12}>
<StatCard label={'Cohort Score'} score={survey.scores?.cohort || avgCohortScore} />
</Grid>
<Grid item sm={6} xs={12}>
<StatCard label={'Academy Score'} score={survey.scores?.academy || avgAcademyScore} />
</Grid>
{surveyMentors.map((m) => (
<Grid key={m.name} item sm={6} xs={12}>
<StatCard label={m.name} score={m.score.toFixed(1)} />
<Grid container spacing={2}>
<Grid item md={4} xs={12}>
<Alert severity="warning" className="mb-3">
<AlertTitle className="m-auto">{survey && survey.expired < 0 ? `This survey expires ${Math.round(survey.expired/24)*-1} days ago`: `This survey expires in ${survey.expired} hours`}</AlertTitle>
</Alert>
<GaugeProgressCard label={survey.scores?.total ? 'Total Score' : 'No score yet'} score={survey.scores?.total ? Number(survey.scores?.total.toFixed(1)) : 0} />
<Grid container spacing={2}>
<Grid item sm={6} xs={12}>
<StatCard label={survey.scores?.cohort ? 'Cohort Score' : 'No cohort score yet'} score={survey.scores?.cohort ? Number(survey.scores?.cohort.toFixed(1)) : 0} />
</Grid>
))}
</Grid>
</Grid>
<Grid item md={8} xs={12}>
<Answers answered={answered} filteredAnswers={filteredAnswers} sortBy={sortBy} filter={filter} mentors={mentors}/>
</Grid>
</Grid>:<Grid container spacing={2}>
<Grid item md={4} xs={12}>
<Alert severity="warning" className="mb-3">
<AlertTitle className="m-auto">{survey && survey.expired < 0 ? `This survey expired ${Math.round(survey.expired/24)*-1} days ago`: `This survey expires in ${survey.expired} hours`}</AlertTitle>
</Alert>
<GaugeProgressCard score={0} />
<Grid container spacing={2}>
<Grid item sm={6} xs={12}>
<StatCard label={'No score yet'} score={0} />
</Grid>
<Grid item sm={6} xs={12}>
<StatCard label={'No score yet'} score={0} />
</Grid>
{mentors.map((m) => (
<Grid key={m.name} item sm={6} xs={12}>
<StatCard label={'No score yet'} score={0} />
<Grid item sm={6} xs={12}>
<StatCard label={survey.scores?.academy ? 'Academy Score' : 'No academy score yet'} score={survey.scores?.academy ? Number(survey.scores?.academy.toFixed(1)) : 0} />
</Grid>
))}
{surveyMentors && surveyMentors?.length > 0 && surveyMentors.map((m) => (
<Grid key={m.name} item sm={6} xs={12}>
<StatCard label={m.name} score={m.score.toFixed(1)} />
</Grid>
))}
</Grid>
</Grid>
{answered && answered?.length > 0 && (
<Grid item md={8} xs={12}>
<Answers answered={answered} filteredAnswers={filteredAnswers} sortBy={sortBy} filter={filter} mentors={mentors}/>
</Grid>
)}
</Grid>
<Grid item md={8} xs={12}>
<Answers
answered={answered}
filteredAnswers={filteredAnswers}
sortBy={sortBy} filter={filter}
mentors={mentors}/>
</Grid>
</Grid>
}
</>
}
<CopyDialog
Expand Down
2 changes: 1 addition & 1 deletion src/app/views/feedback/surveys.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ const SurveyList = () => {
filter: true,
customBodyRenderLite: (i) => {
console.log("scores", items[i].scores)
const avg_score = items[i].scores?.total || null;
const avg_score = items[i].scores?.total ? parseFloat(items[i].scores?.total.toFixed(1)) : null;
const color =
avg_score > 7
? "text-green"
Expand Down