Skip to content

Commit

Permalink
Merge branch 'master' into refactor/fetch-backend
Browse files Browse the repository at this point in the history
  • Loading branch information
marluanespiritusanto committed Oct 10, 2023
2 parents 324c250 + bc40fb5 commit 226d0d6
Show file tree
Hide file tree
Showing 10 changed files with 510 additions and 35 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/build-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
contents: 'read'
id-token: 'write'
steps:
- uses: actions/checkout@v3.6.0
- uses: actions/checkout@v4.1.0
with:
persist-credentials: false

Expand All @@ -43,7 +43,7 @@ jobs:
# Automatic tag management and OCI Image Format Specification for labels
- name: Docker meta
id: meta
uses: docker/metadata-action@v4.6.0
uses: docker/metadata-action@v5.0.0
with:
# list of Docker images to use as base name for tags
images: |
Expand All @@ -65,10 +65,10 @@ jobs:
# Setup Docker Buildx to allow use of docker cache layers from GH
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3

- name: Login to Google Artifact Registry
uses: docker/login-action@v2.2.0
uses: docker/login-action@v3.0.0
with:
registry: us-docker.pkg.dev
username: _json_key
Expand All @@ -77,7 +77,7 @@ jobs:
# Build and push image to Google Artifact Registry, and possibly DockerHub
- name: Build & push
id: docker_build
uses: docker/build-push-action@v4.1.1
uses: docker/build-push-action@v5.0.0
with:
target: ${{ inputs.dockerfile_target }}
context: .
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Code Repository
uses: actions/checkout@v3.6.0
uses: actions/checkout@v4.1.0
with:
# Full git history is needed to get a proper
# list of changed files within `super-linter`
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:

steps:
- name: Checkout Code Repository
uses: actions/checkout@v3.6.0
uses: actions/checkout@v4.1.0

- run: echo "$AWS_EXPORTS_JSON" > src/aws-exports.js
shell: bash
Expand Down
9 changes: 4 additions & 5 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import React from 'react';
import type { Metadata } from 'next';

import { ReCaptchaProvider } from 'next-recaptcha-v3';
import { GoogleTagManagerBody, GoogleTagManagerHead } from '@thgh/next-gtm';
import { ReCaptchaProvider } from 'next-recaptcha-v3';
import type { Metadata } from 'next';
import React from 'react';

import Layout from '../components/layout';
import ThemeRegistry from '@/components/themes/ThemeRegistry';
import SnackAlert from '@/components/elements/alert';
import Layout from '../components/layout';

import '../../public/fonts/poppins_wght.css';
import '@aws-amplify/ui-react/styles.css';
Expand Down
3 changes: 2 additions & 1 deletion src/app/register/index.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
'use client';

import { useEffect } from 'react';

import BoxContentCenter from '@/components/elements/boxContentCenter';
import LandingChica2 from '../../../public/assets/landingChica.svg';
import { CardAuth } from '@/components/elements/cardAuth';
import { setCookie } from '../../actions';
import StepperRegister from './stepper';
import { useEffect } from 'react';

