-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
101 changed files
with
1,477 additions
and
1,279 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Contributing | ||
|
||
## How to cut a release from the develop branch to the main branch | ||
|
||
**(Step 1)** Open the root directory of the react boilerplate via your terminal and ensure that you are on the develop branch. | ||
|
||
**Recommendation:** Do this outside of your code editor. | ||
|
||
**(Step 2)** Run `git flow` | ||
|
||
If you don't have Git Flow installed, use `brew install git-flow` to install it via brew. | ||
|
||
**(Step 3)** Run `git flow init` | ||
|
||
This will ask you a series of questions. You should use the defaults. | ||
|
||
**(Step 4)** Run `git flow release start <new_version_number>` | ||
|
||
You should define your new version number at the end, ex. 2.0.1. | ||
|
||
**(Step 5)** Go to the `package.json` file and increase the version number so that it is consistent with the version number from the previous step. | ||
|
||
**(Step 6)** Commit and push the edit that you made to `package.json` in the previous step. | ||
|
||
**(Step 7)** Run `git flow release finish <release_name>` | ||
|
||
The `release_name` is whatever you put for the version number in step 4. | ||
|
||
This command will open nano. You will need to use it in order to write and submit a commit message. After submitting the message, you will then need to write and submit a message for the commit's tag, ex. version 2.0.1 release. | ||
|
||
After you submit the message for the tag, you will see a summary of actions. | ||
|
||
**(Step 8)** Run `git push` | ||
|
||
**(Step 9)** Run `git checkout main` | ||
|
||
**(Step 10)** Run `git push` | ||
|
||
**(Step 11)** Go to the React Boilerplate's main branch on GitHub and click on the yellow dot that's to the left of the commit hash. You will see that the CircleCI tests have started to run. Click on the Details link for the `ci/circle:ci test` check. | ||
|
||
This will open up CircleCI. You will need to authorize CircleCI if you have never used it before. Ensure that all of the steps finish successfully. | ||
|
||
**(Step 12)** Click on the deploy-production workflow and make sure that all of its steps finish successfully as well. | ||
|
||
At the top of the page, you will see "Dashboard", "Project", Branch", "Workflow", and "Job". "deploy-production" should be under the Workflow column. Click on it. | ||
|
||
**(Step 13)** Check the production website (https://boilerplate-client-react-prod.shift3sandbox.com/) and ensure that your changes are working as expected. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,105 +1,96 @@ | ||
import { ErrorBoundary } from '@sentry/react'; | ||
import { AppErrorBoundary } from 'features/error-boundary/components/AppErrorBoundary'; | ||
import { Layout } from 'common/components/Layout'; | ||
import { NotFoundView } from 'common/components/NotFoundView'; | ||
import { NotificationContainer } from 'common/components/Notification'; | ||
import { Role } from 'common/models'; | ||
import { BannerContentWrapper } from 'common/styles/utilities'; | ||
import { environment } from 'environment'; | ||
import { AgentRoutes } from 'features/agent-dashboard'; | ||
import { AuthRoutes, RequireAuth } from 'features/auth'; | ||
import { ConfirmationModal } from 'features/confirmation-modal'; | ||
import { BitwiseNavbar } from 'features/navbar'; | ||
import { UserRoutes } from 'features/user-dashboard'; | ||
import { UpdateUserProfilePage } from 'features/user-profile/pages/UpdateUserProfilePage'; | ||
import { FC } from 'react'; | ||
import { Alert } from 'react-bootstrap'; | ||
import { createContext, FC, useState, useMemo } from 'react'; | ||
import { Navigate, Route, Routes } from 'react-router-dom'; | ||
import styled, { css, ThemeProvider } from 'styled-components'; | ||
import AppTheme from 'utils/styleValues'; | ||
import { Slide, toast, ToastContainer } from 'react-toastify'; | ||
import { ThemeProvider } from 'styled-components'; | ||
import { GlobalStyle } from '../GlobalStyle'; | ||
import { Role } from 'common/models'; | ||
|
||
const StagingBanner = styled(Alert).attrs({ | ||
variant: 'warning', | ||
})` | ||
text-align: center; | ||
border-radius: 0; | ||
border: none; | ||
position: fixed; | ||
z-index: 99; | ||
left: 0; | ||
right: 0; | ||
background: repeating-linear-gradient(45deg, #fff3cd, #fff3cd 20px, #fdefc3 20px, #fdefc3 40px); | ||
border-bottom: 1px #dadada solid; | ||
`; | ||
|
||
const BannerWrapper = styled.div<{ | ||
bannerShowing: boolean; | ||
}>` | ||
${StagingBanner} { | ||
display: none; | ||
visibility: hidden; | ||
} | ||
import light from 'themes/light'; | ||
import dark from 'themes/dark'; | ||
|
||
${props => | ||
props.bannerShowing | ||
? css` | ||
.content-wrapper { | ||
padding-top: 56px !important; | ||
} | ||
export const ThemeContext = createContext({ | ||
theme: 'light', | ||
// eslint-disable-next-line @typescript-eslint/no-empty-function | ||
toggle: () => {}, | ||
}); | ||
|
||
${StagingBanner} { | ||
display: block; | ||
visibility: visible; | ||
} | ||
export const App: FC = () => { | ||
const [theme, setTheme] = useState('light'); | ||
|
||
${BitwiseNavbar} { | ||
padding-top: 56px !important; | ||
const value = useMemo(() => { | ||
const toggle = () => { | ||
return theme === 'light' ? setTheme('dark') : setTheme('light'); | ||
}; | ||
|
||
` | ||
: null} | ||
`; | ||
return { | ||
theme, | ||
toggle, | ||
}; | ||
}, [theme]); | ||
|
||
export const App: FC = () => ( | ||
<ErrorBoundary> | ||
<ThemeProvider theme={AppTheme}> | ||
<ConfirmationModal /> | ||
<NotificationContainer /> | ||
<BannerWrapper bannerShowing={environment.environment === 'staging'}> | ||
<StagingBanner> | ||
You are currently on the <b>staging</b> server. | ||
</StagingBanner> | ||
<Routes> | ||
<Route path='/auth/*' element={<AuthRoutes />} /> | ||
<Route | ||
path='/user/profile/:id' | ||
element={ | ||
<RequireAuth> | ||
<Layout> | ||
<UpdateUserProfilePage /> | ||
</Layout> | ||
</RequireAuth> | ||
} | ||
return ( | ||
<AppErrorBoundary> | ||
<ThemeContext.Provider value={value}> | ||
<ThemeProvider theme={theme === 'light' ? light : dark}> | ||
<GlobalStyle /> | ||
<ConfirmationModal /> | ||
<ToastContainer | ||
autoClose={5000} | ||
closeButton | ||
closeOnClick | ||
newestOnTop | ||
hideProgressBar={false} | ||
position={toast.POSITION.TOP_RIGHT} | ||
role='alert' | ||
theme='light' | ||
limit={3} | ||
transition={Slide} | ||
/> | ||
<Route | ||
path='/agents/*' | ||
element={ | ||
<RequireAuth> | ||
<AgentRoutes /> | ||
</RequireAuth> | ||
} | ||
/> | ||
<Route | ||
path='/users/*' | ||
element={ | ||
<RequireAuth allowedRoles={[ Role.ADMIN ]}> | ||
<UserRoutes /> | ||
</RequireAuth> | ||
} | ||
/> | ||
<Route path='/' element={<Navigate to='/agents' />} /> | ||
<Route path='*' element={<NotFoundView />} /> | ||
</Routes> | ||
</BannerWrapper> | ||
</ThemeProvider> | ||
<GlobalStyle /> | ||
</ErrorBoundary> | ||
); | ||
|
||
<BannerContentWrapper bannerShowing={environment.environment === 'staging'}> | ||
<Routes> | ||
<Route path='/auth/*' element={<AuthRoutes />} /> | ||
<Route | ||
path='/user/profile/:id' | ||
element={ | ||
<RequireAuth> | ||
<Layout> | ||
<UpdateUserProfilePage /> | ||
</Layout> | ||
</RequireAuth> | ||
} | ||
/> | ||
<Route | ||
path='/agents/*' | ||
element={ | ||
<RequireAuth> | ||
<AgentRoutes /> | ||
</RequireAuth> | ||
} | ||
/> | ||
<Route | ||
path='/users/*' | ||
element={ | ||
<RequireAuth allowedRoles={[Role.ADMIN]}> | ||
<UserRoutes /> | ||
</RequireAuth> | ||
} | ||
/> | ||
<Route path='/' element={<Navigate to='/agents' />} /> | ||
<Route path='*' element={<NotFoundView />} /> | ||
</Routes> | ||
</BannerContentWrapper> | ||
</ThemeProvider> | ||
</ThemeContext.Provider> | ||
</AppErrorBoundary> | ||
); | ||
}; |
Oops, something went wrong.