Skip to content

Commit d441533

Browse files
committed
Merge branch 'main' into 176-full-color-demo
2 parents 1826dcf + e3e6f98 commit d441533

File tree

18 files changed

+202
-89
lines changed

18 files changed

+202
-89
lines changed

.github/issue_template.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Story
2+
3+
# Acceptance Criteria
4+
5+
- [ ]
6+
7+
# Screenshots / Video
8+
9+
<details>
10+
<summary></summary>
11+
12+
</details>
13+
14+
# Testing Instructions and Sample Files
15+
16+
-
17+
18+
# Notes

.github/pull_request_template.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Story
2+
3+
Refs #issuenumber
4+
5+
# Expected Behavior Before Changes
6+
7+
# Expected Behavior After Changes
8+
9+
# Screenshots / Video
10+
11+
<details>
12+
<summary></summary>
13+
14+
</details>
15+
16+
# Notes

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ The webstore requires a [React component library](https://reactjs.org/docs/react
3939
Using the published github npm package requires an auth token to pull:
4040

4141
1. Create a classic token on your github account https://github.com/settings/tokens
42-
2. `echo "//npm.pkg.github.com/:_authToken=$THE_ABOVE_TOKEN_GOES_HERE" >> ~/.npmrc`
42+
2. `echo "//npm.pkg.github.com/:_authToken=THE_ABOVE_TOKEN_GOES_HERE" >> ~/.npmrc`
4343

4444
#### Component Library Dev Mode
4545
Using the local github repository requires you to manually clone the component library to your computer, build, and link it:

assets/svg/gps-logo-white.svg

Lines changed: 10 additions & 0 deletions
Loading

cypress/e2e/browsing.cy.js

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,41 @@ describe('Browsing', () => {
2727
cy.get('button.search-button').click()
2828

2929
// The new url should include "/browse"
30-
cy.url().should('include', '/browse?=next')
30+
cy.url().should('include', '/browse?q=next')
31+
32+
// The search bar on the browse page should have the text that was searched for
33+
cy.get('input.search-bar').should('have.value', 'next')
34+
})
35+
36+
it('completes a search from the "/browse" with a blank query', () => {
37+
// Start from the browse page
38+
cy.visit('/browse')
39+
40+
// Find the search button and perform an empty search, which should lead to the browse page
41+
cy.get('button.search-button').click()
42+
43+
// The new url should include "/browse"
44+
cy.url().should('include', '/browse')
45+
46+
// The new url should not contain a query
47+
cy.url().should('not.include', '?')
48+
49+
// The search bar on the browse page should remain blank
50+
cy.get('input.search-bar').should('have.value', '')
51+
})
52+
53+
it('completes a search from "/browse" with a query term', () => {
54+
// Start from the browse page
55+
cy.visit('/browse')
56+
57+
// type an example search into the searchbar
58+
cy.get('input.search-bar').type('next')
59+
60+
// Press the search button
61+
cy.get('button.search-button').click()
62+
63+
// The new url should include "/browse"
64+
cy.url().should('include', '/browse?q=next')
3165

3266
// The search bar on the browse page should have the text that was searched for
3367
cy.get('input.search-bar').should('have.value', 'next')

pages/_app.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
import { Footer, Header } from '@scientist-softserv/webstore-component-library'
22
import { SWRConfig } from 'swr'
33
import {
4-
SessionProvider, signIn, signOut, useSession
4+
SessionProvider,
5+
signIn,
6+
signOut,
7+
useSession,
58
} from 'next-auth/react'
6-
79
import {
810
FOOTER_NAME,
911
FOOTER_SECTIONS,
1012
FOOTER_SOCIALS,
13+
headerAndFooterLinkColors,
1114
LOGO,
1215
NAVIGATION_LINKS,
1316
fetcher,
@@ -24,14 +27,14 @@ const WebStore = ({ Component }) => {
2427
signIn: () => signIn(process.env.NEXT_PUBLIC_PROVIDER_NAME),
2528
signOut: signOut,
2629
}}
27-
linkColor='white'
30+
linkColor={headerAndFooterLinkColors}
2831
logo={LOGO}
2932
navLinks={NAVIGATION_LINKS}
3033
userSession={session}
3134
/>
3235
<Component />
3336
<Footer
34-
color='white'
37+
color={headerAndFooterLinkColors}
3538
companyName={FOOTER_NAME}
3639
sections={FOOTER_SECTIONS}
3740
socials={FOOTER_SOCIALS}

pages/browse/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ import {
88
SearchBar,
99
} from '@scientist-softserv/webstore-component-library'
1010
import {
11+
buttonBg,
1112
configureErrors,
1213
configureServices,
13-
secondary,
1414
useFilteredWares,
1515
} from '../../utils'
1616

@@ -65,7 +65,7 @@ const Browse = () => {
6565
buttonLink={service.href}
6666
orientation='horizontal'
6767
buttonProps={{
68-
backgroundColor: secondary,
68+
backgroundColor: buttonBg,
6969
label: 'Request this item',
7070
}}
7171
/>

pages/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {
1414
configureServices,
1515
useAllWares,
1616
FEATURED_SERVICE_PATH,
17-
TEXT,
17+
ABOUT_US,
1818
TITLE,
1919
} from '../utils'
2020

@@ -43,7 +43,7 @@ const Home = () => {
4343
/>
4444
<div className='container'>
4545
<SearchBar onSubmit={handleOnSubmit} />
46-
<TitledTextBox title={TITLE} text={TEXT} />
46+
<TitledTextBox title={TITLE} text={ABOUT_US} />
4747
{isError ? (
4848
<Notice
4949
alert={configureErrors([isError])}

pages/requests/[id].js

Lines changed: 28 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,14 @@ import {
1616
import {
1717
configureErrors,
1818
createMessageOrFile,
19-
useMessagesAndFiles,
19+
requestActionsBg,
20+
requestStatsHeaderBg,
21+
STATUS_ARRAY,
22+
statusBarBg,
23+
useMessages,
24+
useFiles,
2025
useAllSOWs,
2126
useOneRequest,
22-
STATUS_ARRAY,
2327
} from '../../utils'
2428

2529
const Request = () => {
@@ -29,18 +33,12 @@ const Request = () => {
2933
const { id } = router.query
3034
const { request, isLoadingRequest, isRequestError } = useOneRequest(id, session?.accessToken)
3135
const { allSOWs, isLoadingSOWs, isSOWError } = useAllSOWs(id, request?.identifier, session?.accessToken)
32-
const {
33-
messages,
34-
files,
35-
isLoadingMessagesAndFiles,
36-
isMessagesAndFilesError,
37-
mutate,
38-
data,
39-
} = useMessagesAndFiles(id, session?.accessToken)
36+
const { messages, isLoadingMessages, isMessagesError, mutate, data } = useMessages(request?.uuid, session?.accessToken)
37+
const { files, isLoadingFiles, isFilesError } = useFiles(id, session?.accessToken)
4038
const documents = (allSOWs) ? [...allSOWs] : []
4139

42-
const isLoading = isLoadingRequest || isLoadingSOWs || isLoadingMessagesAndFiles
43-
const isError = isRequestError || isSOWError || isMessagesAndFilesError
40+
const isLoading = isLoadingRequest || isLoadingSOWs || isLoadingFiles || isLoadingMessages
41+
const isError = isRequestError || isSOWError || isFilesError|| isMessagesError
4442

4543
if (isLoading) return <Loading wrapperClass='item-page mt-5' />
4644

@@ -60,7 +58,7 @@ const Request = () => {
6058
if (isError) {
6159
return (
6260
<Notice
63-
alert={configureErrors([isRequestError, isSOWError, isMessagesAndFilesError])}
61+
alert={configureErrors([isRequestError, isSOWError, isMessagesError, isFilesError])}
6462
dismissible={false}
6563
withBackButton={true}
6664
buttonProps={{
@@ -71,35 +69,35 @@ const Request = () => {
7169
)
7270
}
7371

74-
// TODO(summer-cook) need to use the quoted ware id here instead of the quote group id.
75-
// can be found at https://{{base_path}}/quote_groups/{{quote_group_id}}/quoted_wares.json
76-
// const handleSendingMessagesOrFiles = ({ message, files }) => {
77-
// createMessageOrFile({
78-
// id,
79-
// message,
80-
// files,
81-
// accessToken: session?.accessToken,
82-
// })
83-
// mutate({ ...data, ...messages })
84-
// }
72+
const handleSendingMessagesOrFiles = ({ message, files }) => {
73+
createMessageOrFile({
74+
id,
75+
message,
76+
files,
77+
accessToken: session?.accessToken,
78+
quotedWareID: request.quotedWareID,
79+
})
80+
mutate({ ...data, ...messages })
81+
}
8582

8683
return (
8784
<div className='container'>
8885
<StatusBar
8986
addClass='mt-4'
9087
apiRequestStatus={request.status.text}
91-
backgroundColor='light'
88+
backgroundColor={statusBarBg}
9289
statusArray={STATUS_ARRAY}
9390
/>
9491
<div className='row mb-4'>
9592
<div className='col-sm-4 col-md-3 mt-2 mt-sm-4 order-1 order-sm-0'>
96-
{/* TODO(@summercook):
97-
- add back in the handleSendingMessagesOrFiles={handleSendingMessagesOrFiles} prop
98-
to ActionsGroup once posting messages/attachments has been refactored. */}
99-
<ActionsGroup initialFiles={files} />
93+
<ActionsGroup
94+
backgroundColor={requestActionsBg}
95+
initialFiles={files}
96+
handleSendingMessagesOrFiles={handleSendingMessagesOrFiles}
97+
/>
10098
<div className='mt-3'>
10199
<RequestStats
102-
addClass='bg-secondary-8'
100+
addClass={requestStatsHeaderBg}
103101
billingInfo={{ ...request.billingAddress }}
104102
createdAt={request.createdAt}
105103
deadline={request.proposedDeadline}

pages/requests/index.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ import {
88
RequestList,
99
} from '@scientist-softserv/webstore-component-library'
1010
import {
11+
buttonBg,
1112
configureErrors,
12-
primary,
13+
requestListBg,
1314
useDefaultWare,
1415
useAllRequests
1516
} from '../../utils'
@@ -58,14 +59,14 @@ const Requests = () => {
5859
<div className='text-end d-block mt-4 mb-2'>
5960
<LinkedButton
6061
buttonProps={{
61-
backgroundColor: primary,
62+
backgroundColor: buttonBg,
6263
label: 'Initiate a New Request',
6364
size: 'large',
6465
}}
6566
path={{ pathname: `/requests/new/make-a-request`, query: { id: defaultWareID } }}
6667
/>
6768
</div>
68-
<RequestList backgroundColor='light' requests={requests} />
69+
<RequestList backgroundColor={requestListBg} requests={requests} />
6970
</div>
7071
)
7172
}

0 commit comments

Comments
 (0)