export default function Index() {
useEffect(() => {
Expand Down
5 changes: 2 additions & 3 deletions src/app/register/stepper/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,15 @@

import useMediaQuery from '@mui/material/useMediaQuery';
import Typography from '@mui/material/Typography';
import React, { useState, Fragment } from 'react';
import { useTheme } from '@mui/material/styles';
import StepLabel from '@mui/material/StepLabel';
import Stepper from '@mui/material/Stepper';
import Button from '@mui/material/Button';
// TODO: Use the <Link> component for navigation unless we have a specific requirement for using useRouter
import { useRouter } from 'next/navigation';
import Button from '@mui/material/Button';
import Step from '@mui/material/Step';
import Box from '@mui/material/Box';
import * as React from 'react';
import { useState, Fragment } from 'react';

import { routes } from '@/constants/routes';
import Step1 from './step1';
Expand Down
6 changes: 3 additions & 3 deletions src/app/register/stepper/step1.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ import {
RECAPTCHA_ISSUES_ERROR,
RECAPTCHA_VALIDATION_ERROR,
} from '@/constants';
import { CedulaInput, CustomProps } from '../../../common/interfaces';
import { GridContainer, GridItem } from '@/components/elements/grid';
import LoadingBackdrop from '@/components/elements/loadingBackdrop';
import { CitizensDataFlow } from '@/app/api/types/citizens.type';
import { TextBodyTiny } from '@/components/elements/typography';
import { useSnackAlert } from '@/components/elements/alert';
import { ButtonApp } from '@/components/elements/button';
import { CedulaInput, CustomProps } from '../../../common/interfaces';
import { cedulaSchema } from '../../../common/yup-schemas';
import { ButtonApp } from '@/components/elements/button';
import { Validations, unwrap } from '@/helpers';
import { CitizensDataFlow } from '@/app/api/types/citizens.type';

const TextMaskCustom = forwardRef<HTMLElement, CustomProps>(
function TextMaskCustom(props, ref: any) {
Expand Down
18 changes: 7 additions & 11 deletions src/app/register/stepper/step2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,19 @@ import {
import SentimentSatisfiedOutlinedIcon from '@mui/icons-material/SentimentSatisfiedOutlined';
import ArrowCircleLeftOutlinedIcon from '@mui/icons-material/ArrowCircleLeftOutlined';
import CameraAltOutlinedIcon from '@mui/icons-material/CameraAltOutlined';
import { useForm } from 'react-hook-form';
import { useCallback, useState } from 'react';
import { useForm } from 'react-hook-form';

import { ButtonApp, ButtonTextApp } from '@/components/elements/button';
import { GridContainer, GridItem } from '@/components/elements/grid';
import {
Step2Props,
TermsAndConditionsInput,
} from '../../../common/interfaces';
import { ButtonApp, ButtonTextApp } from '@/components/elements/button';
import { GridContainer, GridItem } from '@/components/elements/grid';
import { NON_ACCEPTED_TERMS_AND_CONDS_ERROR } from '@/constants';
import { useSnackAlert } from '@/components/elements/alert';
import Step2Modal from './step2Modal';
import { NON_ACCEPTED_TERMS_AND_CONDS_ERROR } from '@/constants';
import Link from 'next/link';

export default function Step2({
infoCedula,
Expand Down Expand Up @@ -122,15 +123,10 @@ export default function Step2({
/>
}
label={
// TODO: Add link to terms and conditions
<>
<a
// target="_blank"
// rel="noreferrer"
href="#"
>
<Link target="_blank" href="/terms">
Aceptar términos y políticas de privacidad
</a>{' '}
</Link>{' '}
<span className="text-error">*</span>
</>
}
Expand Down
16 changes: 11 additions & 5 deletions src/app/register/stepper/step3.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
'use client';

import {
Alert,
Box,
Expand All @@ -10,29 +11,29 @@ import {
} from '@mui/material';
import CheckCircleOutlineOutlinedIcon from '@mui/icons-material/CheckCircleOutlineOutlined';
import { RegistrationFlow, UpdateRegistrationFlowBody } from '@ory/client';
import { isUiNodeInputAttributes } from '@ory/integrations/ui';
import VisibilityOff from '@mui/icons-material/VisibilityOff';
import Visibility from '@mui/icons-material/Visibility';
import { yupResolver } from '@hookform/resolvers/yup';
import { useSearchParams } from 'next/navigation';
import { useEffect, useState } from 'react';
import { useForm } from 'react-hook-form';
import { useSearchParams } from 'next/navigation';

import {
CREATE_BROWSER_REGISTRATION_FLOW_ERROR,
CREATE_IDENTITY_ERROR,
VALIDATE_PASSWORD_ERROR,
} from '../../../constants';
import { GridContainer, GridItem } from '@/components/elements/grid';
import PasswordLevel, {
calculatePasswordStrength,
} from '@/components/elements/passwordLevel';
import { GridContainer, GridItem } from '@/components/elements/grid';
import { CitizenCompleteData, Step3Form } from '../../../common/interfaces';
import { useSnackAlert } from '@/components/elements/alert';
import { ButtonApp } from '@/components/elements/button';
import { step3Schema } from '../../../common/yup-schemas';
import { ButtonApp } from '@/components/elements/button';
import { Crypto, unwrap } from '@/helpers';
import { ory } from '@/lib/ory';
import { isUiNodeInputAttributes } from '@ory/integrations/ui';

export default function Step3({ handleNext, infoCedula }: any) {
const [flow, setFlow] = useState<RegistrationFlow>();
Expand All @@ -45,7 +46,7 @@ export default function Step3({ handleNext, infoCedula }: any) {
const [showPasswordConfirm, setShowPasswordConfirm] = useState(false);

const searchParams = useSearchParams();
let returnTo = searchParams?.get('return_to');
const returnTo = searchParams?.get('return_to');

useEffect(() => {
const fetchFlow = async () => {
Expand Down Expand Up @@ -147,6 +148,11 @@ export default function Step3({ handleNext, infoCedula }: any) {
updateRegistrationFlowBody,
});

if (returnTo) {
window.location.href = returnTo;
return;
}

handleNext();

if (continue_with) {
Expand Down
Loading

0 comments on commit 226d0d6

Please sign in to comment.