diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS deleted file mode 100644 index a01885a6..00000000 --- a/.github/CODEOWNERS +++ /dev/null @@ -1,3 +0,0 @@ -docs/ @vtex-apps/technical-writers -messages/ @vtex-apps/localization -* @vtex-apps/us-1st-party-apps diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index cddd619c..00000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -name: Bug report -about: Create a report to help us improve ---- - -**Describe the bug** -A clear and concise description of what the bug is. - -**To Reproduce** -Steps to reproduce the behavior: - -1. Go to '...' -2. Click on '....' -3. Scroll down to '....' -4. See error - -**Expected behavior** -A clear and concise description of what you expected to happen. - -**Screenshots** -If applicable, add screenshots to help explain your problem. - -**Additional context** -Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md deleted file mode 100644 index a09db44f..00000000 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -name: Feature request -about: Suggest an idea for this project ---- - -**Is your feature request related to a problem? Please describe.** -A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] - -**Describe the solution you'd like** -A clear and concise description of what you want to happen. - -**Describe alternatives you've considered** -A clear and concise description of any alternative solutions or features you've considered. - -**Additional context** -Add any other context or screenshots about the feature request here. diff --git a/.github/ISSUE_TEMPLATE/questions-and-help.md b/.github/ISSUE_TEMPLATE/questions-and-help.md deleted file mode 100644 index 7881b506..00000000 --- a/.github/ISSUE_TEMPLATE/questions-and-help.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -name: Question -about: Ask a question you had while building a store -labels: question ---- - -**What are you trying to accomplish? Please describe.** -A clear and concise description of what is your question and what you're trying to accomplish in the end is. - -**What have you tried so far?** -A clear and concise description of what you tried to do already. - -**Additional info** -Add extra content here (code samples, screenshots,...) - -| Account | Workspace | -| -------------- | ---------------- | -| `your account` | `your workspace` | diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index 1a4cb0ae..00000000 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,27 +0,0 @@ -#### What problem is this solving? - - - -#### How to test it? - - - -[Workspace](Link goes here!) - -#### Screenshots or example usage: - - - -#### Describe alternatives you've considered, if any. - - - -#### Related to / Depends on - - - -#### How does this PR make you feel? [:link:](http://giphy.com/) - - - -![](put .gif link here - can be found under "advanced" on giphy) diff --git a/docs/README.md b/docs/README.md index a3a0ac62..0416d694 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,4 +1,4 @@ -= Use this project, [contribute](https://github.com/vtex-apps/b2b-organizations) to it or open issues to help evolve it using [Store Discussion](https://github.com/vtex-apps/store-discussion). +=� Use this project, [contribute](https://github.com/vtex-apps/b2b-organizations) to it or open issues to help evolve it using [Store Discussion](https://github.com/vtex-apps/store-discussion). # B2B Organizations @@ -307,7 +307,7 @@ This will lead you to the **Cost Center Details** page, where you can: The optional **Business Document** field may be used to store a Tax ID, VAT ID, CNPJ, or similar business identifier. If a Business Document is present in a user's cost center, it will be applied as the `corporateDocument` in the user's profile and therefore attached to any orders placed by the user. ->  The shipping addresses assigned to a cost center will be available to that cost center's users at checkout if you install [B2B Checkout Settings](https://developers.vtex.com/vtex-developer-docs/docs/vtex-b2b-checkout-settings). No other addresses will be available. Therefore, each cost center must have at least one shipping address. +> � The shipping addresses assigned to a cost center will be available to that cost center's users at checkout if you install [B2B Checkout Settings](https://developers.vtex.com/vtex-developer-docs/docs/vtex-b2b-checkout-settings). No other addresses will be available. Therefore, each cost center must have at least one shipping address. To edit or delete an existing address, click next to it and select **Edit** or **Delete**. @@ -454,9 +454,14 @@ A B2B user who is not already part of an organization can request the creation o - **First Name:** first name of the Organization Admin user. - **Last Name:** last name of the Organization Admin user. - **Email Address:** email address of the Organization Admin user. + - **CPF:** CPF of the Organization Admin user. + - **Phone:** Phone of the Organization Admin user. - **Default Cost Center:** section where you must provide information about the first cost center associated with the organization. - **Cost Center Name:** name of the cost center. - - **Business Document:** optional field for a business document such as a Tax ID, CNPJ, etc. + - **Business Document:** field for a business document such as a Tax ID, CNPJ, etc. + - **Occupation Area:** field for a occupation area. + - **ICMS:** field for a ICMS. + - **IE:** field for a IE. - **Country:** country where the cost center is located. - **ZIP:** postal code of the cost center address. - **Address Line 1:** primary address information, including street number and street name where the cost center is located. @@ -502,7 +507,7 @@ To add a new cost center, they should go to **My Account > My Organization**, wh In addition, **Organization Admins** can enable specific payment terms for a cost center, by using the toggle button to activate or deactivate the payment terms assigned to the organization, as shown below. ->  This section will only be available on the **My Organization** page if [payment terms](#payment-terms) have previously been assigned to the organization by the VTEX Admin users. +> � This section will only be available on the **My Organization** page if [payment terms](#payment-terms) have previously been assigned to the organization by the VTEX Admin users. ![19-payment-terms-cost-center](https://user-images.githubusercontent.com/77292838/159766775-dd0a17bd-8418-401b-a377-7d4c9ed0cf11.png) diff --git a/manifest.json b/manifest.json index b8728b5c..e4b430a0 100644 --- a/manifest.json +++ b/manifest.json @@ -9,7 +9,7 @@ "postreleasy": "vtex publish" }, "dependencies": { - "vtex.b2b-organizations-graphql": "0.x", + "hermespardini.b2b-organizations-graphql": "0.x", "vtex.catalog-graphql": "1.x", "vtex.admin-graphql": "2.x", "vtex.store-graphql": "2.x", @@ -27,8 +27,7 @@ "admin": "0.x", "messages": "1.x", "docs": "0.x", - "store": "0.x", - "vtex.storefront-permissions": "1.x" + "store": "0.x" }, "$schema": "https://raw.githubusercontent.com/vtex/node-vtex-api/master/gen/manifest.schema" } diff --git a/messages/context.json b/messages/context.json index b2096682..168c0709 100644 --- a/messages/context.json +++ b/messages/context.json @@ -164,6 +164,8 @@ "store/b2b-organizations.request-new-organization.first-name.label": "store/b2b-organizations.request-new-organization.first-name.label", "store/b2b-organizations.request-new-organization.last-name.label": "store/b2b-organizations.request-new-organization.last-name.label", "store/b2b-organizations.request-new-organization.email.label": "store/b2b-organizations.request-new-organization.email.label", + "store/b2b-organizations.request-new-organization.cpf.label": "store/b2b-organizations.request-new-organization.cpf.label", + "store/b2b-organizations.request-new-organization.telephone.label": "store/b2b-organizations.request-new-organization.telephone.label", "store/b2b-organizations.request-new-organization.default-cost-center.title": "store/b2b-organizations.request-new-organization.default-cost-center.title", "store/b2b-organizations.request-new-organization.default-cost-center-name.label": "store/b2b-organizations.request-new-organization.default-cost-center-name.label", "store/b2b-organizations.request-new-organization.submit-button.label": "store/b2b-organizations.request-new-organization.submit-button.label", @@ -275,5 +277,31 @@ "store/b2b-organizations.user-widget.impersonating": "store/b2b-organizations.user-widget.impersonating", "store/b2b-organizations.request-new-organization.submit-button.create-new-request": "store/b2b-organizations.request-new-organization.submit-button.create-new-request", "store/b2b-organizations.stop-impersonation": "store/b2b-organizations.stop-impersonation", - "store/b2b-organizations.stop-impersonation-error": "store/b2b-organizations.stop-impersonation-error" + "store/b2b-organizations.stop-impersonation-error": "store/b2b-organizations.stop-impersonation-error", + "store/b2b-organizations.request-new-organization.newsletter.label": "store/b2b-organizations.request-new-organization.newsletter.label", + "store/b2b-organizations.request-new-organization.proof-attachment-description": "store/b2b-organizations.request-new-organization.proof-attachment-description", + "store/b2b-organizations.request-new-organization.proof-attachment": "store/b2b-organizations.request-new-organization.proof-attachment", + "store/b2b-organizations.request-new-organization.accept-terms-and-conditions": "store/b2b-organizations.request-new-organization.accept-terms-and-conditions", + "store/b2b-organizations.request-new-organization.privacyPolicies.label": "store/b2b-organizations.request-new-organization.privacyPolicies.label", + "store/b2b-organizations.request-new-organization.user-data":"store/b2b-organizations.request-new-organization.user-data", + "store/b2b-organizations.request-new-organization.form-container-subtitle":"store/b2b-organizations.request-new-organization.form-container-subtitle", + "store/b2b-organizations.request-new-organization.organization-data":"store/b2b-organizations.request-new-organization.organization-data", + "store/b2b-organizations.request-new-organization.organization-data-description":"store/b2b-organizations.request-new-organization.organization-data-description", + "store/b2b-organizations.request-new-organization.cnpj.label":"store/b2b-organizations.request-new-organization.cnpj.label", + "store/b2b-organizations.request-new-organization.free":"store/b2b-organizations.request-new-organization.free", + "store/b2b-organizations.request-new-organization.yes":"store/b2b-organizations.request-new-organization.yes", + "store/b2b-organizations.request-new-organization.no":"store/b2b-organizations.request-new-organization.no", + "store/b2b-organizations.request-new-organization.occupationArea":"store/b2b-organizations.request-new-organization.occupationArea", + "store/b2b-organizations.request-new-organization.occupationAreaDescription":"store/b2b-organizations.request-new-organization.occupationAreaDescription", + "store/b2b-organizations.request-new-organization.landline.label":"store/b2b-organizations.request-new-organization.landline.label", + "store/b2b-organizations.request-new-organization.register-billing-address":"store/b2b-organizations.request-new-organization.register-billing-address", + "store/b2b-organizations.request-new-organization.register-billing-address-description":"store/b2b-organizations.request-new-organization.register-billing-address-description", + "store/b2b-organizations.request-new-organization.form-title":"store/b2b-organizations.request-new-organization.form-title", + "store/b2b-organizations.request-new-organization.form-subtitle":"store/b2b-organizations.request-new-organization.form-subtitle", + "store/b2b-organizations.request-new-organization.form-title-description":"store/b2b-organizations.request-new-organization.form-title-description", + "store/b2b-organizations.request-new-organization.attach-file.label":"store/b2b-organizations.request-new-organization.attach-file.label", + "store/b2b-organizations.request-new-organization.attach-file.acceptedFormats":"store/b2b-organizations.request-new-organization.attach-file.acceptedFormats", + "store/b2b-organizations.request-new-organization.required-fields-panel.title":"store/b2b-organizations.request-new-organization.required-fields-panel.title", + "store/b2b-organizations.request-new-organization.state-registration-initials": "store/b2b-organizations.request-new-organization.state-registration-initials", + "store/b2b-organizations.request-new-organization.required-fields-panel.user-data": "store/b2b-organizations.request-new-organization.required-fields-panel.user-data" } diff --git a/messages/en.json b/messages/en.json index 0645b5de..f4be417f 100644 --- a/messages/en.json +++ b/messages/en.json @@ -89,7 +89,7 @@ "admin/b2b-organizations.organization-details.button.remove-user-confirm": "Yes, remove user", "admin/b2b-organizations.organization-details.button.new": "New", "admin/b2b-organizations.organization-details.button.add": "Add", - "admin/b2b-organizations.organization-details.costCenters": "Cost Centers", + "admin/b2b-organizations.organization-details.costCenters": "Unidades de Negócio / Filiais", "admin/b2b-organizations.organization-details.status.active": "Active", "admin/b2b-organizations.organization-details.status.on-hold": "On Hold", "admin/b2b-organizations.organization-details.status.inactive": "Inactive", @@ -147,7 +147,7 @@ "admin/b2b-organizations.user-details.placeholder-costCenter": "Select a cost center", "admin/b2b-organizations.user-details.role": "Role", "admin/b2b-organizations.user-details.placeholder-role": "Select a role", - "store/b2b-organizations.my-account-link": "My Organization", + "store/b2b-organizations.my-account-link": "Company registration", "store/b2b-organizations.back": "Back", "store/b2b-organizations.selected-rows": "Selected rows: {qty}", "store/b2b-organizations.showRows": "Show rows", @@ -157,13 +157,11 @@ "store/b2b-organizations.autocomplete-searching": "Search organization", "store/b2b-organizations.not-authenticated": "You must be logged in to access this content.", "store/b2b-organizations.request-new-organization.title": "Request New Organization", - "store/b2b-organizations.request-new-organization.organization-name.label": "Organization name", - "store/b2b-organizations.request-new-organization.tradeName": "Trade name", - "store/b2b-organizations.request-new-organization.tradeName.helpText": "Provide the organization's trade name, which will be applied in checkout, if any. (Optional)", - "store/b2b-organizations.request-new-organization.b2b-customer-admin.title": "User that will become the Organization Admin", - "store/b2b-organizations.request-new-organization.first-name.label": "First name", - "store/b2b-organizations.request-new-organization.last-name.label": "Last name", - "store/b2b-organizations.request-new-organization.email.label": "Email", + "store/b2b-organizations.request-new-organization.organization-name.label": "Organization Name", + "store/b2b-organizations.request-new-organization.b2b-customer-admin.title": "User to become Organization Admin", + "store/b2b-organizations.request-new-organization.first-name.label": "First Name", + "store/b2b-organizations.request-new-organization.last-name.label": "Last Name", + "store/b2b-organizations.request-new-organization.email.label": "Email Address", "store/b2b-organizations.request-new-organization.default-cost-center.title": "Default Cost Center", "store/b2b-organizations.request-new-organization.default-cost-center-name.label": "Cost center name", "store/b2b-organizations.request-new-organization.submit-button.label": "Submit", @@ -174,13 +172,13 @@ "store/b2b-organizations.request-new-organization.helpText": "Please fill out the following form to request the creation of a new organization.", "store/b2b-organizations.request-new-organization.b2b-customer-admin.helpText": "The user below will be assigned as the admin of the new organization. They will be notified via email when the organization has been approved and created. Additional users may be assigned to the organization by this admin after the organization has been created.", "store/b2b-organizations.request-new-organization.default-cost-center.helpText": "Provide a name and address for the organization's initial cost center. Additional cost centers and addresses may be added after the organization has been created.", - "store/b2b-organizations.request-new-organization.pending-request": "Your organization request submitted on {created} is pending approval. The user who submitted it as the organization admin will receive an email when the approval process is complete.", - "store/b2b-organizations.request-new-organization.approved-request": "Your organization has been created. Users who have been added to the organization can view and/or manage organizational details by logging in and going to My Account > My Organization.", - "store/b2b-organizations.request-new-organization.declined-request": "Your organization request submitted on {created} has been declined.", + "store/b2b-organizations.request-new-organization.pending-request": "Your organization request submitted {created} is pending approval. The user submitted as the organization admin will receive an email when the approval process is complete.", + "store/b2b-organizations.request-new-organization.approved-request": "Your requested organization has been created. Users who have been added to the organization can view and/or manage organizational details by logging in and going to My Account > My Organization.", + "store/b2b-organizations.request-new-organization.declined-request": "Your organization request submitted {created} has been declined.", "store/b2b-organizations.request-new-organization.phoneNumber": "Phone number", "store/b2b-organizations.request-new-organization.phoneNumber.helpText": "Provide a phone number for this cost center. This will be shown in checkout for any users belonging to this cost center. (Optional)", "store/b2b-organizations.request-new-organization.businessDocument": "Business document", - "store/b2b-organizations.request-new-organization.businessDocument.helpText": "Provide a business document for this cost center. This can be the company registration number, Tax ID, VAT ID, or others and will be attached to the cost center's orders. (Optional)", + "store/b2b-organizations.request-new-organization.businessDocument.helpText": "Optionally provide a business document for the default cost center. This can be a tax ID, VAT ID, CNPJ, or other document and will be attached to the cost center's orders.", "store/b2b-organizations.organization-details.toast.add-costCenter-success": "Cost center created successfully", "store/b2b-organizations.organization-details.toast.add-costCenter-failure": "Cost center creation failed. See console for details.", "store/b2b-organizations.organization-details.table.column-name.title": "Name", @@ -197,8 +195,8 @@ "store/b2b-organizations.organization-details.button.new": "New", "store/b2b-organizations.organization-details.button.add": "Add", "store/b2b-organizations.organization-details.costCenters": "Cost Centers", - "store/b2b-organizations.organization-details.add-costCenter": "Add Cost Center", - "store/b2b-organizations.organization-details.add-costCenter.helpText": "Provide a default address for the cost center. Additional addresses may be added later.", + "store/b2b-organizations.organization-details.add-costCenter": "Add cost center", + "store/b2b-organizations.organization-details.add-costCenter.helpText": "Provide a default address for the cost center. Additional addresses may be added after creation.", "store/b2b-organizations.organization-details.users": "Users", "store/b2b-organizations.organization-details.add-user": "Add New User", "store/b2b-organizations.organization-details.add-user.helpText": "If the email address you entered does not match an existing user account in this store, a user account will be created for them.", @@ -275,5 +273,28 @@ "store/b2b-organizations.user-widget.impersonating": "Impersonating:", "store/b2b-organizations.request-new-organization.submit-button.create-new-request": "Create New Request", "store/b2b-organizations.stop-impersonation": "Stop Impersonation", - "store/b2b-organizations.stop-impersonation-error": "Error stopping impersonation. See console for details." + "store/b2b-organizations.stop-impersonation-error": "Error stopping impersonation, see console for details.", + "store/b2b-organizations.request-new-organization.required-fields-panel.user-data": "User data", + "store/b2b-organizations.request-new-organization.newsletter.label": "I would like to receive a newsletter with promotions about Pardis", + "store/b2b-organizations.request-new-organization.privacyPolicies.label": "I agree with the Terms and Conditions and Privacy Policy", + "store/b2b-organizations.request-new-organization.state-registration-initials": "IE", + "store/b2b-organizations.request-new-organization.user-data": "User Data", + "store/b2b-organizations.request-new-organization.form-container-subtitle": "The user below will be assigned as the organization's administrator, and will be notified by email when the registration is approved.", + "store/b2b-organizations.request-new-organization.organization-data": "Company data", + "store/b2b-organizations.request-new-organization.organization-data-description": "Os dados a serem informados devem ser os mesmos do cartão CNPJ.", + "store/b2b-organizations.request-new-organization.cnpj.label": "CNPJ", + "store/b2b-organizations.request-new-organization.free": "Free", + "store/b2b-organizations.request-new-organization.yes": "Yes", + "store/b2b-organizations.request-new-organization.no": "No", + "store/b2b-organizations.request-new-organization.occupationArea": "Occupation Area", + "store/b2b-organizations.request-new-organization.occupationAreaDescription": "Description of the area of ​​activity", + "store/b2b-organizations.request-new-organization.landline.label": "Telephone", + "store/b2b-organizations.request-new-organization.register-billing-address": "Registration/Billing Address", + "store/b2b-organizations.request-new-organization.register-billing-address-description": "The delivery address can be entered in my account in my organization/cost center as long as it is within the same state (UF) as the registration address informed above.", + "store/b2b-organizations.request-new-organization.form-title": "Register your company and get access to exclusive benefits", + "store/b2b-organizations.request-new-organization.form-subtitle": "Fill in the form below to access our catalog and make your purchases on our website.", + "store/b2b-organizations.request-new-organization.form-title-description": "Your registration will undergo an analysis and you will receive a response within 24 business hours.", + "store/b2b-organizations.request-new-organization.attach-file.acceptedFormats": "Supported formats: jpg, png and pdf", + "store/b2b-organizations.request-new-organization.required-fields-panel.title": "To proceed, fill in all mandatory fields:" + } diff --git a/messages/pt.json b/messages/pt.json index dc235dc2..cb665f8a 100644 --- a/messages/pt.json +++ b/messages/pt.json @@ -157,7 +157,6 @@ "store/b2b-organizations.autocomplete-searching": "Buscar organização", "store/b2b-organizations.not-authenticated": "Você precisa estar conectado para acessar este conteúdo.", "store/b2b-organizations.request-new-organization.title": "Solicitar nova organização", - "store/b2b-organizations.request-new-organization.organization-name.label": "Nome da organização", "store/b2b-organizations.request-new-organization.tradeName": "Nome fantasia", "store/b2b-organizations.request-new-organization.tradeName.helpText": "Insira o nome fantasia da organização que será aplicado no checkout, se houver. (Opcional)", "store/b2b-organizations.request-new-organization.b2b-customer-admin.title": "Usuário que será o Admin da organização", @@ -275,5 +274,34 @@ "store/b2b-organizations.user-widget.impersonating": "Personificando:", "store/b2b-organizations.request-new-organization.submit-button.create-new-request": "Criar nova solicitação", "store/b2b-organizations.stop-impersonation": "Interromper personificação", - "store/b2b-organizations.stop-impersonation-error": "Erro ao interromper a personificação. Consulte o console para mais detalhes." -} + "store/b2b-organizations.stop-impersonation-error": "Erro ao interromper a personificação. Consulte o console para mais detalhes.", + "store/b2b-organizations.request-new-organization.form-title": "Cadastre sua empresa e tenha acesso a benefícios exclusivos", + "store/b2b-organizations.request-new-organization.form-subtitle": "Preencha o formulário abaixo para ter acesso ao nosso catálogo e realizar suas compras em nosso site", + "store/b2b-organizations.request-new-organization.form-title-description": "Seu cadastro passará por uma análise e você receberá o retorno em até 24 horas úteis.", + "store/b2b-organizations.request-new-organization.user-data": "Dados do usuário", + "store/b2b-organizations.request-new-organization.form-container-subtitle": "O usuário abaixo será atribuído como administrador da organização, e será notificado por e-mail quando o cadastro for aprovado.", + "store/b2b-organizations.request-new-organization.organization-data": "Dados da empresa", + "store/b2b-organizations.request-new-organization.organization-data-description": "Os dados a serem informados devem ser os mesmos do cartão CNPJ.", + "store/b2b-organizations.request-new-organization.cnpj.label": "CNPJ", + "store/b2b-organizations.request-new-organization.organization-name.label": "Razão Social", + "store/b2b-organizations.request-new-organization.free": "Isento", + "store/b2b-organizations.request-new-organization.yes": "Sim", + "store/b2b-organizations.request-new-organization.no": "Não", + "store/b2b-organizations.request-new-organization.occupationArea": "Área de atuação", + "store/b2b-organizations.request-new-organization.occupationAreaDescription": "Descrição da área de atuação", + "store/b2b-organizations.request-new-organization.landline.label": "Telefone", + "store/b2b-organizations.request-new-organization.register-billing-address": "Endereço de Cadastro/Faturamento", + "store/b2b-organizations.request-new-organization.register-billing-address-description": "O endereço de entrega poderá ser inserido na minha conta em minha organização/centro de custo desde que seja dentro do mesmo estado (UF) do endereço de cadastro informado acima.", + "store/b2b-organizations.request-new-organization.proof-attachment": "Anexo de Comprovantes", + "store/b2b-organizations.request-new-organization.proof-attachment-description": "Comercializamos itens de uso restrito, conforme legislação, por isso é necessário anexar o documento abaixo: Licença Sanitária Municipal Vigente", + "store/b2b-organizations.request-new-organization.attach-file.label": "Anexar arquivos", + "store/b2b-organizations.request-new-organization.attach-file.acceptedFormats": "Formatos aceitos: jpg, png e pdf", + "store/b2b-organizations.request-new-organization.newsletter.label": "Gostaria de receber newsletter com promoções sobre a Pardis", + "store/b2b-organizations.request-new-organization.privacyPolicies.label": "Estou de acordo com os Termos e Condições e Políticas de Privacidade", + "store/b2b-organizations.request-new-organization.required-fields-panel.title": "Para avançar preencha todos os campos obrigatórios:", + "store/b2b-organizations.request-new-organization.required-fields-panel.user-data": "Dados do usuário", + "store/b2b-organizations.request-new-organization.cpf.label": "CPF", + "store/b2b-organizations.request-new-organization.telephone.label": "Celular", + "store/b2b-organizations.request-new-organization.accept-terms-and-conditions": "Aceitar termos e condições", + "store/b2b-organizations.request-new-organization.state-registration-initials": "IE" +} \ No newline at end of file diff --git a/react/MyOrganizationLink.tsx b/react/MyOrganizationLink.tsx index a736be3b..7a701cac 100644 --- a/react/MyOrganizationLink.tsx +++ b/react/MyOrganizationLink.tsx @@ -1,18 +1,9 @@ import type { FC } from 'react' -import { defineMessages, useIntl } from 'react-intl' - -const messages = defineMessages({ - linkText: { - id: 'store/b2b-organizations.my-account-link', - }, -}) const MyOrganizationLink: FC = ({ render }: any) => { - const { formatMessage } = useIntl() - return render([ { - name: formatMessage(messages.linkText), + name: 'Cadastro da empresa', path: '/organization', }, ]) diff --git a/react/admin/OrganizationRequestDetails.tsx b/react/admin/OrganizationRequestDetails.tsx index 1cdd714e..307f1f79 100644 --- a/react/admin/OrganizationRequestDetails.tsx +++ b/react/admin/OrganizationRequestDetails.tsx @@ -152,6 +152,11 @@ const OrganizationRequestDetails: FunctionComponent = () => {
{data.getOrganizationRequestById.b2bCustomerAdmin.email} +
+ {data.getOrganizationRequestById.b2bCustomerAdmin.cpf} +
+ {data.getOrganizationRequestById.b2bCustomerAdmin.telephone} +

