diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..29d6828 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,3 @@ +node_modules +npm-debug.log + diff --git a/.github/workflows/cd-development.yml b/.github/workflows/cd-development.yml index db030cd..bebd2dc 100644 --- a/.github/workflows/cd-development.yml +++ b/.github/workflows/cd-development.yml @@ -1,8 +1,9 @@ name: CD-development on: - pull_request: - branches: [ "mfe-dev" ] + push: + branches: [ "feature-dc-front-cd" ] + jobs: Build-and-Test-on-Nodejs: @@ -10,7 +11,7 @@ jobs: strategy: matrix: - node-version: [ 16.x, 18.x ] + node-version: [ 16.x] steps: - uses: actions/checkout@v3 @@ -44,10 +45,18 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 - - name: Build and push to DockerHub + - name: Front-externo uses: docker/build-push-action@v3 with: context: . file: ./Dockerfile push: true - tags: ${{ secrets.DOCKER_HUB_USERNAME }}/front.li-sense:development \ No newline at end of file + tags: ${{ secrets.DOCKER_HUB_USERNAME }}/front.li-sense:development-externo + + - name: Front-interno + uses: docker/build-push-action@v3 + with: + context: . + file: ./li-sense-app/Dockerfile + push: true + tags: ${{ secrets.DOCKER_HUB_USERNAME }}/front.li-sense:development-interno diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..4589fd6 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,15 @@ +version: '3' + +services: + + front-1: + container_name: front-externo + ports: + - "9000:9000" + + front-2: + container_name: front-interno + build: + context: ./li-sense-app + ports: + - "8080:8080" diff --git a/li-sense-app/.dockerignore b/li-sense-app/.dockerignore new file mode 100644 index 0000000..29d6828 --- /dev/null +++ b/li-sense-app/.dockerignore @@ -0,0 +1,3 @@ +node_modules +npm-debug.log + diff --git a/li-sense-app/Dockerfile b/li-sense-app/Dockerfile index c3cb6f8..22604b6 100644 --- a/li-sense-app/Dockerfile +++ b/li-sense-app/Dockerfile @@ -12,4 +12,4 @@ RUN npm run build EXPOSE 8080 # RUN -CMD [ "npm", "start" ] \ No newline at end of file +CMD [ "npm","start"] \ No newline at end of file diff --git a/li-sense-app/src/_pages/BeAseller/BeAseller.css b/li-sense-app/src/_pages/BeAseller/BeAseller.css index 7d8cc6f..7dd2821 100644 --- a/li-sense-app/src/_pages/BeAseller/BeAseller.css +++ b/li-sense-app/src/_pages/BeAseller/BeAseller.css @@ -1,8 +1,8 @@ -.panel-detail { +/* .panel-detail { border-radius: 8px; border: 2px solid var(--color-secondary); background-color: var(--color-background-form); -} +} */ .submit { font-family: var(--title-fonts); @@ -19,4 +19,8 @@ color: #000; font-weight: bold; text-decoration: none; +} +.profile-picture { + width: 200px; + height: 200px; } \ No newline at end of file diff --git a/li-sense-app/src/_pages/BeAseller/BeAseller.js b/li-sense-app/src/_pages/BeAseller/BeAseller.js index 25830dc..0a4c62f 100644 --- a/li-sense-app/src/_pages/BeAseller/BeAseller.js +++ b/li-sense-app/src/_pages/BeAseller/BeAseller.js @@ -11,10 +11,10 @@ export default function BeAseller() {

Torne-se um Vendedor

-
-

Informações do Usuário

-
+
+

Informações do Usuário

