diff --git a/backend/src/models/contact.go b/backend/src/models/contact.go index 0ab56825..3d904c91 100644 --- a/backend/src/models/contact.go +++ b/backend/src/models/contact.go @@ -8,7 +8,6 @@ import ( type ContactPhone struct { Phone string `json:"phone" bson:"phone"` - Valid bool `json:"valid" bson:"valid"` } type ContactSocials struct { @@ -22,7 +21,6 @@ type ContactSocials struct { type ContactMail struct { Mail string `json:"mail" bson:"mail"` Personal bool `json:"personal" bson:"personal"` - Valid bool `json:"valid" bson:"valid"` } type Gender string @@ -51,11 +49,11 @@ type Contact struct { Mails []ContactMail `json:"mails" bson:"mails"` } -// HasPhone (phone) returns true if contact has a valid phone +// HasPhone (phone) returns true if contact has a phone // number that is a case insensitive partial match to `phone` func (c *Contact) HasPhone(p string) bool { for _, s := range c.Phones { - if strings.Contains(strings.ToLower(s.Phone), strings.ToLower(p)) && s.Valid { + if strings.Contains(strings.ToLower(s.Phone), strings.ToLower(p)) { return true } } @@ -66,7 +64,7 @@ func (c *Contact) HasPhone(p string) bool { // that is a case insensitive partial match to `mail` func (c *Contact) HasMail(m string) bool { for _, s := range c.Mails { - if strings.Contains(strings.ToLower(s.Mail), strings.ToLower(m)) && s.Valid { + if strings.Contains(strings.ToLower(s.Mail), strings.ToLower(m)) { return true } } diff --git a/backend/src/router/contacts_test.go b/backend/src/router/contacts_test.go index 4ee0df7c..5731fe03 100644 --- a/backend/src/router/contacts_test.go +++ b/backend/src/router/contacts_test.go @@ -17,7 +17,6 @@ var ( Contact1 *models.Contact Contact1Phone = models.ContactPhone{ Phone: "1", - Valid: true, } Contact1Socials = models.ContactSocials{ Facebook: "facebook", @@ -29,7 +28,6 @@ var ( Contact1Mail = models.ContactMail{ Mail: "2", Personal: true, - Valid: true, } Contact1Data = mongodb.CreateContactData{ Phones: append(make([]models.ContactPhone, 0), Contact1Phone), @@ -39,7 +37,6 @@ var ( Contact2 *models.Contact Contact2Phone = models.ContactPhone{ Phone: "3", - Valid: true, } Contact2Socials = models.ContactSocials{ Facebook: "facebook2", @@ -51,7 +48,6 @@ var ( Contact2Mail = models.ContactMail{ Mail: "4", Personal: true, - Valid: true, } Contact2Data = mongodb.CreateContactData{ Phones: append(make([]models.ContactPhone, 0), Contact2Phone), diff --git a/frontend/src/components/ContactCard.vue b/frontend/src/components/ContactCard.vue index f4cae330..606a7084 100644 --- a/frontend/src/components/ContactCard.vue +++ b/frontend/src/components/ContactCard.vue @@ -122,10 +122,7 @@ -
+
Personal - - Invalid -
@@ -168,15 +158,6 @@ > {{ phone.phone }} -
- - Invalid - -
diff --git a/frontend/src/components/ParticipationsCard.vue b/frontend/src/components/ParticipationsCard.vue index 8d143a6a..1215c4b0 100644 --- a/frontend/src/components/ParticipationsCard.vue +++ b/frontend/src/components/ParticipationsCard.vue @@ -1,63 +1,44 @@ diff --git a/frontend/src/components/cards/WorkflowCard.vue b/frontend/src/components/cards/WorkflowCard.vue index 0a82461f..628e1ed4 100644 --- a/frontend/src/components/cards/WorkflowCard.vue +++ b/frontend/src/components/cards/WorkflowCard.vue @@ -78,65 +78,69 @@ watch( diff --git a/frontend/src/components/companies/ContactForm.vue b/frontend/src/components/companies/ContactForm.vue index 44311468..67d7a877 100644 --- a/frontend/src/components/companies/ContactForm.vue +++ b/frontend/src/components/companies/ContactForm.vue @@ -316,8 +316,8 @@ const formData = reactive>({ contact: { gender: undefined, language: undefined, - mails: [{ mail: "", personal: false, valid: true }], - phones: [{ phone: "", valid: true }], + mails: [{ mail: "", personal: false }], + phones: [{ phone: "" }], socials: { linkedin: "", twitter: "", @@ -339,11 +339,11 @@ watch( formData.contact.mails = newData.contact.mails.length > 0 ? [...newData.contact.mails] - : [{ mail: "", personal: false, valid: true }]; + : [{ mail: "", personal: false }]; formData.contact.phones = newData.contact.phones.length > 0 ? [...newData.contact.phones] - : [{ phone: "", valid: true }]; + : [{ phone: "" }]; formData.contact.socials = { ...newData.contact.socials }; } }, @@ -370,7 +370,7 @@ const validationMessage = computed(() => { }); const addEmail = () => { - formData.contact.mails.push({ mail: "", personal: false, valid: true }); + formData.contact.mails.push({ mail: "", personal: false }); }; const removeEmail = (index: number) => { @@ -378,7 +378,7 @@ const removeEmail = (index: number) => { }; const addPhone = () => { - formData.contact.phones.push({ phone: "", valid: true }); + formData.contact.phones.push({ phone: "" }); }; const removePhone = (index: number) => { diff --git a/frontend/src/components/companies/CreateCompanyForm.vue b/frontend/src/components/companies/CreateCompanyForm.vue index 64529b73..952d61d6 100644 --- a/frontend/src/components/companies/CreateCompanyForm.vue +++ b/frontend/src/components/companies/CreateCompanyForm.vue @@ -437,7 +437,6 @@ const addEmail = (repIndex: number) => { representatives.value[repIndex].contact!.mails.push({ mail: "", personal: false, - valid: true, }); }; @@ -448,7 +447,6 @@ const removeEmail = (repIndex: number, emailIndex: number) => { const addPhone = (repIndex: number) => { representatives.value[repIndex].contact!.phones.push({ phone: "", - valid: true, }); }; diff --git a/frontend/src/components/companies/RepresentativeForm.vue b/frontend/src/components/companies/RepresentativeForm.vue index 8adbf2f6..106e6740 100644 --- a/frontend/src/components/companies/RepresentativeForm.vue +++ b/frontend/src/components/companies/RepresentativeForm.vue @@ -240,8 +240,8 @@ const showMoreSocials = ref(false); const formData = reactive>({ name: "", contact: { - mails: [{ mail: "", personal: false, valid: true }], - phones: [{ phone: "", valid: true }], + mails: [{ mail: "", personal: false }], + phones: [{ phone: "" }], socials: { linkedin: "", twitter: "", @@ -266,7 +266,7 @@ const validationMessage = computed(() => { }); const addEmail = () => { - formData.contact.mails.push({ mail: "", personal: false, valid: true }); + formData.contact.mails.push({ mail: "", personal: false }); }; const removeEmail = (index: number) => { @@ -274,7 +274,7 @@ const removeEmail = (index: number) => { }; const addPhone = () => { - formData.contact.phones.push({ phone: "", valid: true }); + formData.contact.phones.push({ phone: "" }); }; const removePhone = (index: number) => { diff --git a/frontend/src/dto/contacts.ts b/frontend/src/dto/contacts.ts index 19172ac9..baf32306 100644 --- a/frontend/src/dto/contacts.ts +++ b/frontend/src/dto/contacts.ts @@ -2,7 +2,6 @@ import type { ObjectID } from "."; export interface ContactPhone { phone: string; - valid: boolean; } export interface ContactSocials { @@ -16,7 +15,6 @@ export interface ContactSocials { export interface ContactMail { mail: string; personal: boolean; - valid: boolean; } export enum Gender { diff --git a/frontend/src/views/Dashboard/SettingsView.vue b/frontend/src/views/Dashboard/SettingsView.vue index 6a0ae7be..fce849e5 100644 --- a/frontend/src/views/Dashboard/SettingsView.vue +++ b/frontend/src/views/Dashboard/SettingsView.vue @@ -130,13 +130,6 @@ > Personal - - Invalid - @@ -162,13 +155,6 @@ > {{ phone.phone }} - - Invalid -