Skip to content

Commit

Permalink
Ajoute un bouton pour éditer les informations de son entreprise sur l…
Browse files Browse the repository at this point in the history
…a page gérer
  • Loading branch information
johangirod committed Mar 15, 2022
1 parent 4d0178d commit 44d6402
Show file tree
Hide file tree
Showing 13 changed files with 138 additions and 91 deletions.
4 changes: 2 additions & 2 deletions site/cypress/integration/mon-entreprise/english/navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ describe(`Navigation to income simulator using company name (${
})
it('should allow to retrieve company and show link corresponding to the legal status', function () {
cy.contains(
fr ? 'Rechercher votre entreprise ' : 'Search for a company '
fr ? 'Rechercher votre entreprise ' : 'Search for your company '
).click()
cy.get('input').first().type('menoz')
cy.contains('834364291').click()
Expand All @@ -66,7 +66,7 @@ describe(`Navigation to income simulator using company name (${
})
it('should allow auto entrepreneur to access the corresponding income simulator', function () {
cy.contains(
fr ? 'Rechercher votre entreprise ' : 'Search for a company '
fr ? 'Rechercher votre entreprise ' : 'Search for your company '
).click()
cy.get('input').first().type('johan girod')
cy.contains('834825614').click()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ describe('Simulateur salarié', function () {
.click()
cy.contains('Oui').click()
cy.wait(100)
cy.contains('Fermer').click()
})

it('should permit selecting the smic before part-time contrat', function () {
Expand Down
41 changes: 25 additions & 16 deletions site/source/components/ShareSimulationBanner/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import { TrackingContext } from '../../ATInternetTracking'
import { useParamsFromSituation } from '../utils/useSearchParamsSimulationSharing'
import { ShareSimulationPopup } from './ShareSimulationPopup'
import { PlacesDesEntreprisesButton } from '../PlaceDesEntreprises'
import { Link } from '@/design-system/typography/link'

export function useUrl() {
const language = useTranslation().i18n.language
Expand All @@ -38,6 +37,10 @@ export function useUrl() {
return siteUrl + path + '?' + searchParams.toString()
}

const ButtonLabel = styled.span`
margin-left: 1rem;
`

export default function ShareOrSaveSimulationBanner() {
const { t } = useTranslation()
const tracker = useContext(TrackingContext)
Expand All @@ -58,19 +61,21 @@ export default function ShareOrSaveSimulationBanner() {

return (
<>
<Spacing md />
<Spacing lg />
<Grid
container
className=" print-hidden"
gap={4}
justifyContent="space-evenly"
spacing={4}
justifyContent="center"
>
<Grid item xs={12} sm="auto">
<PopoverWithTrigger
title={t('shareSimulation.modal.title', 'Votre lien de partage')}
trigger={(buttonProps) => (
<Link
<Button
{...buttonProps}
light
size="XS"
onPress={(e) => {
tracker.click.set({
chapter1: 'feature:partage',
Expand All @@ -83,11 +88,13 @@ export default function ShareOrSaveSimulationBanner() {
buttonProps?.onPress?.(e)
}}
>
<Emoji emoji="🔗" />{' '}
<Trans i18nKey="shareSimulation.banner">
Générer un lien de partage
</Trans>
</Link>
<Emoji emoji="🔗" />
<ButtonLabel>
<Trans i18nKey="shareSimulation.banner">
Générer un lien de partage
</Trans>
</ButtonLabel>
</Button>
)}
small
>
Expand All @@ -97,12 +104,14 @@ export default function ShareOrSaveSimulationBanner() {

{typeof window.print === 'function' && (
<Grid item xs={12} sm="auto">
<Link onPress={() => window.print()}>
<Emoji emoji="🖨" />{' '}
<Trans i18nKey="ExportSimulation.Banner">
Imprimer ou sauvegarder en PDF
</Trans>
</Link>
<Button light size="XS" onPress={() => window.print()}>
<Emoji emoji="🖨" />
<ButtonLabel>
<Trans i18nKey="ExportSimulation.Banner">
Imprimer ou sauvegarder en PDF
</Trans>
</ButtonLabel>
</Button>
</Grid>
)}

Expand Down
2 changes: 1 addition & 1 deletion site/source/components/Simulation/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export default function Simulation({
)}
{existingCompany && (
<Banner icon="✏">
Ce simulateur a été prérempli avec les données de votre
Ce simulateur a été prérempli avec la situation de votre
entreprise.{' '}
<PopoverWithTrigger
trigger={(buttonProps) => (
Expand Down
71 changes: 48 additions & 23 deletions site/source/components/company/Details.tsx
Original file line number Diff line number Diff line change
@@ -1,37 +1,62 @@
import { Message } from '@/design-system'
import { Spacing } from '@/design-system/layout'
import { Strong } from '@/design-system/typography'
import { H4 } from '@/design-system/typography/heading'
import { Body } from '@/design-system/typography/paragraphs'
import { Trans } from 'react-i18next'
import styled from 'styled-components'
import SeeAnswersButton from '../conversation/SeeAnswersButton'
import Value from '../EngineValue'

export function CompanyDetails() {
return (
<StyledCompanyContainer>
<H4 data-test-id="currently-selected-company">
{' '}
<Value expression="entreprise . nom" linkToRule={false} />{' '}
<Value expression="entreprise . SIREN" linkToRule={false} />
</H4>
<Body>
<Trans>
Créee le{' '}
<Strong>
<Value
expression="entreprise . date de création"
linkToRule={false}
/>
</Strong>{' '}
et domiciliée à{' '}
<Strong>
<Value
expression="établissement . localisation"
linkToRule={false}
/>
</Strong>
</Trans>
</Body>
<div
css={`
display: flex;
align-items: flex-end;
gap: 1rem;
justify-content: flex-end;
`}
>
<div
css={`
flex: 1;
`}
>
<H4 data-test-id="currently-selected-company">
{' '}
<Value expression="entreprise . nom" linkToRule={false} />{' '}
<Value expression="entreprise . SIREN" linkToRule={false} />
</H4>
<Body>
<Trans>
Créee le{' '}
<Strong>
<Value
expression="entreprise . date de création"
linkToRule={false}
/>
</Strong>{' '}
et domiciliée à{' '}
<Strong>
<Value
expression="établissement . localisation"
linkToRule={false}
/>
</Strong>
</Trans>
</Body>
</div>
<div
css={`
text-align: right;
`}
>
<SeeAnswersButton />
<Spacing xs />
</div>
</div>
</StyledCompanyContainer>
)
}
Expand Down
6 changes: 3 additions & 3 deletions site/source/components/conversation/AnswerList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export default function AnswerList({ onClose }: AnswerListProps) {
{!!answeredAndPassedQuestions.length && (
<>
<H3>
<Trans>Données de simulation</Trans>
<Trans>Simulation en cours</Trans>
</H3>

<StepsTable {...{ rules: answeredAndPassedQuestions, onClose }} />
Expand All @@ -89,7 +89,7 @@ export default function AnswerList({ onClose }: AnswerListProps) {
{companyQuestions.length > 0 && (
<>
<H3>
<Trans>Données de l'entreprise</Trans>
<Trans>Mon entreprise</Trans>
</H3>
<StepsTable {...{ rules: companyQuestions, onClose }} />
<Spacing sm />
Expand All @@ -106,7 +106,7 @@ export default function AnswerList({ onClose }: AnswerListProps) {
dispatch(resetCompany())
}}
>
<Emoji emoji="🗑" /> <Trans>Effacer toutes mes données</Trans>
<Emoji emoji="🗑" /> <Trans>Supprimer toute ma situation</Trans>
</Button>
</div>
</>
Expand Down
2 changes: 1 addition & 1 deletion site/source/components/conversation/SeeAnswersButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default function SeeAnswersButton() {
return (
<PopoverWithTrigger
trigger={(buttonProps) => (
<Button {...buttonProps} size="XS" color="secondary" light>
<Button {...buttonProps} size="XS" light>
<Trans>Voir ma situation</Trans>
</Button>
)}
Expand Down
8 changes: 7 additions & 1 deletion site/source/design-system/message/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,13 @@ export function Message({
alt="icône signalant un texte informatif"
/>
))}
<div>{children}</div>
<div
css={`
flex: 1;
`}
>
{children}
</div>
</StyledMessage>
</ThemeProvider>
)
Expand Down
11 changes: 10 additions & 1 deletion site/source/locales/rules-en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5719,7 +5719,7 @@ dirigeant . indépendant . cotisations et contributions . début activité:
These contributions will be adjusted and regularized according to your actual income for the year of
These contributions will be adjusted and regularized according to your actual income for the year of exercise.
the year of the exercise. If your income is higher than the flat rate used to calculate your provisional
Expand Down Expand Up @@ -9057,6 +9057,15 @@ situation personnelle . domiciliation fiscale à l'étranger:
code SIRET.
titre.en: establishment
titre.fr: établissement
établissement . SIRET:
description.en: >
[automatic] The employee works in an establishment of the company,
identified by a SIRET code.
description.fr: >
Le salarié travaille dans un établissement de l'entreprise, identifié par un
code SIRET.
titre.en: '[automatic] SIRET'
titre.fr: SIRET
établissement . ZFU:
question.en: '[automatic] Does your establishment benefit from the Urban Free
Zone (ZFU) scheme?'
Expand Down
14 changes: 5 additions & 9 deletions site/source/locales/ui-en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@
"<0></0> Pour en savoir plus, rendez-vous sur le site <3>aquoiserventlescotisations":
urssaf:
fr</3>: <0></0> To find out more, go to <3>aquoiserventlescotisations.urssaf.fr</3>
"<0><0>Il n'existe pas encore de simulateur de revenu pour votre type d'entreprise sur ce site.</0><1>Si vous souhaitez que nous développions un nouveau simulateur, laissez-nous message en cliquant sur le bouton \"Faire une suggestion\" en bas de cette page.</1></0>":
<0><0>There is not yet an income simulator for your type of business on this
site.</0><1>If you would like us to develop a new simulator, leave us a
message by clicking on the "Make a suggestion" button at the bottom of this
page.</1></0>
<0>Activité mixte</0>: <0>Mixed activity</0>
"<0>Covid-19 et chômage partiel </0>: <3>Calculez votre indemnité</3>": "<0>Covid-19 and Short-Time </0>Work: <3>Calculate Your Benefit</3>"
<0>Oui</0>: <0>Yes</0>
Expand Down Expand Up @@ -69,8 +64,6 @@ Demande de mobilité: Demand for mobility
Destinataire: Levied by
Devenir: Become
"Domiciliée à l'adresse :": "Domiciled at the address :"
Données de l'entreprise: Company data
Données de simulation: Simulation data
Déclenchement: Applicability
Découvrir: Discover
"Décrivez votre projet ou votre problème en donnant quelques éléments de contexte. Nous identifions, parmi l’ensemble des partenaires publics et parapublics, le conseiller compétent pour votre demande. Celui-ci vous contacte par téléphone sous 5 jours et vous accompagne en fonction de votre situation.":
Expand All @@ -82,7 +75,6 @@ Démarches de création: Creation process checklist
Désactivée: Inactive
Détail annuel des cotisations: Annual detail of my contributions
Effacer: Reset
Effacer toutes mes données: Delete all my data
Embauche: Hiring process
Employeur: Employer
En incluant l'indemnité de chômage partiel: Including short-time working allowance
Expand Down Expand Up @@ -172,7 +164,8 @@ Quelques exemples de salaires: Some salary exemples
Quelques intégrations: Some integrations
Recherche en cours...: Searching...
Rechercher: Search
Rechercher votre entreprise: Search for a company
Rechercher une entreprise: Search for a company
Rechercher votre entreprise: Search for your company
Recommencer: Start again
Recommencer la simulation: Start the simulation again
Rend non applicable les règles suivantes: Makes the following rules not applicable
Expand Down Expand Up @@ -208,11 +201,13 @@ Sans responsabilité limitée: Without limited liability
Si: If
Simulateur de salaire: Employee salary simulation
Simulateurs: Simulations
Simulation en cours: Simulation in progress
Simulations personnalisées: Customized simulations
Sinon: Else
Situation personnelle: Personal situation
"Siège :": "Headquarters:"
Suivant: Next
Supprimer toute ma situation: Delete my entire situation
Taux: Rate
Taux calculé: Calculated rate
Taux moyen: Average rate
Expand All @@ -232,6 +227,7 @@ Voir la répartition des cotisations: View contribution breakdown
Voir le code source: See the source code
Voir les autres simulateurs: See the other simulators
Voir ma situation: See my situation
Voir mes paramètres: See my situation
Votre adresse e-mail: Your email address
Votre entreprise: Your company
Votre forme juridique: Your legal status
Expand Down
Loading

0 comments on commit 44d6402

Please sign in to comment.