Compare commits

..

18 commits

Author SHA1 Message Date
Valentin
15bea6826f Remove unneeded dependency 2020-05-08 20:06:17 +02:00
Letícia Camara
84d64b3194 Merge branch 'master' into mx 2019-01-24 00:19:50 -02:00
Letícia Camara
3489f29089 Update webservice url 2019-01-24 00:18:31 -02:00
Letícia Camara
2a5618a999 Fix dependencies problem 2019-01-23 22:21:59 -02:00
Letícia Camara
19d0223959 Fix dependencies problem 2019-01-23 22:20:16 -02:00
Letícia Camara
bd40a19942 Fix filtered data to external update query event 2019-01-21 00:09:52 -02:00
Letícia Camara
4df858b4f0 Ambs responsive table 2019-01-16 22:43:10 -02:00
Letícia Camara
deb9c2eb4f Merchants responsive table 2019-01-16 22:26:34 -02:00
Letícia Camara
65451e1cca The text in the name and address cells to wrap to next line 2019-01-16 21:28:38 -02:00
Letícia Camara
c5576bb57b Add sort logic after each search event 2019-01-16 20:00:44 -02:00
Letícia Camara
775ed18e38 Merge branch 'master' into mx 2018-12-21 04:55:26 -02:00
Letícia Camara
f325cd3478 Merge branch 'master' into mx 2018-12-05 18:52:48 -02:00
Letícia Camara
f19f304477 Merge branch 'master' into mx 2018-12-03 13:37:52 -02:00
Letícia Camara
3aa855ef70 Merge branch 'master' into mx 2018-11-14 21:50:31 -02:00
Letícia Camara
0841aabb14 Add /ambs and /merchants es translations 2018-11-13 22:14:54 -02:00
Letícia Camara
0d8d5811c8 Merge branch 'master' into mx 2018-11-13 22:14:10 -02:00
Letícia Camara
c932afdeee Merge branch 'master' into mx 2018-11-13 18:37:32 -02:00
Letícia Camara
0eef532e0e Change default language to es 2018-11-12 01:07:36 -02:00
8 changed files with 88 additions and 84 deletions

View file

@ -8,6 +8,7 @@
"@material-ui/icons": "^3.0.1", "@material-ui/icons": "^3.0.1",
"bootstrap": "^4.1.3", "bootstrap": "^4.1.3",
"country-list": "^1.1.0", "country-list": "^1.1.0",
"font-awesome": "^4.7.0",
"mdbreact": "^4.7.1", "mdbreact": "^4.7.1",
"react": "^16.5.2", "react": "^16.5.2",
"react-dom": "^16.5.2", "react-dom": "^16.5.2",
@ -15,7 +16,6 @@
"react-intl": "^2.6.0", "react-intl": "^2.6.0",
"react-modal": "^3.5.1", "react-modal": "^3.5.1",
"react-ripples": "^1.1.2", "react-ripples": "^1.1.2",
"react-router-dom": "^4.3.1",
"react-scripts": "^1.1.5", "react-scripts": "^1.1.5",
"react-scroll": "^1.7.10", "react-scroll": "^1.7.10",
"recompose": "^0.30.0", "recompose": "^0.30.0",

View file

