Comments (11)
Introduction
It should capture users data when use match widget.
API Structure
On the API, the Activist's table follows the fields below:
field | type |
---|---|
id | int |
name | string |
string | |
phone | object |
document_number | string |
document_type | string |
created_at | timestamp |
updated_at | timestamp |
Input fields
The name
input should be the full name or we must add one more input, splitting in firstname
and lastname
and when we go to save that data, we concatenate each other.
Current
- The current MatchWidget layout is following below:
With inputs to capture users data
- Update: After selects the options of match, the
name
andemail
inputs should be shown:
With inputs error messages
- If user inputs an email that not corresponds to correct email format, it shows an error message.
Code
The inputs may be rendered by a custom component <Input />
inside /app/scripts/components/MatchWidget
directory. Something like jsx code below:
<Input
uid="input-match-name"
type="text"
label="Nome"
placeholder="Insira aqui seu nome"
required={true}
onChange={e => { this.setState({ name: e.target.value }) }}
show={!!selectedChoiceA}
/>
from bonde-clients.
The error message is a reusable component that uses into FormWidget
component too. For that reason, i'll isolate it in a separated file inside /app/components/FormUtil/Error
.
Code example
<Error
message="Email inválido"
classes={['mb1', 'orange', 'regular']} // {array} optional, for more customizability
styles={{ backgroundColor: '#fff' }} // {object} optional, for more customizability
/>
This file structure follows the conventions of mern-starter boilterplate for reusable components. (thanks to @igr-santos for the advices)
The <Input />
component may be inside that structure too.
from bonde-clients.
Needs to split <Input />
component in <Input />
and <Label />
components.
Current <Input />
component don't follow the SRP (Single Responsibility Principle), which render an input and label element.
from bonde-clients.
Need have a responsibility to SRP (Single Responsibility Principle), I guess split code not is better choice, but a container with Input and Label according of props received a good choice
from bonde-clients.
Suggestion
The current <Input />
component renders the html below:
<div className="mb2" style="display: block">
<label className="h4 caps bold mb1">Nome *</label>
<input
id="input-match-name"
className="field-light block full-width h3"
onChange="function()"
placeholder="Insira seu nome aqui"
type="text"
required="false"
/>
</div>
Options
The options a have are:
- Pass
<label>
element as a children of Input but, this isn't a good idea semantically. And because i don't want to write the line<label className="h4 caps bold mb1">Nome *</label>
every time i need the<label>
element.
<Input
uid="input-match-name"
type="text"
placeholder="Insira aqui seu nome">
<label className="h4 caps bold mb1">Nome *</label>
</Input>
- Or split it and treat it as a separated components.
<Label text="Nome *" />
<Input
uid="input-match-name"
type="text"
placeholder="Insira aqui seu nome"
/>
Motivation
It's more a question of standardization than how components will work together.. I don't want to write every the same css classes to renders a label that already exists in another part of application.
from bonde-clients.
Needs to migrate MatchWidget to new modularized structure.
from bonde-clients.
Needs to refactor action types, which actually is included in WidgetActions.js
file.
from bonde-clients.
Needs to create an endpoint to save user and selected match data. The payload may be something like this:
Payload
// This is what API will receive as payload.
{
"activist_match": {
"match_id": 72,
"activist": {
"name": "Gabriel Ramos Takeda",
"email": "[email protected]"
}
}
}
And, how we will send these data on the "activists view" side, we'll don't have any credential data. So the API must don't needs to authenticate the post request. (Maybe warning?)
from bonde-clients.
API commit: nossas/bonde-server@e91e9d0
from bonde-clients.
Needs to merge add-modularized-structure into add-match-widget branch and adapt according to the new modularized folder structure.
from bonde-clients.
Needs to add lastname to sync with mailchimp.
Screenshot:
from bonde-clients.
Related Issues (20)
- Como agente do módulo de Redes eu quero poder buscar usuárias do Mapa pelo nome ou e-mail na tabela "pessoas"
- Como agente do módulo de Redes eu quero buscar MSRs/Voluntárias próximas da MSR/Voluntária selecionada ao clicar no botão "BUSCAR MATCH"
- Como agente do módulo de Redes eu quero iniciar o processo de match ao clicar no botão "Selecionar"
- Como agente do módulo de Redes eu quero poder filtrar os matchs já realizados por Status / Estado / Data de Criação / Feito Por
- Como agente do módulo de Redes eu quero poder visualizar os matchs já realizados na página "Relações"
- Nova interface do Match Otimizado
- Como agente do módulo de Redes eu quero navegar entre as páginas início/pessoas/relações ao clicar nas respectivas abas
- Atualizar imagem do bonde público para última versão
- Migrar configurações de Comunidade para admin-canary
- Discutir implementação de Campanha / Tags para agrupamento de páginas e dados de uma Comunidade
- API para registrar o Recebedor de uma Comunidade HOT 1
- Implementar funções para validar tokens e acessos as APIs GraphQL do Bonde HOT 1
- Compilar bibliotecas
- Integração contínua (CI/CD) HOT 3
- Monorepo / Codebase HOT 2
- Encapsular cada ação de plugin no webpage em uma action no hasura
- Bonde mobile problemas com iOS / Safari
- Problemas na submissão de formulários da Visão Pública do BONDE "iOS / Safari" HOT 1
- Carregar usuário a partir da Hasura Engine
- Certificados fluxo automatizado e suas variações HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bonde-clients.