1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-02-19 13:54:25 +01:00

interface to filter list of schedules

This commit is contained in:
Sylvain 2021-01-26 11:37:05 +01:00
parent def0778a4d
commit 5e06de508d
7 changed files with 116 additions and 1 deletions

View File

@ -0,0 +1,22 @@
/**
* This component shows input field with its label, styled
*/
import React from 'react';
interface LabelledInputProps {
id: string,
type: string,
label: string,
value: any,
onChange: (value: any) => void
}
export const LabelledInput: React.FC<LabelledInputProps> = ({ id, type, label, value, onChange }) => {
return (
<div className="input-with-label">
<label className="label" htmlFor={id}>{label}</label>
<input className="input" id={id} type={type} value={value} onChange={onChange} />
</div>
);
}

View File

@ -8,6 +8,7 @@ import { useTranslation } from 'react-i18next';
import { Loader } from './loader';
import { react2angular } from 'react2angular';
import PaymentScheduleAPI from '../api/payment-schedule';
import { LabelledInput } from './labelled-input';
declare var Application: IApplication;
@ -15,13 +16,37 @@ const paymentSchedulesList = PaymentScheduleAPI.list({ query: { page: 1, size: 2
const PaymentSchedulesList: React.FC = () => {
const { t } = useTranslation('admin');
const [referenceFilter, setReferenceFilter] = useState('');
const [customerFilter, setCustomerFilter] = useState('');
const [dateFilter, setDateFilter] = useState(null);
const paymentSchedules = paymentSchedulesList.read();
return (
<div className="payment-schedules-list">
<h3>
<i className="fas fa-filter" />
{t('app.admin.invoices.payment_schedules.filter_schedules')}
</h3>
<div className="schedules-filters">
<LabelledInput id="reference"
label={t('app.admin.invoices.payment_schedules.reference')}
type="text"
onChange={setReferenceFilter}
value={referenceFilter} />
<LabelledInput id="customer"
label={t('app.admin.invoices.payment_schedules.customer')}
type="text"
onChange={setCustomerFilter}
value={customerFilter} />
<LabelledInput id="reference"
label={t('app.admin.invoices.payment_schedules.date')}
type="date"
onChange={setDateFilter}
value={dateFilter} />
</div>
<ul>
{paymentSchedules.map(p => `<li>${p.reference}</li>`)}
{paymentSchedules.map(p => <li>{p.reference}</li>)}
</ul>
</div>
);

View File

@ -25,5 +25,7 @@
@import "modules/payment-schedule-summary";
@import "modules/wallet-info";
@import "modules/stripe-modal";
@import "modules/labelled-input";
@import "modules/payment-schedules-list";
@import "app.responsive";

View File

@ -0,0 +1,48 @@
.input-with-label {
position: relative;
display: inline-table;
border-collapse: separate;
box-sizing: border-box;
label.label {
padding: 6px 12px;
font-size: 16px;
font-weight: 400;
line-height: 1;
color: #555555;
text-align: center;
background-color: #eeeeee;
border: 1px solid #c4c4c4;
border-radius: 4px 0 0 4px;
width: 1%;
white-space: nowrap;
vertical-align: middle;
display: table-cell;
box-sizing: border-box;
border-right: 0;
}
input.input {
padding: 6px 12px;
height: 38px;
font-size: 16px;
line-height: 1.5;
border: 1px solid #c4c4c4;
border-radius: 0 4px 4px 0;
box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s;
display: table-cell;
position: relative;
z-index: 2;
float: left;
width: 100%;
margin: 0;
box-sizing: border-box;
&:focus {
border-color: #fdde3f;
outline: 0;
box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 8px rgba(253, 222, 63, .6);
}
}
}

View File

@ -0,0 +1,8 @@
.schedules-filters {
display: flex;
justify-content: space-between;
& > * {
width: 31%;
}
}

View File

@ -640,6 +640,11 @@ en:
currency_info_html: "Please specify below the currency used for online payment. You should provide a three-letter ISO code, from the list of <a href='https://stripe.com/docs/currencies' target='_blank'>Stripe supported currencies</a>."
currency_alert_html: "<strong>Warning</strong>: the currency cannot be changed after the first online payment was made. Please define this setting carefully before opening Fab-manager to your members."
stripe_currency: "Stripe currency"
payment_schedules:
filter_schedules: "Filter schedules"
reference: "Reference"
customer: "Customer"
date: "Date"
#management of users, labels, groups, and so on
members:
users_management: "Users management"

View File

@ -640,6 +640,11 @@ fr:
currency_info_html: "Veuillez indiquer la devise à utiliser lors des paiements en ligne. Vous devez fournir un code ISO à trois lettres, issu de la liste des <a href='https://stripe.com/docs/currencies' target='_blank'>devises supportées par Stripe</a>."
currency_alert_html: "<strong>Attention</strong> : la devise ne peut pas être modifiée après que le premier paiement en ligne ait été effectué. Veuillez définir attentivement ce paramètre avant d'ouvrir Fab-manager à vos membres."
stripe_currency: "Devise Stripe"
payment_schedules:
filter_schedules: "Filtrer les échéanciers"
reference: "Référence"
customer: "Client"
date: "Date"
#management of users, labels, groups, and so on
members:
users_management: "Gestion des utilisateurs"