diff --git a/client/.gitignore b/client/.gitignore index 5108621b..3da6f6e2 100644 --- a/client/.gitignore +++ b/client/.gitignore @@ -1,12 +1,12 @@ # See https://help.github.com/ignore-files/ for more about ignoring files. # compiled output -/dist/ +**/dist /tmp/ # dependencies /bower_components/ -/node_modules/ +**/node_modules # misc /.env* diff --git a/client/app/components/packages/projects/new.js b/client/app/components/packages/projects/new.js deleted file mode 100644 index 9d68fd65..00000000 --- a/client/app/components/packages/projects/new.js +++ /dev/null @@ -1,64 +0,0 @@ -import Component from '@glimmer/component'; -import { action } from '@ember/object'; -import { inject as service } from '@ember/service'; -import SubmittableProjectsNewForm from '../../../validations/submittable-projects-new-form'; - -export default class ProjectsNewFormComponent extends Component { - validations = { - SubmittableProjectsNewForm, - }; - - @service - router; - - @service - store; - - @action - async submitPackage() { - const primaryContactInput = { - first: this.args.package.primaryContactFirstName, - last: this.args.package.primaryContactLastName, - email: this.args.package.primaryContactEmail, - phone: this.args.package.primaryContactPhone, - role: 'contact', - }; - - const applicantInput = { - first: this.args.package.applicantFirstName, - last: this.args.package.applicantLastName, - email: this.args.package.applicantEmail, - phone: this.args.package.applicantPhone, - role: 'applicant', - }; - - const contactInputs = [primaryContactInput, applicantInput]; - try { - const contactPromises = contactInputs - .map((contact) => this.store.queryRecord('contact', - { - email: contact.email, - includeAllStatusCodes: true, - })); - - const contacts = await Promise.all(contactPromises); - - const verifiedContactPromises = contacts.map((contact, index) => { - if (contact.id === '-1') { - const contactInput = contactInputs[index]; - const contactModel = this.store.createRecord('contact', { - firstname: contactInput.first, - lastname: contactInput.last, - emailaddress1: contactInput.email, - telephone1: contactInput.phone, - }); - return contactModel.save(); - } - return contact; - }); - await Promise.all(verifiedContactPromises); - } catch { - console.log('Save new project package error'); - } - } -} diff --git a/client/app/components/packages/projects/new.hbs b/client/app/components/projects/new.hbs similarity index 76% rename from client/app/components/packages/projects/new.hbs rename to client/app/components/projects/new.hbs index 589721b5..b3c0a282 100644 --- a/client/app/components/packages/projects/new.hbs +++ b/client/app/components/projects/new.hbs @@ -20,15 +20,25 @@ Planning will contact you with the next steps.

- + + -