diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7a5e4a49b6ed9ca0311f234592ebc32b3e5cff51..0a40c3796ebd3a127f5f7ebe605f3326b97d0abe 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -11,6 +11,7 @@ variables: stages: - quality - build + - build-push - deploy build-test: @@ -26,11 +27,11 @@ build-test: - dev - merge_requests -build: +build-push: image: docker:18.09 services: - docker:18.09-dind - stage: build + stage: build-push only: - master - dev diff --git a/src/components/Newsletter/MonthlyInfo/MonthlyInfo.tsx b/src/components/Newsletter/MonthlyInfo/MonthlyInfo.tsx index d14bbd82cd922813d0202dce18645084dd32dbcc..ec98ab253b483550ef4d63f60ac2ce458436f5ff 100644 --- a/src/components/Newsletter/MonthlyInfo/MonthlyInfo.tsx +++ b/src/components/Newsletter/MonthlyInfo/MonthlyInfo.tsx @@ -5,6 +5,7 @@ import CustomEditor from '../CustomEditor' import ImagePicker from '../ImagePicker/ImagePicker' import { ContentItems } from '../Newsletter' import './monthlyInfo.scss' + interface MonthlyInfoProps { onSave: () => Promise<void> onCancel: () => void diff --git a/src/components/Newsletter/Newsletter.tsx b/src/components/Newsletter/Newsletter.tsx index 7e902395f4ff01c91a8d200cdf6835e765093347..1fc87b7a73bec011d80a1dcefce5d9649b48a513 100644 --- a/src/components/Newsletter/Newsletter.tsx +++ b/src/components/Newsletter/Newsletter.tsx @@ -28,6 +28,8 @@ export type ContentItems = | 'subject' | '' +const Newsletter: React.FC = () => { + // Functional rule : const Newsletter: React.FC = () => { // Functional rule : // Display next month after the 3rd of the current month diff --git a/src/components/Routes/Router.tsx b/src/components/Routes/Router.tsx index 0155cdde08c1aed7244033703bb8b0174da574f4..c48694e54b6f2ffb7e6165f2bd7ef621789aec16 100644 --- a/src/components/Routes/Router.tsx +++ b/src/components/Routes/Router.tsx @@ -7,7 +7,7 @@ import Newsletter from '../Newsletter/Newsletter' import Popups from '../Popups/Popups' import Prices from '../Prices/Prices' -const links: { [key: string]: { label: string; path: string } } = { +export const links: { [key: string]: { label: string; path: string } } = { newsletter: { label: 'Newsletter', path: '/newsletter', @@ -33,6 +33,7 @@ export const routes = Object.keys(links).map((key) => ({ const Router: React.FC = () => { const { user } = useContext(UserContext) + console.log(user) return ( <Switch> diff --git a/src/hooks/useAuth.ts b/src/hooks/useAuth.ts index 11b8270e147023a64af9b8263014d2acdaf7a2ff..f7df8af3276d2ca619b6fa2c7558704bd5122570 100644 --- a/src/hooks/useAuth.ts +++ b/src/hooks/useAuth.ts @@ -2,6 +2,7 @@ import { useContext, useState } from 'react' import axios from 'axios' import { UserContext } from './userContext' import { useHistory } from 'react-router-dom' +import { links } from '../components/Routes/Router' export interface Auth { loginUser: () => Promise<void> @@ -38,7 +39,7 @@ export const useAuth = (): Auth => { const { data } = await axios.get(`/api/common/WhoAmI`) if (data && setUser) { setUser(data) - history.push('/editing') + history.push(links.newsletter.path) } } catch (e) { setError(e)