Skip to content

Commit

Permalink
Merge branch 'release/2.0.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
joshwingreene committed Aug 9, 2022
2 parents 7ef1d86 + d8d023e commit 397b309
Show file tree
Hide file tree
Showing 101 changed files with 1,477 additions and 1,279 deletions.
3 changes: 2 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@
"react/jsx-props-no-spreading": "off",
"react/react-in-jsx-scope": "off",
"react/require-default-props": "off",
"react/no-unused-prop-types": "off"
"react/no-unused-prop-types": "off",
"jsx-a11y/anchor-is-valid": "off"
},
"settings": {
"import/resolver": {
Expand Down
47 changes: 47 additions & 0 deletions CONTRIBUTING.md
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.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -351,3 +351,7 @@ const PersonForm = () => {
```

For more information, see the [useForm](https://react-hook-form.com/api/useform) and [@hookform/resolvers](https://github.com/react-hook-form/resolvers) documentation.

## Contributing

For information on contributing to this repo, see the [CONTRIBUTING.md](https://github.com/Shift3/boilerplate-client-react/blob/develop/CONTRIBUTING.md) file
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "client",
"version": "2.0.1",
"version": "2.0.2",
"private": true,
"dependencies": {
"@fortawesome/fontawesome-svg-core": "^6.1.1",
Expand All @@ -18,6 +18,8 @@
"i18next": "^21.8.4",
"i18next-browser-languagedetector": "^6.1.4",
"i18next-http-backend": "^1.4.1",
"moment": "^2.29.4",
"msw": "^0.39.2",
"react": "^18.1.0",
"react-bootstrap": "^2.3.1",
"react-dom": "^18.1.0",
Expand Down Expand Up @@ -96,7 +98,6 @@
"husky": "^7.0.0",
"i18next-parser": "^6.4.0",
"jest-styled-components": "^7.0.4",
"msw": "^0.39.2",
"prettier": "^2.6.2",
"pretty-quick": "^3.1.3",
"react-test-renderer": "^18.1.0",
Expand Down
100 changes: 94 additions & 6 deletions src/GlobalStyle.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { createGlobalStyle } from 'styled-components';
import dark from 'themes/dark';

export const GlobalStyle = createGlobalStyle`
export const GlobalStyle = createGlobalStyle<{ theme: typeof dark }>`
*,
*::after,
*::before {
Expand All @@ -12,12 +13,21 @@ export const GlobalStyle = createGlobalStyle`
html,
body {
min-height: 100%;
background: #fafafa;
background: ${({ theme }) => theme.backgroundColor};
color: ${({ theme }) => theme.textColor};
}
a {
a, .btn-link {
text-decoration: none;
color: #3b82f6;
color: ${({ theme }) => theme.linkColor};
&:hover {
color: ${({ theme }) => theme.linkHoverColor};
}
}
.bg-dark {
background-color: ${({ theme }) => theme.textColor} !important;
color: ${({ theme }) => theme.backgroundColor} !important;
}
button.btn:disabled {
Expand All @@ -30,7 +40,85 @@ export const GlobalStyle = createGlobalStyle`
margin-top: 0;
font-size: 0.825rem;
font-weight: 500;
color: #555;
color: ${({ theme }) => theme.forms.labelColor};
}
.form-control,
.form-select,
textarea {
background-color: ${({ theme }) => theme.input.backgroundColor};
color: ${({ theme }) => theme.input.textColor};
border-color: ${({ theme }) => theme.input.borderColor};
&:disabled {
background-color: ${({ theme }) => theme.input.disabledBackground};
}
&.is-invalid {
border-color: ${({ theme }) => theme.forms.errorBorderColor};
}
}
.invalid-feedback {
color: ${({ theme }) => theme.forms.errorTextColor};
}
.card {
background-color: ${({ theme }) => theme.card.backgroundColor};
border-radius: 6px;
border: none;
box-shadow: ${({ theme }) => theme.boxShadow};
}
`;
.text-muted {
color: ${({ theme }) => theme.pages.p} !important;
}
.btn-primary {
background-color: ${({ theme }) => theme.buttons.primaryBackgroundColor};
border-color: ${({ theme }) => theme.buttons.primaryBorderColor};
color: ${({ theme }) => theme.buttons.primaryTextColor};
&:hover {
background-color: ${({ theme }) => theme.buttons.primaryHoverBackgroundColor};
color: ${({ theme }) => theme.buttons.primaryHoverTextColor};
border-color: transparent;
}
}
.btn-default {
background-color: ${({ theme }) => theme.buttons.defaultBackgroundColor};
border-color: ${({ theme }) => theme.buttons.defaultBorderColor};
color: ${({ theme }) => theme.buttons.defaultTextColor};
&:hover {
background-color: ${({ theme }) => theme.buttons.defaultHoverBackgroundColor};
color: ${({ theme }) => theme.buttons.defaultHoverTextColor};
border-color: transparent;
}
}
div.react-select__control {
background-color: ${({ theme }) => theme.input.backgroundColor};
border-color: ${({ theme }) => theme.input.borderColor};
}
span.react-select__indicator-separator {
background-color: ${({ theme }) => theme.input.borderColor};
}
div.react-select__indicator {
color: ${({ theme }) => theme.input.borderColor};
}
div.react-select__value-container,
div.react-select__single-value {
color: ${({ theme }) => theme.input.textColor};
}
div.react-select__menu {
background-color: ${({ theme }) => theme.card.backgroundColor};
}
div.react-select__option--is-focused:not(.react-select__option--is-selected) {
background-color: ${({ theme }) => theme.backgroundColor};
}
`;
export default GlobalStyle;
169 changes: 80 additions & 89 deletions src/app/App.tsx
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>
);
};
Loading

0 comments on commit 397b309

Please sign in to comment.