diff --git a/app/app/components/submit-modal.js b/app/app/components/submit-modal.js index 05d93b5..c07e68a 100644 --- a/app/app/components/submit-modal.js +++ b/app/app/components/submit-modal.js @@ -8,6 +8,7 @@ import mutation from 'cuf/gql/mutations/company'; const fields = [ 'address1', 'address2', + 'teaser', 'body', 'city', 'country', @@ -21,6 +22,15 @@ const fields = [ 'zip', 'sectionIds', 'logo', + 'numberOfEmployees', + 'trainingInformation', + 'yearsInOperation', + 'salesRegion', + 'servicesProvided', + 'salesChannels', + 'productSummary', + 'serviceInformation', + 'warrantyInformation', ]; const filterModel = (model = {}) => { diff --git a/app/app/controllers/display/company.js b/app/app/controllers/display/company.js index 43a2406..d9e3fd0 100644 --- a/app/app/controllers/display/company.js +++ b/app/app/controllers/display/company.js @@ -1,6 +1,63 @@ import Controller from '@ember/controller'; import { computed } from '@ember/object'; +const fields = [ + [ + { label: 'Name', key: 'name' } + ], + [ + { label: 'Address 1', key: 'address1', class: 'col-md-4' }, + { label: 'Address 2', key: 'address2', class: 'col-md-4' }, + { label: 'City', key: 'city', class: 'col-md-4' }, + ], + [ + { label: 'State', key: 'state', class: 'col-md-4' }, + { label: 'Zip/Postal Code', key: 'zip', class: 'col-md-4' }, + { label: 'Country', key: 'country', class: 'col-md-4' }, + ], + [ + { label: 'Phone Number', key: 'phone', class: 'col-md-4' }, + { label: 'Phone (Toll-free)', key: 'tollfree', class: 'col-md-4' }, + { label: 'Fax Number', key: 'fax', class: 'col-md-4' }, + ], + [ + { label: 'Website', key: 'website', class: 'col-md-6' }, + { label: 'Email Address', key: 'email', class: 'col-md-6' }, + ], + [ + { label: 'Teaser', key: 'teaser', type: 'long' }, + ], + [ + { label: 'Description', key: 'body', type: 'long' }, + ], +]; + +const extra = [ + [ + { label: 'Number of employees', key: 'numberOfEmployees', class: 'col-md-6' }, + { label: 'Years in operation', key: 'yearsInOperation', class: 'col-md-6' }, + ], + [ + { label: 'Sales regions', key: 'salesRegion', class: 'col-md-6' }, + { label: 'Sales channels', key: 'salesChannels', class: 'col-md-6' }, + ], + [ + { label: 'Product summary', key: 'productSummary', type: 'long' }, + ], + [ + { label: 'Training information', key: 'trainingInformation', type: 'long' }, + ], + [ + { label: 'Services provided', key: 'servicesProvided', type: 'long' }, + ], + [ + { label: 'Warranty information', key: 'warrantyInformation', type: 'long' }, + ], + [ + { label: 'Service information', key: 'serviceInformation', type: 'long' }, + ], +]; + export default Controller.extend({ // Merges contacts into a single array contacts: computed('model.{salesContacts,listingContacts,publicContacts}.[]', function() { @@ -15,83 +72,12 @@ export default Controller.extend({ }), // Determines display order, labels, and visibility/type of updateable fields - fields: [ // eslint-disable-line ember/avoid-leaking-state-in-ember-objects - [ - { - label: 'Name', - key: 'name', - } - ], - [ - { - label: 'Address 1', - key: 'address1', - class: 'col-md-4', - }, - { - label: 'Address 2', - key: 'address2', - class: 'col-md-4', - }, - { - label: 'City', - key: 'city', - class: 'col-md-4', - }, - ], - [ - { - label: 'State', - key: 'state', - class: 'col-md-4', - }, - { - label: 'Zip/Postal Code', - key: 'zip', - class: 'col-md-4', - }, - { - label: 'Country', - key: 'country', - class: 'col-md-4', - }, - ], - [ - { - label: 'Phone Number', - key: 'phone', - class: 'col-md-4', - }, - { - label: 'Phone (Toll-free)', - key: 'tollfree', - class: 'col-md-4', - }, - { - label: 'Fax Number', - key: 'fax', - class: 'col-md-4', - }, - ], - [ - { - label: 'Website', - key: 'website', - class: 'col-md-6', - }, - { - label: 'Email Address', - key: 'email', - class: 'col-md-6', - }, - ], - [ - { - label: 'Description', - key: 'body', - type: 'long', - }, - ], - ], -}); + fields: null, + extra: null, + init() { + this._super(); + this.set('fields', fields); + this.set('extra', extra); + }, +}); diff --git a/app/app/gql/queries/company.graphql b/app/app/gql/queries/company.graphql index e8f5706..da46722 100644 --- a/app/app/gql/queries/company.graphql +++ b/app/app/gql/queries/company.graphql @@ -1,6 +1,7 @@ query PlatformContentHash($input: Base4PlatformContentQueryHash!) { base4PlatformContentHash(input: $input) { name + teaser hash type body @@ -27,6 +28,17 @@ query PlatformContentHash($input: Base4PlatformContentQueryHash!) { fax website email + + numberOfEmployees + trainingInformation + yearsInOperation + salesRegion + servicesProvided + salesChannels + productSummary + serviceInformation + warrantyInformation + # sections { # name # children { diff --git a/app/app/gql/queries/config.graphql b/app/app/gql/queries/config.graphql index be95b23..7b9a8c8 100644 --- a/app/app/gql/queries/config.graphql +++ b/app/app/gql/queries/config.graphql @@ -3,5 +3,6 @@ query Config { domain logo ids + isPmmi } } diff --git a/app/app/routes/display.js b/app/app/routes/display.js index f227242..d39f690 100644 --- a/app/app/routes/display.js +++ b/app/app/routes/display.js @@ -10,7 +10,17 @@ export default Route.extend(RouteQueryManager, { model() { return this.get('apollo').watchQuery({ query, fetchPolicy: 'cache-and-network' }, 'config'); }, - afterModel({ domain, logo, ids }) { - this.config.load({ domain, logo, ids }); + afterModel({ + domain, + logo, + ids, + isPmmi, + }) { + this.config.load({ + domain, + logo, + ids, + isPmmi, + }); }, }); diff --git a/app/app/styles/app.scss b/app/app/styles/app.scss index 4a21d6b..667f472 100644 --- a/app/app/styles/app.scss +++ b/app/app/styles/app.scss @@ -49,3 +49,7 @@ body.transitioning { border: 1px solid rgb(24, 188, 156); border-right: none; } + +.froala-editor-container { + min-width: 100%; +} diff --git a/app/app/templates/display/company/edit/fields.hbs b/app/app/templates/display/company/edit/fields.hbs index 906d0e1..2a986f9 100644 --- a/app/app/templates/display/company/edit/fields.hbs +++ b/app/app/templates/display/company/edit/fields.hbs @@ -1,7 +1,16 @@ {{#each fields as |row|}} -