mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
Remove case sensitive
This commit is contained in:
@@ -68,7 +68,7 @@ export class AttendeesPageModal implements OnInit {
|
|||||||
|
|
||||||
const result = this.taskParticipants.concat( this.taskParticipantsCc).find((contact, index)=>{
|
const result = this.taskParticipants.concat( this.taskParticipantsCc).find((contact, index)=>{
|
||||||
|
|
||||||
if(contact.Name == itm.Name && contact.EmailAddress == itm.EmailAddress){
|
if(contact.Name.toLocaleLowerCase() == itm.Name.toLocaleLowerCase() && contact.EmailAddress.toLocaleLowerCase() == itm.EmailAddress.toLocaleLowerCase()){
|
||||||
index = index;
|
index = index;
|
||||||
return contact;
|
return contact;
|
||||||
}
|
}
|
||||||
@@ -85,7 +85,7 @@ export class AttendeesPageModal implements OnInit {
|
|||||||
|
|
||||||
this.taskParticipants = this.taskParticipants.filter((contact, index) =>{
|
this.taskParticipants = this.taskParticipants.filter((contact, index) =>{
|
||||||
|
|
||||||
if(contact.Name != itm.Name && contact.EmailAddress != itm.EmailAddress){
|
if(contact.Name.toLocaleLowerCase() != itm.Name.toLocaleLowerCase() && contact.EmailAddress.toLocaleLowerCase() != itm.EmailAddress.toLocaleLowerCase()){
|
||||||
return contact;
|
return contact;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@@ -96,7 +96,7 @@ export class AttendeesPageModal implements OnInit {
|
|||||||
|
|
||||||
this.taskParticipantsCc = this.taskParticipantsCc.filter((contact, index) =>{
|
this.taskParticipantsCc = this.taskParticipantsCc.filter((contact, index) =>{
|
||||||
|
|
||||||
if(contact.Name != itm.Name && contact.EmailAddress != itm.EmailAddress){
|
if(contact.Name.toLocaleLowerCase() != itm.Name.toLocaleLowerCase() && contact.EmailAddress.toLocaleLowerCase() != itm.EmailAddress.toLocaleLowerCase()){
|
||||||
return contact;
|
return contact;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@@ -126,7 +126,7 @@ export class AttendeesPageModal implements OnInit {
|
|||||||
{
|
{
|
||||||
this.eventPersons.forEach(attendee => {
|
this.eventPersons.forEach(attendee => {
|
||||||
const index: number = result.findIndex((cont) => {
|
const index: number = result.findIndex((cont) => {
|
||||||
return cont.EmailAddress == attendee.EmailAddress
|
return cont.EmailAddress.toLocaleLowerCase() == attendee.EmailAddress.toLocaleLowerCase()
|
||||||
});
|
});
|
||||||
|
|
||||||
result.splice(index, 1);
|
result.splice(index, 1);
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import { formatDate } from '@angular/common';
|
|||||||
import { SenderPage } from 'src/app/pages/search/sender/sender.page';
|
import { SenderPage } from 'src/app/pages/search/sender/sender.page';
|
||||||
import { OrganicEntityPage } from 'src/app/pages/search/organic-entity/organic-entity.page';
|
import { OrganicEntityPage } from 'src/app/pages/search/organic-entity/organic-entity.page';
|
||||||
import WordCloud from 'src/plugin/wordcloud2.js';
|
import WordCloud from 'src/plugin/wordcloud2.js';
|
||||||
|
import { slugify } from 'src/plugin/javascript-remove-accents.js';
|
||||||
import { ViewEventPage } from 'src/app/pages/agenda/view-event/view-event.page';
|
import { ViewEventPage } from 'src/app/pages/agenda/view-event/view-event.page';
|
||||||
import { PublicationDetailPage } from '../publications/view-publications/publication-detail/publication-detail.page';
|
import { PublicationDetailPage } from '../publications/view-publications/publication-detail/publication-detail.page';
|
||||||
import { DocumentDetailPage } from 'src/app/modals/document-detail/document-detail.page';
|
import { DocumentDetailPage } from 'src/app/modals/document-detail/document-detail.page';
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import { ModalController } from '@ionic/angular';
|
|||||||
import { ContactsService } from 'src/app/services/contacts.service';
|
import { ContactsService } from 'src/app/services/contacts.service';
|
||||||
import { EventPerson } from 'src/app/models/eventperson.model';
|
import { EventPerson } from 'src/app/models/eventperson.model';
|
||||||
import { removeDuplicate } from 'src/plugin/removeDuplicate.js'
|
import { removeDuplicate } from 'src/plugin/removeDuplicate.js'
|
||||||
|
import { slugify } from 'src/plugin/javascript-remove-accents.js';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-attendee-modal',
|
selector: 'app-attendee-modal',
|
||||||
@@ -119,7 +120,7 @@ export class AttendeePage implements OnInit {
|
|||||||
|
|
||||||
const result = this.LtaskParticipants.concat(this.LtaskParticipantsCc).find((contact, index)=>{
|
const result = this.LtaskParticipants.concat(this.LtaskParticipantsCc).find((contact, index)=>{
|
||||||
|
|
||||||
if(contact.Name == itm.Name && contact.EmailAddress == itm.EmailAddress){
|
if(contact.Name.toLowerCase() == itm.Name.toLowerCase() && contact.EmailAddress.toLowerCase() == itm.EmailAddress.toLowerCase()){
|
||||||
index = index;
|
index = index;
|
||||||
return contact;
|
return contact;
|
||||||
}
|
}
|
||||||
@@ -133,7 +134,7 @@ export class AttendeePage implements OnInit {
|
|||||||
|
|
||||||
const result2 = this.LtaskParticipantsCc.find((contact, index)=>{
|
const result2 = this.LtaskParticipantsCc.find((contact, index)=>{
|
||||||
|
|
||||||
if(contact.Name == itm.Name && contact.EmailAddress == itm.EmailAddress){
|
if(contact.Name.toLowerCase() == itm.Name && contact.EmailAddress.toLowerCase() == itm.EmailAddress.toLowerCase()){
|
||||||
index = index;
|
index = index;
|
||||||
return contact;
|
return contact;
|
||||||
}
|
}
|
||||||
@@ -155,7 +156,7 @@ export class AttendeePage implements OnInit {
|
|||||||
|
|
||||||
this.LtaskParticipants = this.LtaskParticipants.filter((contact, index) =>{
|
this.LtaskParticipants = this.LtaskParticipants.filter((contact, index) =>{
|
||||||
|
|
||||||
if(contact.Name != itm.Name && contact.EmailAddress != itm.EmailAddress){
|
if(contact.Name.toLocaleLowerCase() != itm.Name.toLocaleLowerCase() && contact.EmailAddress.toLocaleLowerCase() != itm.EmailAddress.toLocaleLowerCase()){
|
||||||
return contact;
|
return contact;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@@ -166,7 +167,7 @@ export class AttendeePage implements OnInit {
|
|||||||
|
|
||||||
this.LtaskParticipantsCc = this.LtaskParticipantsCc.filter((contact, index) =>{
|
this.LtaskParticipantsCc = this.LtaskParticipantsCc.filter((contact, index) =>{
|
||||||
|
|
||||||
if(contact.Name != itm.Name && contact.EmailAddress != itm.EmailAddress){
|
if(contact.Name.toLocaleLowerCase() != itm.Name.toLocaleLowerCase() && contact.EmailAddress.toLocaleLowerCase() != itm.EmailAddress.toLocaleLowerCase()){
|
||||||
return contact;
|
return contact;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@@ -189,7 +190,7 @@ export class AttendeePage implements OnInit {
|
|||||||
{
|
{
|
||||||
this.eventPersons.forEach(attendee => {
|
this.eventPersons.forEach(attendee => {
|
||||||
const index: number = result.findIndex((cont) => {
|
const index: number = result.findIndex((cont) => {
|
||||||
return cont.EmailAddress == attendee.EmailAddress
|
return cont.EmailAddress.toLowerCase() == attendee.EmailAddress.toLowerCase()
|
||||||
});
|
});
|
||||||
|
|
||||||
result.splice(index, 1);
|
result.splice(index, 1);
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
// https://gist.github.com/marcelo-ribeiro/abd651b889e4a20e0bab558a05d38d77
|
||||||
|
|
||||||
|
const accentsMap = new Map([
|
||||||
|
["A", "Á|À|Ã|Â|Ä"],
|
||||||
|
["a", "á|à|ã|â|ä"],
|
||||||
|
["E", "É|È|Ê|Ë"],
|
||||||
|
["e", "é|è|ê|ë"],
|
||||||
|
["I", "Í|Ì|Î|Ï"],
|
||||||
|
["i", "í|ì|î|ï"],
|
||||||
|
["O", "Ó|Ò|Ô|Õ|Ö"],
|
||||||
|
["o", "ó|ò|ô|õ|ö"],
|
||||||
|
["U", "Ú|Ù|Û|Ü"],
|
||||||
|
["u", "ú|ù|û|ü"],
|
||||||
|
["C", "Ç"],
|
||||||
|
["c", "ç"],
|
||||||
|
["N", "Ñ"],
|
||||||
|
["n", "ñ"]
|
||||||
|
]);
|
||||||
|
|
||||||
|
const reducer = (acc, [key]) => acc.replace(new RegExp(accentsMap.get(key), "gi"), key);
|
||||||
|
export const slugify = (text) => [...accentsMap].reduce(reducer, text.toLowerCase());
|
||||||
Reference in New Issue
Block a user