@@ -183,8 +188,25 @@ const OrganizationRequestDetails: FunctionComponent = () => { /> )} + Tipo: {data.getOrganizationRequestById.defaultCostCenter.type} +
+ Publico:{' '} + {data.getOrganizationRequestById.defaultCostCenter.organizationPublic} +
+ Inscrição estadual:{' '} + {data.getOrganizationRequestById.defaultCostCenter.ie} +
+ ICMS:{' '} + {data.getOrganizationRequestById.defaultCostCenter.icms + ? 'Sim' + : 'Não'} +
+ Area de atuação:{' '} + {data.getOrganizationRequestById.defaultCostCenter.area} +
+ Telefone: {data.getOrganizationRequestById.defaultCostCenter.phone} +

- = ({ } required /> -
- ) => { - setPhoneNumber(e.target.value) - }} - readOnly={ - !permissionsState.includes('create-cost-center-organization') - } - /> -
-
- ) => { - setBusinessDocument(e.target.value) - }} - readOnly={ - !permissionsState.includes('create-cost-center-organization') - } - /> -
+ + + ) => { + setBusinessDocument(e.target.value) + }} + readOnly={ + !permissionsState.includes('create-cost-center-organization') + } + /> {paymentTermOptions.length > 0 && ( = ({ useEffect(() => { if (!permissionsData) return - const { permissions = [], role } = permissionsData.checkUserPermission ?? {} + const { permissions = [] } = permissionsData.checkUserPermission ?? {} if (permissions.length) { setPermissionsState(permissions) diff --git a/react/components/RequestOrganizationForm.tsx b/react/components/RequestOrganizationForm.tsx index 45441e56..1520686f 100644 --- a/react/components/RequestOrganizationForm.tsx +++ b/react/components/RequestOrganizationForm.tsx @@ -1,14 +1,15 @@ import type { FC } from 'react' -import React, { useState, useContext, useEffect, Fragment } from 'react' +import React, { useRef, useState, useContext, useEffect, Fragment } from 'react' import { Input, Button, ToastContext, Layout, - PageHeader, PageBlock, Alert, Spinner, + Dropdown, + Checkbox, } from 'vtex.styleguide' import { AddressRules, @@ -23,22 +24,28 @@ import { useCssHandles } from 'vtex.css-handles' import { useQuery, useMutation } from 'react-apollo' import { useIntl, FormattedMessage } from 'react-intl' import { useRuntime } from 'vtex.render-runtime' -import 'vtex.country-codes/locales' +import 'vtex.country-codes/locales' import { organizationRequestMessages as messages } from './utils/messages' import storageFactory from '../utils/storage' import { getSession } from '../modules/session' -import { validateEmail, validatePhoneNumber } from '../modules/formValidators' -import { getEmptyAddress, isValidAddress } from '../utils/addresses' +// import { validateEmail } from '../modules/formValidators' +// import { getEmptyAddress, isValidAddress } from '../utils/addresses' +import { getEmptyAddress } from '../utils/addresses' import CREATE_ORGANIZATION_REQUEST from '../graphql/createOrganizationRequest.graphql' import GET_ORGANIZATION_REQUEST from '../graphql/getOrganizationRequest.graphql' import GET_LOGISTICS from '../graphql/getLogistics.graphql' +import '../styles.global.css' +import createOrganization from '../requests/createOrganization' +import attachFileToEntity from '../utils/attachFileToEntity' +import { masterData, types } from '../config/masterdata' const localStore = storageFactory(() => localStorage) let requestId = localStore.getItem('b2b-organizations_orgRequestId') ?? '' const useSessionResponse = () => { const [session, setSession] = useState() + const sessionPromise = getSession() useEffect(() => { @@ -78,12 +85,112 @@ const CreateNewOrganizationRequest = (props: any) => { ) } +interface ModalMessage { + title: string + message: string + buttonText: string + buttonLink: string + active: boolean +} + +function formataCNPJ(cnpj: string) { + // retira os caracteres indesejados... + cnpj = cnpj.replace(/[^\d]/g, '') + + // realizar a formatação... + return cnpj.replace(/(\d{2})(\d{3})(\d{3})(\d{4})(\d{2})/, '$1.$2.$3/$4-$5') +} + +function formataCPF(cpf: string) { + // retira os caracteres indesejados... + cpf = cpf.replace(/[^\d]/g, '') + + // realizar a formatação... + return cpf.replace(/(\d{3})(\d{3})(\d{3})(\d{2})/, '$1.$2.$3-$4') +} + +function formataPhone(phone: string) { + // retira os caracteres indesejados... + phone = phone.replace(/[^\d]/g, '') + + // realizar a formatação... + return phone.replace(/(\d{2})(\d{5})(\d{4})/, '($1) $2-$3') +} + +function formataPhoneEmpresa(phone: string) { + // retira os caracteres indesejados... + phone = phone.replace(/[^\d]/g, '') + + // realizar a formatação... + return phone.replace(/(\d{2})(\d{2})(\d{5})(\d{4})/, '+$1 ($2) $3-$4') +} + +function removeLettersAndSymbols(text: string) { + // retira os caracteres indesejados... + return text.replace(/[^\d]/g, '') +} + +const ModalOrganizationMessage = (props: any) => { + const { settings } = props + + return ( + + {settings.active ? ( + + ) : null} + + ) +} + +const PendingItem = ({ children }: { children: string }) => { + return ( + + {children} + + ) +} + +const organizationAreaOthersValue = 'others' + const RequestOrganizationForm: FC = () => { const { formatMessage, formatDate } = useIntl() const { culture: { country }, } = useRuntime() + const countryStateInputInterval: { current: number | null } = useRef(null) + + const [modalSettings, setModalSettings] = useState({ + title: 'Cadastro enviado!', + message: + 'Vamos analisar os dados enviados e liberar o seu cadastro. Aguarde nosso e-mail com mais informações e liberar seu cadastro em até 24 horas. Por enquanto, você já pode comprar itens de USO LIVRE.', + buttonText: 'Voltar para a loja', + buttonLink: '/', + active: false, + }) + + const [permission, setPermission] = useState(false) + const { showToast } = useContext(ToastContext) const sessionResponse: any = useSessionResponse() const handles = useCssHandles(CSS_HANDLES) @@ -96,29 +203,52 @@ const RequestOrganizationForm: FC = () => { } ) + const [pendings, setPendings] = useState([]) + const [createOrganizationRequest] = useMutation(CREATE_ORGANIZATION_REQUEST) const [addressState, setAddressState] = useState(() => addValidation(getEmptyAddress(country)) ) + const { acronym, image } = masterData[types.ORGANIZATION] + const formStateModel = { organizationName: '', - tradeName: '', + organizationIE: '', + organizationICMS: null, + organizationArea: '', + organizationAreaOthers: '', + organizationPhone: '', + newsletter: false, firstName: '', + tradeName: '', lastName: '', email: '', + cpf: '', + telephone: '', defaultCostCenterName: '', - phoneNumber: '', businessDocument: '', isSubmitting: false, submitted: true, + file: null, } - const [formState, setFormState] = useState(formStateModel) + const [formState, setFormState] = useState(formStateModel) const [hasProfile, setHasProfile] = useState(false) + const translateMessage = (message: MessageDescriptor) => { + return formatMessage(message) + } + + const toastMessage = (message: MessageDescriptor) => { + const translatedMessage = translateMessage(message) + const action = undefined + + showToast({ message: translatedMessage, action }) + } + useEffect(() => { if (!sessionResponse || hasProfile) return @@ -133,17 +263,122 @@ const RequestOrganizationForm: FC = () => { } }, [sessionResponse]) - const translateMessage = (message: MessageDescriptor) => { - return formatMessage(message) + const clearCountryStateInterval = () => { + if (countryStateInputInterval.current) + clearInterval(countryStateInputInterval.current) } - const toastMessage = (message: MessageDescriptor) => { - const translatedMessage = translateMessage(message) - const action = undefined + const countryStateInputScript = () => { + countryStateInputInterval.current = setInterval(() => { + const countryState = document.querySelector( + '.vtex-address-form__state' + ) as HTMLDivElement - showToast({ message: translatedMessage, action }) + if (!countryState) return + countryState.style.display = 'none' + const newGridTemplateAreas = + '"endereco endereco" "numero complemento" "bairro cidade" "destinatario destinatario"' + + if (countryState.parentElement) + countryState.parentElement.style.gridTemplateAreas = newGridTemplateAreas + clearCountryStateInterval() + }, 1000) } + useEffect(() => { + countryStateInputScript() + + return function cleanUp() { + clearCountryStateInterval() + } + }, []) + + useEffect(() => { + type ValidationType = { + isValid: boolean + stringIfInvalid: string + } + + const validations: ValidationType[] = [ + { + isValid: formState.firstName?.trim() !== '', + stringIfInvalid: `${translateMessage( + messages.userData + )} > ${translateMessage(messages.firstName)}`, + }, + { + isValid: formState.lastName?.trim() !== '', + stringIfInvalid: `${translateMessage( + messages.userData + )} > ${translateMessage(messages.lastName)}`, + }, + { + isValid: formState.email?.trim() !== '', + stringIfInvalid: `${translateMessage( + messages.userData + )} > ${translateMessage(messages.email)}`, + }, + { + isValid: formState.cpf !== '', + stringIfInvalid: `${translateMessage( + messages.userData + )} > ${translateMessage(messages.cpf)}`, + }, + { + isValid: formState.telephone !== '', + stringIfInvalid: `${translateMessage( + messages.userData + )} > ${translateMessage(messages.telephone)}`, + }, + { + isValid: formState.businessDocument !== '', + stringIfInvalid: `${translateMessage( + messages.organizationData + )} > ${translateMessage(messages.cnpjLabel)}`, + }, + { + isValid: formState.organizationName !== '', + stringIfInvalid: `${translateMessage( + messages.organizationData + )} > ${translateMessage(messages.organizationName)}`, + }, + { + isValid: formState.organizationIE !== '', + stringIfInvalid: `${translateMessage( + messages.organizationData + )} > ${translateMessage(messages.stateRegistrationInitials)}`, + }, + { + isValid: + formState.organizationArea !== '' && + (formState.organizationArea !== organizationAreaOthersValue || + (formState.organizationArea === organizationAreaOthersValue && + formState.organizationAreaOthers !== '')), + stringIfInvalid: `${translateMessage( + messages.organizationData + )} > ${translateMessage(messages.occupationArea)}`, + }, + { + isValid: formState.organizationPhone !== '', + stringIfInvalid: `${translateMessage( + messages.organizationData + )} > ${translateMessage(messages.telephone)}`, + }, + { + isValid: permission, + stringIfInvalid: translateMessage(messages.acceptTermsAndConditions), + }, + ] + + setPendings(() => + validations.reduce((previous: string[], current: ValidationType) => { + if (current.isValid) return previous + + return [...previous, current.stringIfInvalid] + }, []) + ) + }, [formState, permission]) + const translateCountries = () => { const { shipsTo = [] } = data?.logistics @@ -170,13 +405,33 @@ const RequestOrganizationForm: FC = () => { setAddressState(() => addValidation(getEmptyAddress(country))) } - const handleSubmit = () => { + const handleSubmit = async () => { setFormState({ ...formState, isSubmitting: true, submitted: true, }) + const dataOrganization = { + name: formState.organizationName, + cnpj: formState.businessDocument, + phone: formState.organizationPhone, + ie: formState.organizationIE, + icms: formState.organizationICMS, + area: formState.organizationArea, + areaOthers: formState.organizationAreaOthers, + } + + createOrganization(dataOrganization).then(data => { + const file = (document.querySelector( + '.file-button > input[type="file"]' + ) as HTMLInputElement).files?.[0] + + const AcronymId = { acronym, id: data.DocumentId } + + if (file) attachFileToEntity(AcronymId, image, file) + }) + const organizationRequest = { name: formState.organizationName, tradeName: formState.tradeName, @@ -184,9 +439,17 @@ const RequestOrganizationForm: FC = () => { firstName: formState.firstName, lastName: formState.lastName, email: formState.email, + cpf: formState.cpf, + telephone: formState.telephone, }, defaultCostCenter: { - name: formState.defaultCostCenterName, + name: formState.organizationName, + ie: formState.organizationIE, + icms: formState.organizationICMS, + area: formState.organizationArea, + areaOthers: formState.organizationAreaOthers, + phone: removeLettersAndSymbols(formState.organizationPhone), + newsletter: formState.newsletter, address: { addressId: addressState.addressId.value, addressType: addressState.addressType.value, @@ -203,7 +466,6 @@ const RequestOrganizationForm: FC = () => { street: addressState.street.value, addressQuery: addressState.addressQuery.value, }, - phoneNumber: formState.phoneNumber, businessDocument: formState.businessDocument, }, } @@ -239,6 +501,14 @@ const RequestOrganizationForm: FC = () => { isSubmitting: false, submitted: true, }) + setModalSettings({ + title: 'Cadastro enviado!', + message: + 'Vamos analisar os dados enviados e liberar o seu cadastro. Aguarde nosso e-mail com mais informações e liberar seu cadastro em até 24 horas. Por enquanto, você já pode comprar itens de USO LIVRE.', + buttonText: 'Voltar para a loja', + buttonLink: '/', + active: true, + }) } }) .catch(error => { @@ -252,7 +522,6 @@ const RequestOrganizationForm: FC = () => { } if (!data) return null - const renderIfSubmitted = formState.submitted && existingRequestData?.getOrganizationRequestById?.status ? ( @@ -323,206 +592,441 @@ const RequestOrganizationForm: FC = () => { ) : ( - -
- ) => { - setFormState({ - ...formState, - organizationName: e.target.value, - }) - }} - required - /> -
-
+ - ) => { - setFormState({ - ...formState, - tradeName: e.target.value, - }) - }} - /> -
-
- -
- ) => { - setFormState({ - ...formState, - firstName: e.target.value, - }) - }} - /> -
-
- ) => { - setFormState({ - ...formState, - lastName: e.target.value, - }) - }} - /> -
-
- ) => { - setFormState({ - ...formState, - email: e.target.value, - }) - }} - /> -
-
- -
- ) => { - setFormState({ - ...formState, - defaultCostCenterName: e.target.value, - }) - }} - /> -
-
- ) => { - setFormState({ - ...formState, - phoneNumber: e.target.value, - }) - }} - /> -
-
- ) => { - setFormState({ - ...formState, - businessDocument: e.target.value, - }) - }} - /> -
-
+
+ ) => { + setFormState({ + ...formState, + firstName: e.target.value, + }) + }} + /> +
+
+ ) => { + setFormState({ + ...formState, + lastName: e.target.value, + }) + }} + /> +
+
+
+ ) => { + setFormState({ + ...formState, + email: e.target.value, + }) + }} + /> +
+
+
+ ) => { + setFormState({ + ...formState, + cpf: formataCPF(e.target.value), + }) + }} + /> +
+
+ ) => { + setFormState({ + ...formState, + telephone: formataPhone(e.target.value), + }) + }} + /> +
+
+
+ - +
+ ) => { + setFormState({ + ...formState, + businessDocument: formataCNPJ(e.target.value), + }) + }} + /> +
+
+ + <> +
+ ) => { + setFormState({ + ...formState, + organizationName: e.target.value, + defaultCostCenterName: e.target.value, + }) + }} + required + /> +
+
+ ) => { + setFormState({ + ...formState, + tradeName: e.target.value, + }) + }} + /> +
+
+ ) => { + setFormState({ + ...formState, + organizationIE: e.target.value, + }) + }} + required + /> + { + formState.organizationIE === 'Isento' + ? setFormState({ + ...formState, + organizationIE: '', + }) + : setFormState({ + ...formState, + organizationIE: 'Isento', + }) + }} + /> +
+ +
+ +
+ { + setFormState({ + ...formState, + organizationICMS: true, + }) + }} + value="option-0" + /> + { + setFormState({ + ...formState, + organizationICMS: false, + }) + }} + value="option-0" + /> +
+
+ +
+ { + setFormState({ + ...formState, + organizationArea: value, + }) + }} + required + /> +
+ + {formState.organizationArea === organizationAreaOthersValue && ( +
+ ) => { + setFormState({ + ...formState, + organizationAreaOthers: e.target.value, + }) + }} + required + /> +
+ )} + +
+
+ ) => { + setFormState({ + ...formState, + organizationPhone: formataPhoneEmpresa(e.target.value), + }) + }} + required + /> +
+
+
+ +
+ <> + - - + + + - + - + + + + + +
+
+ + { + setFormState({ + ...formState, + file: ev.target?.files?.[0], + }) + }} + multiple + /> +
+ + + + +
+ +
+ { + setFormState({ + ...formState, + newsletter: !formState.newsletter, + }) + }} + value="newsletter" /> - - -
-
-
-
-
+
+ { + setPermission(!permission) }} - disabled={ - !formState.organizationName || - !formState.defaultCostCenterName || - !formState.firstName || - !formState.lastName || - !validateEmail(formState.email) || - !isValidAddress(addressState) || - (formState.phoneNumber && - !validatePhoneNumber(formState.phoneNumber)) - } - > - - + value="permission" + />
+ + +
+
+
+
+ {pendings.length ? ( +
+ + + + + {pendings.map((pending: string) => ( + {pending} + ))} +
+ ) : ( + false + )} +
- +
) @@ -541,10 +1045,17 @@ const RequestOrganizationForm: FC = () => { +
+

+ +

+

+ +

+

+ +

+
} > {loading ? ( @@ -555,6 +1066,18 @@ const RequestOrganizationForm: FC = () => { {renderIfAuthenticated} )}
+ { + setModalSettings({ + title: '', + message: '', + buttonLink: '', + buttonText: '', + active: false, + }) + }} + />
) } diff --git a/react/components/utils/api.ts b/react/components/utils/api.ts new file mode 100644 index 00000000..1b466cf1 --- /dev/null +++ b/react/components/utils/api.ts @@ -0,0 +1,11 @@ +import axios from 'axios' + +const api = axios.create({ + baseURL: `https://apiv2.motorfiscal.com.br/`, +}) + +api.defaults.headers.common.Authorization = + '0KwgmGRYjSxW6CHIv8CJeooWerGkxBaSdhi4zs92NpVJV8mhWd6sYlTwgj8F' +api.defaults.headers.common['Content-Type'] = 'application/json' + +export default api diff --git a/react/components/utils/messages.ts b/react/components/utils/messages.ts index efeb0380..85bbaa23 100644 --- a/react/components/utils/messages.ts +++ b/react/components/utils/messages.ts @@ -282,6 +282,12 @@ export const organizationRequestMessages = defineMessages({ email: { id: `${storePrefix}request-new-organization.email.label`, }, + cpf: { + id: `${storePrefix}request-new-organization.cpf.label`, + }, + telephone: { + id: `${storePrefix}request-new-organization.telephone.label`, + }, defaultCostCenter: { id: `${storePrefix}request-new-organization.default-cost-center.title`, }, @@ -303,6 +309,66 @@ export const organizationRequestMessages = defineMessages({ businessDocumentHelp: { id: `${storePrefix}request-new-organization.businessDocument.helpText`, }, + userData: { + id: `${storePrefix}request-new-organization.user-data`, + }, + formContainerSubTitle: { + id: `${storePrefix}request-new-organization.form-container-subtitle`, + }, + organizationData: { + id: `${storePrefix}request-new-organization.organization-data`, + }, + organizationDataDescription: { + id: `${storePrefix}request-new-organization.organization-data-description`, + }, + cnpjLabel: { + id: `${storePrefix}request-new-organization.cnpj.label`, + }, + free: { + id: `${storePrefix}request-new-organization.free`, + }, + yes: { + id: `${storePrefix}request-new-organization.yes`, + }, + no: { + id: `${storePrefix}request-new-organization.no`, + }, + occupationArea: { + id: `${storePrefix}request-new-organization.occupationArea`, + }, + occupationAreaDescription: { + id: `${storePrefix}request-new-organization.occupationAreaDescription`, + }, + landline: { + id: `${storePrefix}request-new-organization.landline.label`, + }, + registerBillingAddress: { + id: `${storePrefix}request-new-organization.register-billing-address`, + }, + registerBillingAddressDescription: { + id: `${storePrefix}request-new-organization.register-billing-address-description`, + }, + proofAttachment: { + id: `${storePrefix}request-new-organization.proof-attachment`, + }, + proofAttachmentDescription: { + id: `${storePrefix}request-new-organization.proof-attachment-description`, + }, + newsletterLabel: { + id: `${storePrefix}request-new-organization.newsletter.label`, + }, + privacyPoliciesLabel: { + id: `${storePrefix}request-new-organization.privacyPolicies.label`, + }, + stateRegistrationInitials: { + id: `${storePrefix}request-new-organization.state-registration-initials`, + }, + attachFiles: { + id: `${storePrefix}request-new-organization.attach-file.label`, + }, + acceptTermsAndConditions: { + id: `${storePrefix}request-new-organization.accept-terms-and-conditions`, + }, }) export const userWidgetMessages = defineMessages({ diff --git a/react/config/masterdata.ts b/react/config/masterdata.ts new file mode 100644 index 00000000..3b2e5b18 --- /dev/null +++ b/react/config/masterdata.ts @@ -0,0 +1,12 @@ +const types = { + ORGANIZATION: 'ORGANIZATION', +} + +const masterData = { + [types.ORGANIZATION]: { + acronym: 'MO', + image: 'arquivo', + }, +} + +export { masterData, types } diff --git a/react/graphql/addUser.graphql b/react/graphql/addUser.graphql index b3e366c5..ae487331 100644 --- a/react/graphql/addUser.graphql +++ b/react/graphql/addUser.graphql @@ -19,7 +19,7 @@ mutation AddUser( canImpersonate: $canImpersonate name: $name email: $email - ) @context(provider: "vtex.b2b-organizations-graphql") { + ) @context(provider: "hppardis.b2b-organizations-graphql") { id status } diff --git a/react/graphql/createCostCenter.graphql b/react/graphql/createCostCenter.graphql index 9283cd6d..1775cfba 100644 --- a/react/graphql/createCostCenter.graphql +++ b/react/graphql/createCostCenter.graphql @@ -1,6 +1,6 @@ mutation CreateCostCenter($organizationId: ID, $input: CostCenterInput!) { createCostCenter(organizationId: $organizationId, input: $input) - @context(provider: "vtex.b2b-organizations-graphql") { + @context(provider: "hppardis.b2b-organizations-graphql") { id } } diff --git a/react/graphql/createOrganization.graphql b/react/graphql/createOrganization.graphql index a2786aa8..1b928944 100644 --- a/react/graphql/createOrganization.graphql +++ b/react/graphql/createOrganization.graphql @@ -1,6 +1,6 @@ mutation CreateOrganization($input: OrganizationInput!) { createOrganization(input: $input) - @context(provider: "vtex.b2b-organizations-graphql") { + @context(provider: "hppardis.b2b-organizations-graphql") { id } } diff --git a/react/graphql/createOrganizationRequest.graphql b/react/graphql/createOrganizationRequest.graphql index ba2df7be..b1e4d15c 100644 --- a/react/graphql/createOrganizationRequest.graphql +++ b/react/graphql/createOrganizationRequest.graphql @@ -1,6 +1,6 @@ mutation CreateOrganizationRequest($input: OrganizationInput!) { createOrganizationRequest(input: $input) - @context(provider: "vtex.b2b-organizations-graphql") { + @context(provider: "hppardis.b2b-organizations-graphql") { id status } diff --git a/react/graphql/deleteCostCenter.graphql b/react/graphql/deleteCostCenter.graphql index d7bbed4c..83d1b3f9 100644 --- a/react/graphql/deleteCostCenter.graphql +++ b/react/graphql/deleteCostCenter.graphql @@ -1,6 +1,6 @@ mutation DeleteCostCenter($id: ID!) { deleteCostCenter(id: $id) - @context(provider: "vtex.b2b-organizations-graphql") { + @context(provider: "hppardis.b2b-organizations-graphql") { id status message diff --git a/react/graphql/getCostCenter.graphql b/react/graphql/getCostCenter.graphql index 979332e5..469772ec 100644 --- a/react/graphql/getCostCenter.graphql +++ b/react/graphql/getCostCenter.graphql @@ -1,6 +1,6 @@ query GetCostCenter($id: ID!) { getCostCenterById(id: $id) - @context(provider: "vtex.b2b-organizations-graphql") { + @context(provider: "hppardis.b2b-organizations-graphql") { name organization paymentTerms { @@ -25,5 +25,12 @@ query GetCostCenter($id: ID!) { } phoneNumber businessDocument + type + organizationPublic + ie + icms + area + phone + newsletter } } diff --git a/react/graphql/getCostCenterStorefront.graphql b/react/graphql/getCostCenterStorefront.graphql index 254e9dee..d8d0310b 100644 --- a/react/graphql/getCostCenterStorefront.graphql +++ b/react/graphql/getCostCenterStorefront.graphql @@ -1,6 +1,6 @@ query GetCostCenterStorefront($id: ID) { getCostCenterByIdStorefront(id: $id) - @context(provider: "vtex.b2b-organizations-graphql") { + @context(provider: "hppardis.b2b-organizations-graphql") { id name organization @@ -26,5 +26,12 @@ query GetCostCenterStorefront($id: ID) { } phoneNumber businessDocument + type + organizationPublic + ie + icms + area + phone + newsletter } } diff --git a/react/graphql/getCostCentersByOrganizationId.graphql b/react/graphql/getCostCentersByOrganizationId.graphql index 61429a7e..3de3d1ab 100644 --- a/react/graphql/getCostCentersByOrganizationId.graphql +++ b/react/graphql/getCostCentersByOrganizationId.graphql @@ -13,7 +13,7 @@ query GetCostCentersByOrganizationId( pageSize: $pageSize sortOrder: $sortOrder sortedBy: $sortedBy - ) @context(provider: "vtex.b2b-organizations-graphql") { + ) @context(provider: "hppardis.b2b-organizations-graphql") { pagination { total } diff --git a/react/graphql/getCostCentersByOrganizationIdStorefront.graphql b/react/graphql/getCostCentersByOrganizationIdStorefront.graphql index d19cc76c..25bf977c 100644 --- a/react/graphql/getCostCentersByOrganizationIdStorefront.graphql +++ b/react/graphql/getCostCentersByOrganizationIdStorefront.graphql @@ -13,7 +13,7 @@ query GetCostCentersByOrganizationIdStorefront( pageSize: $pageSize sortOrder: $sortOrder sortedBy: $sortedBy - ) @context(provider: "vtex.b2b-organizations-graphql") { + ) @context(provider: "hppardis.b2b-organizations-graphql") { pagination { total } diff --git a/react/graphql/getOrganization.graphql b/react/graphql/getOrganization.graphql index 88dd3367..4c501973 100644 --- a/react/graphql/getOrganization.graphql +++ b/react/graphql/getOrganization.graphql @@ -1,6 +1,6 @@ query GetOrganization($id: ID) { getOrganizationById(id: $id) - @context(provider: "vtex.b2b-organizations-graphql") { + @context(provider: "hppardis.b2b-organizations-graphql") { id name tradeName diff --git a/react/graphql/getOrganizationRequest.graphql b/react/graphql/getOrganizationRequest.graphql index 8e3edd54..3d182a0d 100644 --- a/react/graphql/getOrganizationRequest.graphql +++ b/react/graphql/getOrganizationRequest.graphql @@ -1,6 +1,6 @@ query GetOrganizationRequest($id: ID!) { getOrganizationRequestById(id: $id) - @context(provider: "vtex.b2b-organizations-graphql") { + @context(provider: "hppardis.b2b-organizations-graphql") { name tradeName b2bCustomerAdmin { @@ -28,6 +28,13 @@ query GetOrganizationRequest($id: ID!) { } phoneNumber businessDocument + type + organizationPublic + ie + icms + area + phone + newsletter } } } diff --git a/react/graphql/getOrganizationRequests.graphql b/react/graphql/getOrganizationRequests.graphql index 7770b253..9d109da3 100644 --- a/react/graphql/getOrganizationRequests.graphql +++ b/react/graphql/getOrganizationRequests.graphql @@ -13,7 +13,7 @@ query GetOrganizationRequests( pageSize: $pageSize sortOrder: $sortOrder sortedBy: $sortedBy - ) @context(provider: "vtex.b2b-organizations-graphql") { + ) @context(provider: "hppardis.b2b-organizations-graphql") { pagination { total } diff --git a/react/graphql/getOrganizationStorefront.graphql b/react/graphql/getOrganizationStorefront.graphql index 62e3bd58..78c9858d 100644 --- a/react/graphql/getOrganizationStorefront.graphql +++ b/react/graphql/getOrganizationStorefront.graphql @@ -1,6 +1,6 @@ query GetOrganizationStorefront($id: ID) { getOrganizationByIdStorefront(id: $id) - @context(provider: "vtex.b2b-organizations-graphql") { + @context(provider: "hppardis.b2b-organizations-graphql") { id name status diff --git a/react/graphql/getOrganizations.graphql b/react/graphql/getOrganizations.graphql index 2167ef19..95616d7f 100644 --- a/react/graphql/getOrganizations.graphql +++ b/react/graphql/getOrganizations.graphql @@ -13,7 +13,7 @@ query GetOrganizations( pageSize: $pageSize sortOrder: $sortOrder sortedBy: $sortedBy - ) @context(provider: "vtex.b2b-organizations-graphql") { + ) @context(provider: "hppardis.b2b-organizations-graphql") { pagination { total } diff --git a/react/graphql/getPaymentTerms.graphql b/react/graphql/getPaymentTerms.graphql index 45fc7458..33057444 100644 --- a/react/graphql/getPaymentTerms.graphql +++ b/react/graphql/getPaymentTerms.graphql @@ -1,6 +1,6 @@ query GetPaymentTerms { getPaymentTerms - @context(provider: "vtex.b2b-organizations-graphql") { + @context(provider: "hppardis.b2b-organizations-graphql") { id name } diff --git a/react/graphql/impersonateUser.graphql b/react/graphql/impersonateUser.graphql index 36154b1e..b72012de 100644 --- a/react/graphql/impersonateUser.graphql +++ b/react/graphql/impersonateUser.graphql @@ -1,6 +1,6 @@ mutation ImpersonateUser($clId: ID, $userId: ID) { impersonateUser(clId: $clId, userId: $userId) - @context(provider: "vtex.b2b-organizations-graphql") { + @context(provider: "hppardis.b2b-organizations-graphql") { id status message diff --git a/react/graphql/removeUser.graphql b/react/graphql/removeUser.graphql index 99e45ee4..fa2c84c4 100644 --- a/react/graphql/removeUser.graphql +++ b/react/graphql/removeUser.graphql @@ -1,6 +1,6 @@ mutation RemoveUser($id: ID!, $userId: ID, $email: String!, $clId: ID!) { removeUser(id: $id, userId: $userId, email: $email, clId: $clId) - @context(provider: "vtex.b2b-organizations-graphql") { + @context(provider: "hppardis.b2b-organizations-graphql") { status } } diff --git a/react/graphql/saveUser.graphql b/react/graphql/saveUser.graphql index 24bc3165..00b692c9 100644 --- a/react/graphql/saveUser.graphql +++ b/react/graphql/saveUser.graphql @@ -19,7 +19,7 @@ mutation SaveUser( canImpersonate: $canImpersonate name: $name email: $email - ) @context(provider: "vtex.b2b-organizations-graphql") { + ) @context(provider: "hppardis.b2b-organizations-graphql") { id status } diff --git a/react/graphql/updateCostCenter.graphql b/react/graphql/updateCostCenter.graphql index 54da5e25..36d48fcc 100644 --- a/react/graphql/updateCostCenter.graphql +++ b/react/graphql/updateCostCenter.graphql @@ -1,6 +1,6 @@ mutation UpdateCostCenter($id: ID!, $input: CostCenterInput!) { updateCostCenter(id: $id, input: $input) - @context(provider: "vtex.b2b-organizations-graphql") { + @context(provider: "hppardis.b2b-organizations-graphql") { id status message diff --git a/react/graphql/updateOrganization.graphql b/react/graphql/updateOrganization.graphql index f3f0005c..64636ca6 100644 --- a/react/graphql/updateOrganization.graphql +++ b/react/graphql/updateOrganization.graphql @@ -15,7 +15,7 @@ mutation UpdateOrganization( collections: $collections paymentTerms: $paymentTerms priceTables: $priceTables - ) @context(provider: "vtex.b2b-organizations-graphql") { + ) @context(provider: "hppardis.b2b-organizations-graphql") { id status message diff --git a/react/graphql/updateOrganizationRequest.graphql b/react/graphql/updateOrganizationRequest.graphql index c585e9ff..c203208b 100644 --- a/react/graphql/updateOrganizationRequest.graphql +++ b/react/graphql/updateOrganizationRequest.graphql @@ -1,6 +1,6 @@ mutation UpdateOrganizationRequest($id: ID!, $status: String!, $notes: String) { updateOrganizationRequest(id: $id, status: $status, notes: $notes) - @context(provider: "vtex.b2b-organizations-graphql") { + @context(provider: "hppardis.b2b-organizations-graphql") { id status message diff --git a/react/package.json b/react/package.json index abc87893..f36e0393 100644 --- a/react/package.json +++ b/react/package.json @@ -34,6 +34,7 @@ "@vtex/admin-ui": "^0.114.3", "@vtex/css-handles": "^1.0.0", "apollo-client": "^2.6.10", + "axios": "^0.27.2", "react": "^16.9.2", "react-apollo": "^3.1.5", "react-intl": "^5.13.4", diff --git a/react/requests/createOrganization.ts b/react/requests/createOrganization.ts new file mode 100644 index 00000000..744c0630 --- /dev/null +++ b/react/requests/createOrganization.ts @@ -0,0 +1,39 @@ +import { masterData, types } from '../config/masterdata' + +type CreateOrganizationDataType = { + name: string + cnpj: string + phone: string + ie: string + icms: string + area: string + areaOthers: string +} + +const createOrganization = async (data: CreateOrganizationDataType) => { + try { + const url = `/api/dataentities/${ + masterData[types.ORGANIZATION].acronym + }/documents` + + const options = { + method: 'POST', + headers: { + Accept: 'application/vnd.vtex.ds.v10+json', + 'Content-Type': 'application/json', + }, + body: JSON.stringify(data), + } + + const request = await fetch(url, options) + const acceptedStatus = [200, 201, 204] + + if (!acceptedStatus.includes(request.status)) throw new Error('') + + return request.json() + } catch (e) { + return e.json() + } +} + +export default createOrganization diff --git a/react/styles.global.css b/react/styles.global.css index 50ffce56..5be3df4a 100644 --- a/react/styles.global.css +++ b/react/styles.global.css @@ -6,3 +6,390 @@ body, .render-provider { height: 100%; } + + + +.customb2b-pageHeader { + display: block; + margin: 10px auto 30px; + max-width: 586px; +} + +.customb2b-pageHeader h1 { + text-align: center; + font: normal normal medium 38px/46px Poppins; + letter-spacing: 0px; + color: #CC083C; + margin: 10px 0; +} + +.customb2b-pageHeader h3 { + text-align: center; + font: normal normal normal 14px/18px Poppins; + letter-spacing: 0px; + color: #CC083C; + opacity: 1; + margin: 10px 0; + +} + +.customb2b-pageHeader h4 { + text-align: center; + font: normal normal normal 12px/16px Poppins; + letter-spacing: 0px; + color: #4F575C; + opacity: 1; + margin: 0; +} + +.customb2b-pageBody { + background: #FAFAFA 0% 0% no-repeat padding-box; + border-radius: 6px; + padding: 30px 30px; + max-width: 586px; + margin: auto; +} + +.customb2b-pageBody *:not(input):not(select):not(.vtex-checkbox__box):not(.vtex-checkbox__box-wrapper):not(.vtex-checkbox__container):not(.vtex-checkbox__inner-container):not(.vtex-dropdown__button):not(.vtex-dropdown__container) { + background: transparent; + border: 0; + margin: 0; + padding: 0; +} + +.customb2b-pageBody * { + font: normal normal normal 13px/18px Poppins; +} + +.customb2b-pageBody .styleguide__pageBlock>div>div h2+div { + margin-bottom: 20px o !important; +} + +.customb2b-pageBody input:not([type=checkbox]), +select, +.vtex-dropdown__container { + background: #fff !important; + border-radius: 2px !important; + border: 1px solid #eee !important; + height: 38px !important; +} + +.styleguide__layout.bg-muted-5 { + background-color: transparent !important; +} + +.customb2b-pageBody .styleguide__pageBlock:not(:first-child) { + padding: 10px 0 20px; +} + +.customb2b-pageBody .styleguide__pageBlock:not(:first-child) { + margin-top: 35px !important; +} + +.customb2b-pageBody .styleguide__pageBlock div h2 { + width: 100%; + font: normal normal 600 16px/35px Poppins; + letter-spacing: 0px; + color: #12576E; + margin: 0; +} + +.customb2b-pageBody .styleguide__pageBlock div h2+div { + width: 100%; + font: normal normal normal 12px/14px Poppins; + letter-spacing: 0px; + color: #4F575C; + margin: 0; +} + +.customb2b-pageBody .styleguide__pageBlock div.styleguide__box { + padding: 20px 0 25px; + display: flex; + flex-direction: column; + gap: 20px; +} + + +.customb2b-pageBody .form-group-flex { + display: flex; + gap: 20px; + width: 100%; +} + +.customb2b-pageBody .form-group-flex button { + max-width: 150px; + background-color: #CC083C !important; + color: #fff; + height: 38px; + margin-top: auto !important; + margin-right: auto; + width: 100%; + font: normal normal normal 13px/18px Poppins; + text-transform: capitalize; + +} + +.customb2b-pageBody .form-group-flex>div { + width: 100%; +} + +/* Form geral */ + +.customb2b-pageBody .hermespardini-b2b-organizations-1-x-newOrganizationInput span { + margin-top: 5px !important; + font: normal normal normal 13px/18px Poppins; + color: #111; +} + +/* Form empresa */ + + +.customb2b-pageBody .vtex-dropdown span { + margin-top: 5px !important; + font: normal normal normal 13px/18px Poppins; + color: #111; +} + +.customb2b-pageBody .ie-flex { + display: flex; + gap: 20px; + flex-direction: row; +} + +.customb2b-pageBody .ie-flex .vtex-checkbox__line-container { + height: 38px; + margin-top: auto !important; + justify-content: center; + align-items: center; +} + +.customb2b-pageBody .icms-flex>div .vtex-checkbox__line-container { + height: 30px; + margin-top: 10px !important; + justify-content: center; + align-items: center; +} + +.customb2b-pageBody .icms-flex>div { + display: flex; + flex-direction: row; + gap: 20px; +} + +.customb2b-pageBody .icms-flex>label { + margin-top: 5px !important; + display: block; +} + +/* Form Adress */ +.customb2b-pageBody .vtex-address-form__country { + display: none; +} + +.customb2b-pageBody .vtex-address-form__postalCode { + width: 253px; + min-width: 253px; +} + +.customb2b-pageBody .vtex-address-form__postalCode-forgottenURL { + display: none; +} + +.customb2b-pageBody .vtex-address-form__steet { + grid-area: endereco; +} + +.customb2b-pageBody .vtex-address-form__number { + grid-area: numero; +} + +.customb2b-pageBody .vtex-address-form__complement { + grid-area: complemento; +} + +.customb2b-pageBody .vtex-address-form__neighborhood { + grid-area: bairro; +} + +.customb2b-pageBody .vtex-address-form__city { + grid-area: cidade; +} + +.customb2b-pageBody .vtex-address-form__state { + grid-area: estado; +} + +.customb2b-pageBody .vtex-address-form__receiverName { + grid-area: destinatario; +} + +.customb2b-pageBody .vtex-address-form__container { + display: grid; + gap: 15px 20px; + padding-top: 10px !important; + grid-template-areas: "endereco endereco""numero complemento""bairro cidade""estado destinatario"; +} + +.customb2b-pageBody .vtex-address-form__container>div label span { + margin-top: 5px !important; +} + +.customb2b-pageBody .vtex-address-form__container>div label>div { + margin-top: 15px !important; +} + + + + + + +/* Documentos anexados */ + +.file-warning{ + margin-top: 5px; + margin-bottom: 20px; + + font: normal normal normal 12px/16px Poppins; + color: #707070; +} +.file-button { + margin-bottom: 5px !important; +} + +.file-button input { + display: none; +} + +.file-button label { + color: #12576E !important; + background: #fff !important; + border: 1px solid #12576E !important; + border-radius: 2px; + width: 155px; + height: 38px; + display: flex; + justify-content: center; + align-items: center; + font-size: 13px; + line-height: 18px; + cursor: pointer; +} + + + +/* Modal */ +.modal-organization__shadow { + position: fixed; + top: 0; + left: 0; + display: flex; + width: 100vw; + height: 100vh; + justify-content: center; + align-items: center; + background: #00000088; + z-index: 999999; + padding: 15px; +} + +.modal-organization__box { + display: flex; + flex-direction: column; + justify-content: space-between; + padding: 30px 40px; + width: 100%; + max-width: 536px; + height: auto; + background: #FFFFFF 0% 0% no-repeat padding-box; + box-shadow: 0px 15px 30px #00000012; + border-radius: 6px; +} + +.modal-organization__header { + text-align: center; + font-size: 38px; + line-height: 46px; + font-weight: 500; + letter-spacing: 0px; + color: #12576E; + margin-bottom: 12px; +} + +.modal-organization__message { + text-align: center; + font-size: 15px; + line-height: 20px; + letter-spacing: 0px; + color: #12576E; +} + +.modal-organization__footer { + margin: 40px auto 0; +} + +.modal-organization__button { + width: 184px; + height: 38px; + display: flex; + justify-content: center; + align-items: center; + background: #0F4658 0% 0% no-repeat padding-box; + border-radius: 2px; + text-align: center; + font-size: 13px; + line-height: 18px; + letter-spacing: 0px; + color: #FFFFFF; + cursor: pointer; +} + + +.hermespardini-b2b-organizations-1-x-newOrganizationButtonsContainer { + align-items: center !important; + justify-content: center !important; +} + +.hermespardini-b2b-organizations-1-x-newOrganizationButtonsContainer button { + width: 184px !important; + height: 38px !important; + background: #12576E 0% 0% no-repeat padding-box !important; + border-radius: 2px !important; + text-align: center !important; + font-size: 13px !important; + line-height: 18px !important; + font-weight: 400 !important; + text-transform: none !important; + letter-spacing: 0px !important; + color: #FFFFFF !important; + justify-content: center !important; + align-items: center !important; + display: flex !important; + cursor: pointer; +} + +.hermespardini-b2b-organizations-1-x-newOrganizationButtonsContainer button[disabled] { + width: 184px !important; + height: 38px !important; + background: #696969 0% 0% no-repeat padding-box !important; + border-radius: 2px !important; + text-align: center !important; + font-size: 13px !important; + line-height: 18px !important; + font-weight: 400 !important; + text-transform: none !important; + letter-spacing: 0px !important; + color: #FFFFFF !important; + justify-content: center !important; + align-items: center !important; + display: flex !important; + cursor: pointer; +} + + +.styleguide__pageBlock > div:first-child{ + margin-bottom: 20px !important; +} + +.vtex-input-prefix__group{ + height: 38px; +} \ No newline at end of file diff --git a/react/tsconfig.json b/react/tsconfig.json index 9ac901b7..8e825d5c 100644 --- a/react/tsconfig.json +++ b/react/tsconfig.json @@ -1,6 +1,7 @@ { "extends": "@vtex/tsconfig", "compilerOptions": { + "jsx": "react", "noEmitOnError": false, "lib": [ "dom" diff --git a/react/utils/addresses.ts b/react/utils/addresses.ts index be5fb0ae..5184eabb 100644 --- a/react/utils/addresses.ts +++ b/react/utils/addresses.ts @@ -38,7 +38,12 @@ export const getEmptyAddress = (country: string) => { export const isValidAddress = (address: AddressFormFields) => { // check for empty address - if (!address.street.value || !address.receiverName.value) return false + if ( + !address.street.value || + !address.receiverName.value || + !address.state.value + ) + return false for (const field in address) { if (address[field].valid === false) { diff --git a/react/utils/attachFileToEntity.ts b/react/utils/attachFileToEntity.ts new file mode 100644 index 00000000..41e8e36c --- /dev/null +++ b/react/utils/attachFileToEntity.ts @@ -0,0 +1,27 @@ +async function attachFileToEntity(AcronymId: any, field: string, file: File) { + try { + const form = new FormData() + + form.append('file', file) + + const options = { + method: 'POST', + body: form, + } + + const acceptedStatus = [200, 201, 204] + + const request = await fetch( + `/api/dataentities/${AcronymId.acronym}/documents/${AcronymId.id}/${field}/attachments`, + options + ) + + if (!acceptedStatus.includes(request.status)) throw new Error('') + + return request.json() + } catch (__) { + return false + } +} + +export default attachFileToEntity diff --git a/react/yarn.lock b/react/yarn.lock index cd80e013..63765321 100644 --- a/react/yarn.lock +++ b/react/yarn.lock @@ -2113,6 +2113,14 @@ aws4@^1.8.0: resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.11.0.tgz#d61f46d83b2519250e2784daf5b09479a8b41c59" integrity sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA== +axios@^0.27.2: + version "0.27.2" + resolved "https://registry.yarnpkg.com/axios/-/axios-0.27.2.tgz#207658cc8621606e586c85db4b41a750e756d972" + integrity sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ== + dependencies: + follow-redirects "^1.14.9" + form-data "^4.0.0" + babel-jest@^25.5.1: version "25.5.1" resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-25.5.1.tgz#bc2e6101f849d6f6aec09720ffc7bc5332e62853" @@ -2458,7 +2466,7 @@ color-name@~1.1.4: resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== -combined-stream@^1.0.6, combined-stream@~1.0.6: +combined-stream@^1.0.6, combined-stream@^1.0.8, combined-stream@~1.0.6: version "1.0.8" resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== @@ -2948,6 +2956,11 @@ focus-visible@^5.1.0: resolved "https://registry.yarnpkg.com/focus-visible/-/focus-visible-5.2.0.tgz#3a9e41fccf587bd25dcc2ef045508284f0a4d6b3" integrity sha512-Rwix9pBtC1Nuy5wysTmKy+UjbDJpIfg8eHjw0rjZ1mX4GNLz1Bmd16uDpI3Gk1i70Fgcs8Csg2lPm8HULFg9DQ== +follow-redirects@^1.14.9: + version "1.15.0" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.0.tgz#06441868281c86d0dda4ad8bdaead2d02dca89d4" + integrity sha512-aExlJShTV4qOUOL7yF1U5tvLCB0xQuudbf6toyYA0E/acBNw71mvjFTnLaRp50aQaYocMR0a/RMMBIHeZnGyjQ== + for-in@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" @@ -2958,6 +2971,15 @@ forever-agent@~0.6.1: resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" integrity sha1-+8cfDEGt6zf5bFd60e1C2P2sypE= +form-data@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.0.tgz#93919daeaf361ee529584b9b31664dc12c9fa452" + integrity sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww== + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.8" + mime-types "^2.1.12" + form-data@~2.3.2: version "2.3.3" resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6"