+
@@ -69,10 +69,18 @@ export default function BeAseller() {
- +
+ + +
diff --git a/li-sense-app/src/_pages/Profile/Profile.css b/li-sense-app/src/_pages/Profile/Profile.css index 592e5fb..9412307 100644 --- a/li-sense-app/src/_pages/Profile/Profile.css +++ b/li-sense-app/src/_pages/Profile/Profile.css @@ -1,9 +1,8 @@ - -.panel-detail { +/* .panel-detail { border-radius: 8px; border: 2px solid var(--color-secondary); background-color: var(--color-background-form); -} +} */ #profile-picture-input { display: none; @@ -52,6 +51,11 @@ max-width: 100%; } +input:disabled { + border: 2px solid var(--color-primary); + background-color: var(--text-color); +} + .submit { font-family: var(--title-fonts); box-shadow: 5%; diff --git a/li-sense-app/src/_pages/Profile/Profile.js b/li-sense-app/src/_pages/Profile/Profile.js index b8f236c..9a25bac 100644 --- a/li-sense-app/src/_pages/Profile/Profile.js +++ b/li-sense-app/src/_pages/Profile/Profile.js @@ -1,14 +1,9 @@ import React, { useEffect, useState } from 'react'; import './Profile.css'; -import Logocentral from "../../_assets/img/logoredonda.png"; import LisenseContext from '../../_context/LisenseContext'; import { useNavigate } from 'react-router-dom'; export default function Profile(props){ - const [nome, setNome] = useState(props.nome); - const [senha, setSenha] = useState(props.senha); - const [email, setEmail] = useState(props.email); - const [cpf, setCpf] = useState(props.cpf); - const [telefone, setTelefone] = useState(props.telefone); + const navigate = useNavigate(); const { user } = React.useContext(LisenseContext); return ( @@ -52,7 +47,7 @@ export default function Profile(props){
- {/*Componente da foto de perfil não esta otimizado e tende a distorcer com o tamanho da tela */} + {/*Componente da foto de perfil*/}
- - {/*
- - -
*/}
@@ -141,21 +124,22 @@ export default function Profile(props){

Informações da Empresa

-
+
-
+
- +
diff --git a/li-sense-app/src/_pages/UserConfig/UserConfig.css b/li-sense-app/src/_pages/UserConfig/UserConfig.css index d9a3fcc..1fad039 100644 --- a/li-sense-app/src/_pages/UserConfig/UserConfig.css +++ b/li-sense-app/src/_pages/UserConfig/UserConfig.css @@ -159,3 +159,30 @@ input { input:focus { border: 3px solid rgb(98, 0, 255); } + +.panel-detail { + border-radius: 8px; + border: 2px solid var(--color-secondary); + background-color: var(--color-background-form); +} + +.submit { + font-family: var(--title-fonts); + box-shadow: 5%; + background-color: var(--color-primary); + + color: #ffff; + padding: 10px 20px; + + border-color: transparent; + border-radius: 5px; + + transition: all 0.3s ease-out; +} + +.submit:hover { + background: var(--color-tertiary); + color: #000; + font-weight: bold; + text-decoration: none; +} \ No newline at end of file diff --git a/li-sense-app/src/_pages/UserConfig/UserConfig.js b/li-sense-app/src/_pages/UserConfig/UserConfig.js index f95e3a1..98c37e9 100644 --- a/li-sense-app/src/_pages/UserConfig/UserConfig.js +++ b/li-sense-app/src/_pages/UserConfig/UserConfig.js @@ -1,13 +1,109 @@ import React from "react"; import "./UserConfig.css"; -import Form from "./components/Form"; +import LisenseContext from '../../_context/LisenseContext'; export default function UserConfig() { + const { user } = React.useContext(LisenseContext); + return ( - <> -
-
+
+
+

Configurações de Usuário

+
+
+
+
+

Editar Foto de Perfil

+
+
+
+ Para adicionar uma foto de perfil basta clicar na foto +
+
+ + +
+
+
+
+
+

Editar Informações

+
+
+
+ + +
+ Esse é nome como você deverá ser mencionado nas compras ou registros. +
+
+
+ + +
+ Você pode adicionar novos emails para facilitar a verificação. +
+
+ +
+
+
+ +
+ +
+
+
+ +
+ + +
+
+
+
+
- - ); +
+ ) } diff --git a/li-sense-app/src/_pages/UserConfig/components/Cpf.js b/li-sense-app/src/_pages/UserConfig/components/Cpf.js deleted file mode 100644 index 6b004b6..0000000 --- a/li-sense-app/src/_pages/UserConfig/components/Cpf.js +++ /dev/null @@ -1,21 +0,0 @@ -import React from "react"; - -function SetCPF({ formData, setFormData }) { - return ( -
-
-

A LI-SENSE utilizará seu CPF/CNPJ durante a etapa de confirmação.

-
- - setFormData({ ...formData, cpf: event.target.value }) - } - /> -
- ); -} - -export default SetCPF; diff --git a/li-sense-app/src/_pages/UserConfig/components/Form.js b/li-sense-app/src/_pages/UserConfig/components/Form.js deleted file mode 100644 index d79bb01..0000000 --- a/li-sense-app/src/_pages/UserConfig/components/Form.js +++ /dev/null @@ -1,61 +0,0 @@ -import React, { useState } from "react"; -import SetName from "./Name"; -import SetCPF from "./Cpf"; - -function Form() { - const [page, setPage] = useState(0); - const [formData, setFormData] = useState({ - cpf: "", - firstName: "", - lastName: "", - }); - - const FormTitles = ["Informe seu CPF\\CNPJ", "Insira seu nome"]; - - const PageDisplay = () => { - if (page === 0) { - return ; - } else { - return ; - } - }; - - return ( -
-
-
-
-
-
-

{FormTitles[page]}

-
-
{PageDisplay()}
-
- - - -
-
-
- ); -} - -export default Form; diff --git a/li-sense-app/src/_pages/UserConfig/components/Name.js b/li-sense-app/src/_pages/UserConfig/components/Name.js deleted file mode 100644 index 4c9d799..0000000 --- a/li-sense-app/src/_pages/UserConfig/components/Name.js +++ /dev/null @@ -1,29 +0,0 @@ -import React from "react"; - -function SetName({ formData, setFormData }) { - return ( -
-
-

Como você se chama?

-
- { - setFormData({ ...formData, firstName: e.target.value }); - }} - /> - { - setFormData({ ...formData, lastName: e.target.value }); - }} - /> -
- ); -} - -export default SetName; diff --git a/li-sense-app/src/_pages/UserConfig/index.js b/li-sense-app/src/_pages/UserConfig/index.js deleted file mode 100644 index ca3dd9d..0000000 --- a/li-sense-app/src/_pages/UserConfig/index.js +++ /dev/null @@ -1,10 +0,0 @@ -import React from "react"; -import ReactDOM from "react-dom"; -import UserConfig from "./UserConfig"; - -ReactDOM.render( - - - , - document.getElementById("root") -); diff --git a/src/index.ejs b/src/index.ejs index 144ff23..0708690 100644 --- a/src/index.ejs +++ b/src/index.ejs @@ -40,19 +40,11 @@ src="https://unpkg.com/react-dom@17/umd/react-dom.development.js" > - + - - <% } %> + <% if (isLocal) { %>