Skip to content

Commit

Permalink
[LZ22045-67] Cómo usuario quiero poder consultar el PDF mediante vali…
Browse files Browse the repository at this point in the history
…da.one (#9)

* add verify v2

* fix erros and change to axios

* update CHANGELOG

* update cypress

* update next

* update next and react

* eslint

* eslint

* update node

* fix cy

* fix Danger

* fix obsolete tests

* fix error hydratate

* eslint

---------

Co-authored-by: Arnau Zapata Delgado <azapata@Arnaus-MacBook-Pro.local>
  • Loading branch information
arnauZap and Arnau Zapata Delgado authored Jul 17, 2023
1 parent 2676c6d commit 00df17f
Show file tree
Hide file tree
Showing 18 changed files with 2,293 additions and 3,932 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/Danger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: '16.x'
node-version: '18.x'

- name: Install dependencies
run: yarn install --dev
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: '16.x'
node-version: '18.x'

- name: Install dependencies
run: yarn install
Expand All @@ -29,7 +29,7 @@ jobs:
run: yarn jest

- name: Run integration tests
uses: cypress-io/github-action@v1
uses: cypress-io/github-action@v2
with:
install: false
browser: electron
Expand All @@ -40,7 +40,7 @@ jobs:
- name: Build app
run: yarn build

- uses: actions/upload-artifact@v1
- uses: actions/upload-artifact@v2
if: failure()
with:
name: cypress-videos
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

- [Cómo usuario quiero poder consultar el PDF mediante valida.one](https://wealize.atlassian.net/browse/LZ22045-67)
- [[Valida.one] Actualizar texto validación](https://wealize.atlassian.net/browse/AD20036-82)
- [[Valida.one] Validación a través de un QR y Incluir lógica de verificación de Izertis](https://wealize.atlassian.net/browse/AD20036-67)

Expand Down
3 changes: 0 additions & 3 deletions __tests__/e2e/integration/dummy-test.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,4 @@ describe('When a user try to verify his contract and it succeed', () => {
cy.visit('/')
})

it('Should see the title', () => {
cy.get('[data-cy=title]').should('be.visible')
})
})
5 changes: 4 additions & 1 deletion next-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
/// <reference types="next" />
/// <reference types="next/types/global" />
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
2 changes: 1 addition & 1 deletion next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ if (process.env.NODE_ENV !== 'production') {
const getAllAllowedEnvironmentVariables = () => {
return Object.entries(process.env).reduce(
(vars, [name, value]) =>
/^(?:__|NODE_)/.test(name) ? vars : { ...vars, [name]: value },
/^(?:__|NODE_)/.test(name) || name === 'NEXT_RUNTIME' ? vars : { ...vars, [name]: value },
{}
)
}
Expand Down
9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,17 @@
"cypress": "start-server-and-test dev http://localhost:3000 cypress-run",
"local-ethereum": "ganache-cli"
},
"engines": {
"node": ">=18.0.0"
},
"dependencies": {
"antd": "^4.6.6",
"axios": "^1.2.6",
"formidable": "^1.2.2",
"moment": "^2.29.0",
"next": "^9.3.6",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"next": "^13.4.9",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-notifications": "^1.7.4",
"styled-components": "^5.1.0",
"styled-media-query": "^2.1.2",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React from "react";
import styled from "styled-components";
import { pStyled } from "..";
import styled from 'styled-components'

import { pStyled } from '..'

const DescriptionText = styled(pStyled)`
font-family: "Muli", sans-serif;
`;
font-family: 'Muli', sans-serif;
`

export default DescriptionText;
export default DescriptionText
13 changes: 7 additions & 6 deletions src/components/atomic_components/Text/variants/PageTitle.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import styled from "styled-components";
import { H1Styled } from "..";
import styled from 'styled-components'

import { H1Styled } from '..'

const PageTitle = styled(H1Styled)`
font-family: Montserrat;
font-weight: bold;
`;
font-family: Montserrat;
font-weight: bold;
`

export default PageTitle;
export default PageTitle
9 changes: 4 additions & 5 deletions src/components/atomic_components/Text/variants/Title.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import React from "react";
import styled from "styled-components";
import { H2Styled } from "..";
import styled from 'styled-components'

import { H2Styled } from '..'

const Title = styled(H2Styled)`
font-family: Montserrat;
font-weight: bold;
`;
`

export default Title;
export default Title
25 changes: 0 additions & 25 deletions src/pages/api/verify-file.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/pages/error.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const ErrorPage = () => {
return (
<>
{line}
{index != phrase.length - 1 && <br />}
{index !== phrase.length - 1 && <br />}
</>
)
})
Expand Down
15 changes: 7 additions & 8 deletions src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import UploadButton from '../components/UploadButton'
import { backgroundGray, primary, black } from '../theme/color'
import media from '../theme/media'
import {
DescriptionText,
PageTitle
} from '../components/atomic_components/Text/variants'

Expand All @@ -35,7 +34,7 @@ const FileVerification: NextPage<{}> = () => {
try {
const { error, message, hash, url, timestamp }: any =
await ApiClient.verifyFile(uploadedFile)
if (message == 'OK') {
if (message === 'OK') {
router.push(`/success?timestamp=${timestamp}&url=${url}&hash=${hash}`, '/success')
} else {
router.push('/error?error=' + error)
Expand Down Expand Up @@ -69,14 +68,14 @@ const FileVerification: NextPage<{}> = () => {
lg={{ span: 14, push: 2 }}
xl={{ span: 10, push: 3 }}
>
<Paragraph>
<IndexParagraph data-cy="first-paragraph">
<IndexParagraph data-cy="first-paragraph">
<Paragraph>
Izertis te permite contrastar un documento en tu poder con un
documento previamente notarizado en la RedT de Alastria. <br />
Para poder hacer la verificación adjunta tu archivo y haz click
en “ENVIAR”.
</IndexParagraph>
</Paragraph>
</Paragraph>
</IndexParagraph>
</Col>
</Row>

Expand Down Expand Up @@ -153,9 +152,9 @@ const IndexTitle = styled(PageTitle)`
`}
`

const IndexParagraph = styled(DescriptionText)`
const IndexParagraph = styled.div`
margin-bottom: 64px;
`
`

const IndexUploadContainer = styled(Upload)`
width: 100%;
Expand Down
Loading

0 comments on commit 00df17f

Please sign in to comment.