Skip to content

Commit fac9375

Browse files
authored
Merge pull request #930 from nrrao/add-headings-tag-generator-steps-911
Add Headings to Tag Generator Steps
2 parents ce2a308 + 918ce00 commit fac9375

File tree

7 files changed

+67
-11
lines changed

7 files changed

+67
-11
lines changed

cypress/integration/pages/tag-creator.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ describe('Tag Generator Page (Tag Creator)', () => {
128128
it('loads correct 7 tags and new tags for `civictechindex/CTI-website-frontend` - unaffiliated', () => {
129129
cy.get('[data-cy=radio-no]').click();
130130
cy.get('#submitButton').click();
131-
cy.get('p').contains('Unaffliated');
131+
cy.get('p').contains('Unaffiliated');
132132
cy.get('[data-cy=grid-repository]').within(() => {
133133
cy.get('#repository-url', { force: true })
134134
.click()
@@ -169,7 +169,7 @@ describe('Tag Generator Page (Tag Creator)', () => {
169169
it('change the org form unaffiliated for `civictechindex/CTI-website-frontend` to affiliated', () => {
170170
cy.get('[data-cy=radio-no]').click();
171171
cy.get('#submitButton').click();
172-
cy.get('p').contains('Unaffliated');
172+
cy.get('p').contains('Unaffiliated');
173173
cy.get('#change-org').click();
174174
cy.contains('Are you affiliated with an organization?');
175175
cy.get('[data-cy=radio-yes]');

src/pages/TagCreator/AffilationQuestionSection.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { makeStyles } from '@material-ui/core/styles';
66

77
const useStyles = makeStyles((theme) => ({
88
containerPadding: {
9-
paddingTop: '30px',
9+
paddingTop: '20px',
1010
},
1111
gridPadding: {
1212
padding: '10px',

src/pages/TagCreator/Organization.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ const useStyles = makeStyles((theme) => ({
2828
typoStyle: {
2929
fontWeight: '700',
3030
},
31+
orgNameSectionGrid:{
32+
padding: '30px 0px',
33+
},
3134
}));
3235

3336
export const OrganizationSelectorSection = ({
@@ -127,10 +130,10 @@ export const OrgNameSection = ({ setDisplayState, orgName, linkStyles }) => {
127130
container
128131
direction='row'
129132
alignItems='center'
130-
style={{ padding: '48px 0px 32px 0px' }}
133+
className={classes.orgNameSectionGrid}
131134
>
132135
<Grid item xs={12} sm={3} className={classes.gridStyle}>
133-
<Typography variant='body1'>Affliated Organization:</Typography>
136+
<Typography variant='body1'>Affiliated Organization:</Typography>
134137
</Grid>
135138
{orgName ? (
136139
<Grid item xs={10} sm={7}>
@@ -141,7 +144,7 @@ export const OrgNameSection = ({ setDisplayState, orgName, linkStyles }) => {
141144
) : (
142145
<Grid item xs={7} style={{ paddingRight: '50px' }}>
143146
<Typography variant='body1' className={classes.typoStyle}>
144-
Unaffliated
147+
Unaffiliated
145148
</Typography>
146149
</Grid>
147150
)}

src/pages/TagCreator/ProjectRepository.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ const useStyles = makeStyles((theme) => ({
1818
fontSize: '0.875rem',
1919
},
2020
},
21+
projRepoGrid:{
22+
padding: '30px 0px',
23+
},
2124
}));
2225

2326
export const ProjectRepositorySection = ({
@@ -31,7 +34,7 @@ export const ProjectRepositorySection = ({
3134
container
3235
direction='row'
3336
alignItems='center'
34-
style={{ paddingBottom: '32px' }}
37+
className={classes.projRepoGrid}
3538
>
3639
<Grid item xs={12} sm={3} className={classes.gridStyle}>
3740
<Typography variant='body1'>Project Repository URL:</Typography>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import React from 'react';
2+
import { makeStyles } from '@material-ui/core/styles';
3+
import Grid from '@material-ui/core/Grid';
4+
import Typography from '@material-ui/core/Typography';
5+
6+
const useStyles = makeStyles((theme) => ({
7+
stepTypo:{
8+
color: theme.palette.spectrum.teal,
9+
},
10+
}));
11+
12+
const StepComponent = ({ step,stepHeading }) => {
13+
const classes = useStyles();
14+
return (
15+
<Grid>
16+
<Typography variant='h5' className={classes.stepTypo}>{step}</Typography>
17+
<Typography variant='h3' className={classes.stepTypo}>{stepHeading}</Typography>
18+
</Grid>
19+
)
20+
}
21+
22+
export default StepComponent

src/pages/TagCreator/TopicTagSection.js

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ import {
1212
} from './TopicTag';
1313
import { makeStyles } from '@material-ui/core/styles';
1414
import Link from '@material-ui/core/Link';
15-
import Divider from '@material-ui/core/Divider';
1615
import { useClipboard } from 'use-clipboard-copy';
1716
import SettingsGearIcon from '../../icons/SettingsGearIcon';
1817
import ImageComponent from '../../components/ImageComponent';
18+
import StepComponent from './StepComponent'
1919

2020
const useStyles = makeStyles((theme) => ({
2121
tagGridStyle: {
@@ -76,6 +76,12 @@ const useStyles = makeStyles((theme) => ({
7676
typoPadding: {
7777
padding: '30px 0px',
7878
},
79+
stepGrid:{
80+
paddingTop: '20px',
81+
},
82+
currentTopicTagGrid:{
83+
paddingBottom: '24px' ,
84+
},
7985
}));
8086

8187
const ButtonComponent = ({
@@ -114,6 +120,7 @@ const ButtonComponent = ({
114120
};
115121

116122
export const CurrentTopicTagSection = ({ currentTags, repositoryName }) => {
123+
const classes = useStyles();
117124
return (
118125
<>
119126
{currentTags.length !== 0 ? (
@@ -128,6 +135,7 @@ export const CurrentTopicTagSection = ({ currentTags, repositoryName }) => {
128135
direction='row'
129136
alignItems='center'
130137
data-cy='current-tags'
138+
className={classes.currentTopicTagGrid}
131139
>
132140
<GeneratedTopicTag topicnames={currentTags} variant='generated' />
133141
</Grid>{' '}
@@ -140,9 +148,6 @@ export const CurrentTopicTagSection = ({ currentTags, repositoryName }) => {
140148
</Typography>
141149
</Grid>
142150
)}
143-
<Grid style={{ padding: '24px 0px' }}>
144-
<Divider />
145-
</Grid>
146151
</>
147152
);
148153
};
@@ -416,6 +421,7 @@ export const CopyPasteTags = ({
416421
repositoryUrl,
417422
linkStyles,
418423
}) => {
424+
const classes = useStyles();
419425
const copyPasteTopicTags = [...tagsToAdd, ...userTags];
420426

421427
return (
@@ -448,6 +454,9 @@ export const CopyPasteTags = ({
448454
</Grid>
449455
</Grid>
450456
</Grid>
457+
<Grid className={classes.stepGrid}>
458+
<StepComponent step='Step 4 of 4' stepHeading='Submit Project to the Index'/>
459+
</Grid>
451460
<TagGeneratorInstructions
452461
copyPasteTopicTags={copyPasteTopicTags}
453462
linkStyles={linkStyles}

src/pages/TagCreator/index.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ import {
3535
} from './TopicTagSection';
3636
import useTheme from '@material-ui/core/styles/useTheme';
3737
import BottomSection from './BottomSection';
38+
import StepComponent from './StepComponent'
3839
import { makeStyles } from '@material-ui/core/styles';
3940
const useStyles = makeStyles((theme) => ({
4041
containerPadding: {
@@ -48,6 +49,9 @@ const useStyles = makeStyles((theme) => ({
4849
padding: '0px 16px',
4950
},
5051
},
52+
stepGrid:{
53+
paddingTop: '50px',
54+
},
5155
}));
5256

5357
/**
@@ -305,11 +309,15 @@ const TagCreator = () => {
305309
const OrgProjSection = () => {
306310
return (
307311
<>
312+
<Grid className={classes.stepGrid}>
313+
<StepComponent step='Step 1 of 4' stepHeading='Select Project Affiliation'/>
314+
</Grid>
308315
<OrgNameSection
309316
setDisplayState={setDisplayState}
310317
orgName={orgName}
311318
linkStyles={linkStyles}
312319
/>
320+
<StepComponent step='Step 2 of 4' stepHeading='Find Project'/>
313321
<ProjectRepositorySection
314322
repositoryUrl={fullRepositoryUrl}
315323
setDisplayState={setDisplayState}
@@ -347,11 +355,15 @@ const TagCreator = () => {
347355
case 'ProjectUrl':
348356
return (
349357
<>
358+
<Grid className={classes.stepGrid}>
359+
<StepComponent step='Step 1 of 4' stepHeading='Select Project Affiliation'/>
360+
</Grid>
350361
<OrgNameSection
351362
setDisplayState={setDisplayState}
352363
orgName={orgName}
353364
linkStyles={linkStyles}
354365
/>
366+
<StepComponent step='Step 2 of 4' stepHeading='Find Project'/>
355367
<ProjectRepositoryInput
356368
repositoryUrl={repositoryUrl}
357369
handleEnter={handleEnter}
@@ -376,6 +388,7 @@ const TagCreator = () => {
376388
currentTags={currentTags}
377389
repositoryName={repositoryName}
378390
/>
391+
<StepComponent step='Step 3 of 4' stepHeading='Create Topic Tags'/>
379392
<AddTagsQuestion
380393
userTags={userTags}
381394
displayState={displayState}
@@ -398,6 +411,7 @@ const TagCreator = () => {
398411
return (
399412
<>
400413
<OrgProjSection />
414+
<StepComponent step='Step 3 of 4' stepHeading='Create Topic Tags'/>
401415
<CurrentTopicTagSection
402416
currentTags={currentTags}
403417
repositoryName={repositoryName}
@@ -420,6 +434,7 @@ const TagCreator = () => {
420434
return (
421435
<>
422436
<OrgProjSection />
437+
<StepComponent step='Step 3 of 4' stepHeading='Create Topic Tags'/>
423438
<CurrentTopicTagSection
424439
currentTags={currentTags}
425440
repositoryName={repositoryName}
@@ -442,6 +457,7 @@ const TagCreator = () => {
442457
return (
443458
<>
444459
<OrgProjSection />
460+
<StepComponent step='Step 3 of 4' stepHeading='Create Topic Tags'/>
445461
<CurrentTopicTagSection
446462
currentTags={currentTags}
447463
repositoryName={repositoryName}
@@ -459,6 +475,9 @@ const TagCreator = () => {
459475
default:
460476
return (
461477
<>
478+
<Grid className={classes.stepGrid}>
479+
<StepComponent step='Step 1 of 4' stepHeading='Select Project Affiliation'/>
480+
</Grid>
462481
<AffiliationQuestionSection
463482
value={value}
464483
handleChange={handleChange}

0 commit comments

Comments
 (0)