@ -169,37 +169,38 @@ class EnhancedTable extends Component {
const searchQuery = query; const searchQuery = query;
const searchColumns = this.state.searchColumns; const searchColumns = this.state.searchColumns;
const data = this.props.data.filter((item) => { const data = this.filterData(this.props.data, searchQuery, searchColumns);
let insert = false;
// Iterate over the search column select boxes
searchColumns.map(column => {
try {
if( column.checked && (item[column.name] !== undefined) ) {
if(item[column.name].hasOwnProperty('searchText') && item[column.name].searchText.toLowerCase().indexOf(searchQuery.toLowerCase().trim()) !== -1){
insert = true;
}
else if(item[column.name].toLowerCase().indexOf(searchQuery.toLowerCase().trim()) !== -1){
insert = true;
}
}
}
catch(error) {
//console.error(error);
}
return column;
});
if(insert){
return item;
}
return false;
});
this.props.onSearchChange(data); this.props.onSearchChange(data);
}; };
// Sort the passed data based on the current component state.
sortData = (data) => {
const orderBy = this.state.orderBy;
const order = this.state.order;
data =
order === 'desc'
? data.sort((a, b) => {
let a_value = (a[orderBy] !== undefined) ? a[orderBy]: '';
let b_value = (b[orderBy] !== undefined) ? b[orderBy]: '';
a_value = a_value.hasOwnProperty('searchText') ? a_value.searchText.toLowerCase() : a_value.toLowerCase();
b_value = b_value.hasOwnProperty('searchText') ? b_value.searchText.toLowerCase() : b_value.toLowerCase();
return (b_value < a_value) ? -1 : 1;
})
: data.sort((a, b) => {
let a_value = (a[orderBy] !== undefined) ? a[orderBy]: '';
let b_value = (b[orderBy] !== undefined) ? b[orderBy]: '';
a_value = a_value.hasOwnProperty('searchText') ? a_value.searchText.toLowerCase() : a_value.toLowerCase();
b_value = b_value.hasOwnProperty('searchText') ? b_value.searchText.toLowerCase() : b_value.toLowerCase();
if(a_value.trim() === '') a_value = 'zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz';
if(b_value.trim() === '') b_value = 'zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz';
return (a_value < b_value) ? -1 : 1;
}
);
return data;
};
/* /*
* Update the search column select box * Update the search column select box
*/ */
@ -212,6 +213,48 @@ class EnhancedTable extends Component {
isSelected = id => this.state.selected.indexOf(id) !== -1; isSelected = id => this.state.selected.indexOf(id) !== -1;
filterData(data, searchQuery, searchColumns) {
// Remove white spaces and wrong "" split
const queryTerms = searchQuery.split(' ').filter(value => value !== '');
return data.filter((item) => {
const insertArray = [];
// Implement hardcoded AND query over each column
// Iterate over each search term
queryTerms.forEach(searchItem => {
let insert = false;
// Iterate over the search column select boxes
searchColumns.map(column => {
try {
if( column.checked && (item[column.name] !== undefined) ) {
if(item[column.name].hasOwnProperty('searchText') &&
item[column.name].searchText.toLowerCase().indexOf(searchItem.toLowerCase().trim()) !== -1
){
insert = true;
}
else if(item[column.name].toLowerCase().indexOf(searchItem.toLowerCase().trim()) !== -1){
insert = true;
}
}
}
catch(error) {
//console.error(error);
}
return column;
});
insertArray.push(insert);
});
// AND logic
if(insertArray.filter(item => !item).length === 0){
return item;
}
return false;
});
}
render() { render() {
let { data } = this.props; let { data } = this.props;
const { columnData, rowsPerPageOptions, showSearchColumns } = this.props; const { columnData, rowsPerPageOptions, showSearchColumns } = this.props;
@ -219,49 +262,10 @@ class EnhancedTable extends Component {
// Logic of search query and columns // Logic of search query and columns
if(searchQuery.length > 0) { if(searchQuery.length > 0) {
data = this.filterData(data, searchQuery, searchColumns);
// Remove white spaces and wrong "" split
const queryTerms = searchQuery.split(' ').filter(value => value !== '');
data = data.filter((item) => {
const insertArray = [];
// Implement hardcoded AND query over each column
// Iterate over each search term
queryTerms.forEach(searchItem => {
let insert = false;
// Iterate over the search column select boxes
searchColumns.map(column => {
try {
if( column.checked && (item[column.name] !== undefined) ) {
if(item[column.name].hasOwnProperty('searchText') &&
item[column.name].searchText.toLowerCase().indexOf(searchItem.toLowerCase().trim()) !== -1
){
insert = true;
}
else if(item[column.name].toLowerCase().indexOf(searchItem.toLowerCase().trim()) !== -1){
insert = true;
}
}
}
catch(error) {
//console.error(error);
}
return column;
});
insertArray.push(insert);
});
// AND logic
if(insertArray.filter(item => !item).length === 0){
return item;
}
return false;
});
} }
data = this.sortData(data);
return ( return (
<div style={styles.root}> <div style={styles.root}>

View file

@ -374,7 +374,7 @@ class AmbassadorsPage extends Component {
<AppHeader /> <AppHeader />
<div id="maincontent"> <div id="maincontent">
<section data-spy="scroll" data-target="#mainNav" id="services"> <section data-spy="scroll" data-target="#mainNav" id="services" className="ambs_services">
<div className="containerfix"> <div className="containerfix">
<div className="row"> <div className="row">
<div className="col-md-10 mx-md-auto"> <div className="col-md-10 mx-md-auto">

View file

@ -4,3 +4,7 @@
.merchants_services .MuiNotchedOutline-focused-120 { .merchants_services .MuiNotchedOutline-focused-120 {
border-color: rgb(19, 143, 82) !important; border-color: rgb(19, 143, 82) !important;
} }
.merchants_services table,
.ambs_services table {
min-width: 100% !important;
}

View file

@ -307,10 +307,6 @@ class MerchantsPage extends Component {
}); });
result.data.map(merchant => { result.data.map(merchant => {
const infoDescription = <div>
<div><b>Address</b>: {merchant.address}</div>
{(merchant.phone) && (<div><b>Phone</b>: {merchant.phone}</div>)}
</div>;
if(merchant.telegram){ if(merchant.telegram){
merchant.telegram_original = merchant.telegram; merchant.telegram_original = merchant.telegram;
merchant.telegram = { merchant.telegram = {

View file

@ -24,7 +24,7 @@ const messages = {
'es': messages_es 'es': messages_es
}; };
const language = 'en'; const language = 'es';
// Add IntlProvider to make the internationalization functions visible in all // Add IntlProvider to make the internationalization functions visible in all
// our components. // our components.

View file

@ -73,13 +73,13 @@
"marketing.button.promotional_displays": "Promotional Displays", "marketing.button.promotional_displays": "Promotional Displays",
"marketing.accordion.promotional_displays1": "<a target='_blank' rel='noopener noreferrer' href='https://keybase.io/team/Agorise' class='list-group-item list-group-item-action flex-column align-items-start'> <div class='d-flex w-100 justify-content-between'> <h5 class='mb-1'> Logos, Advertising images, Stickers and Merchandise, etc. (in the /PalmPay folder) </h5> </div> <p class='mb-1'>https://keybase.io/team/Agorise</p> </a>", "marketing.accordion.promotional_displays1": "<a target='_blank' rel='noopener noreferrer' href='https://keybase.io/team/Agorise' class='list-group-item list-group-item-action flex-column align-items-start'> <div class='d-flex w-100 justify-content-between'> <h5 class='mb-1'> Logos, Advertising images, Stickers and Merchandise, etc. (in the /PalmPay folder) </h5> </div> <p class='mb-1'>https://keybase.io/team/Agorise</p> </a>",
"ambassadors.title": "Ambassadors", "ambassadors.title": "Embajadores",
"ambassadors.merchants_link_description": "place of business", "ambassadors.merchants_link_description": "lugar de negocios",
"ambassadors.description1": "PalmPay Ambassadors are located in your city, or very near to you. Their job is to teach topics concerning Cryptocurrencies and Blockchains. Most offer local Meetups and Workshops too. So, if you are interested in these topics and would like to learn more, or even accept Cryptocurrencies at your ", "ambassadors.description1": "Los embajadores de PalmPay están ubicados en su ciudad o muy cerca de usted. Su trabajo es enseñar temas relacionados con las criptomonedas y las cadenas de bloques. La mayoría ofrece también reuniones y talleres locales. Por lo tanto, si está interesado en estos temas y desea obtener más información, o incluso aceptar Cryptocurrencies en su ",
"ambassadors.description2": ", then be sure to contact a PalmPay Ambassador near you. If you are having trouble finding an Ambassador or would like to apply, feel free to <a target='_blank' rel='noopener noreferrer' href='https://t.me/Agorise'>contact us on Telegram</a> any time, we are glad to assist.", "ambassadors.description2": ", entonces asegúrese de contactar a un embajador de PalmPay cerca de usted. Si tiene problemas para encontrar un Embajador o le gustaría presentar una solicitud, no dude en <a target='_blank' rel='noopener noreferrer' href='https://t.me/Agorise'>contáctenos en Telegram</a> cualquier momento, estamos encantados de ayudarle.",
"merchants.title": "Merchants", "merchants.title": "Mercantes",
"merchants.ambassadors_link_description": "PalmPay Ambassadors", "merchants.ambassadors_link_description": "Embajadores PalmPay",
"merchants.description1": "PalmPay merchants are the backbone of the new Crypto Economy. If you are looking for businesses that will accept your Cryptocurrency, then just use the Search and Map data below. More merchants will be added here as the ", "merchants.description1": "Los comerciantes de PalmPay son la columna vertebral de la nueva Crypto Economy. Si está buscando negocios que acepten su Cryptocurrency, simplemente use los datos de Búsqueda y Mapa a continuación. Más comerciantes serán agregados aquí como el ",
"merchants.description2": " inform us. If you need help, just <a target='_blank' rel='noopener noreferrer' href='https://t.me/Agorise'>join us on Telegram</a> and we will be glad to assist you." "merchants.description2": " informenos. Si necesitas ayuda, solo <a target='_blank' rel='noopener noreferrer' href='https://t.me/Agorise'>únete a nosotros en Telegram</a> y estaremos encantados de atenderte."
} }

View file

@ -3,7 +3,7 @@ import feathers from '@feathersjs/client';
const app = feathers(); const app = feathers();
// Change to your production ambassador web service // Change to your production ambassador web service
//const restClient = feathers.rest('http://localhost:3030'); //const restClient = feathers.rest('http://localhost:3030');
const restClient = feathers.rest('https://intranet.palmpay.io'); const restClient = feathers.rest('https://websvc.palmpay.io');
// Configure an Fetch AJAX library with that client. For fetch details see https://facebook.github.io/react-native/docs/network.html // Configure an Fetch AJAX library with that client. For fetch details see https://facebook.github.io/react-native/docs/network.html
// For rest details see https://docs.feathersjs.com/api/client/rest.html // For rest details see https://docs.feathersjs.com/api/client/rest.html