diff --git a/app/controllers/api/v1/accounts/contacts/notes_controller.rb b/app/controllers/api/v1/accounts/contacts/notes_controller.rb index d49f3b838..fb9f3c5c3 100644 --- a/app/controllers/api/v1/accounts/contacts/notes_controller.rb +++ b/app/controllers/api/v1/accounts/contacts/notes_controller.rb @@ -2,7 +2,7 @@ class Api::V1::Accounts::Contacts::NotesController < Api::V1::Accounts::Contacts before_action :note, except: [:index, :create] def index - @notes = @contact.notes.includes(:user) + @notes = @contact.notes.latest.includes(:user) end def create diff --git a/app/javascript/dashboard/api/contactNotes.js b/app/javascript/dashboard/api/contactNotes.js index 9508ea9dc..5be33784a 100644 --- a/app/javascript/dashboard/api/contactNotes.js +++ b/app/javascript/dashboard/api/contactNotes.js @@ -2,7 +2,27 @@ import ApiClient from './ApiClient'; class ContactNotes extends ApiClient { constructor() { - super('contact_notes', { accountScoped: true }); + super('notes', { accountScoped: true }); + this.contactId = null; + } + + get url() { + return `${this.baseUrl()}/contacts/${this.contactId}/notes`; + } + + get(contactId) { + this.contactId = contactId; + return super.get(); + } + + create(contactId, content) { + this.contactId = contactId; + return super.create({ content }); + } + + delete(contactId, id) { + this.contactId = contactId; + return super.delete(id); } } diff --git a/app/javascript/dashboard/assets/scss/_foundation-custom.scss b/app/javascript/dashboard/assets/scss/_foundation-custom.scss index 0e2329b66..50b78bf50 100644 --- a/app/javascript/dashboard/assets/scss/_foundation-custom.scss +++ b/app/javascript/dashboard/assets/scss/_foundation-custom.scss @@ -9,7 +9,7 @@ .card { margin-bottom: var(--space-small); - padding: var(--space-small); + padding: var(--space-normal); } .button-wrapper .button.link.grey-btn { diff --git a/app/javascript/dashboard/assets/scss/_helper-classes.scss b/app/javascript/dashboard/assets/scss/_helper-classes.scss index 416ec0185..a8a5a0b93 100644 --- a/app/javascript/dashboard/assets/scss/_helper-classes.scss +++ b/app/javascript/dashboard/assets/scss/_helper-classes.scss @@ -55,6 +55,10 @@ justify-content: space-between; } -.w-100 { +.w-full { width: 100%; } + +.h-full { + height: 100%; +} diff --git a/app/javascript/dashboard/assets/scss/_utility-helpers.scss b/app/javascript/dashboard/assets/scss/_utility-helpers.scss index 60fecb994..8785f1313 100644 --- a/app/javascript/dashboard/assets/scss/_utility-helpers.scss +++ b/app/javascript/dashboard/assets/scss/_utility-helpers.scss @@ -1,3 +1,44 @@ .margin-right-small { margin-right: var(--space-small); } + +.fs-small { + font-size: var(--font-size-small); +} + +.fs-default { + font-size: var(--font-size-default); +} + +.fw-medium { + font-weight: var(--font-weight-medium); +} + +.p-normal { + padding: var(--space-normal); +} + +.overflow-scroll { + overflow: scroll; +} + +.overflow-auto { + overflow: auto; +} + +.overflow-hidden { + overflow: hidden; +} + + +.border-right { + border-right: 1px solid var(--color-border); +} + +.border-left { + border-left: 1px solid var(--color-border); +} + +.bg-white { + background-color: var(--white); +} diff --git a/app/javascript/dashboard/assets/scss/_woot.scss b/app/javascript/dashboard/assets/scss/_woot.scss index 7debac956..e709327dc 100644 --- a/app/javascript/dashboard/assets/scss/_woot.scss +++ b/app/javascript/dashboard/assets/scss/_woot.scss @@ -14,7 +14,6 @@ @import 'helper-classes'; @import 'formulate'; @import 'date-picker'; -@import 'utility-helpers'; @import 'foundation-sites/scss/foundation'; @import '~bourbon/core/bourbon'; @@ -50,3 +49,4 @@ @import 'plugins/multiselect'; @import 'plugins/dropdown'; @import '~shared/assets/stylesheets/ionicons'; +@import 'utility-helpers'; diff --git a/app/javascript/dashboard/assets/scss/widgets/_reports.scss b/app/javascript/dashboard/assets/scss/widgets/_reports.scss index 7280b6d4d..eeb958ff3 100644 --- a/app/javascript/dashboard/assets/scss/widgets/_reports.scss +++ b/app/javascript/dashboard/assets/scss/widgets/_reports.scss @@ -21,10 +21,6 @@ border: 1px solid var(--color-border); } -.margin-right-small { - margin-right: var(--space-small); -} - .display-flex { display: flex; } diff --git a/app/javascript/dashboard/components/widgets/BackButton.vue b/app/javascript/dashboard/components/widgets/BackButton.vue index 9bf87d131..758fd7ae2 100644 --- a/app/javascript/dashboard/components/widgets/BackButton.vue +++ b/app/javascript/dashboard/components/widgets/BackButton.vue @@ -1,6 +1,6 @@ - - diff --git a/app/javascript/dashboard/modules/notes/NotesOnContactPage.vue b/app/javascript/dashboard/modules/notes/NotesOnContactPage.vue index 256f9435e..6ce3d9c1a 100644 --- a/app/javascript/dashboard/modules/notes/NotesOnContactPage.vue +++ b/app/javascript/dashboard/modules/notes/NotesOnContactPage.vue @@ -1,8 +1,14 @@ - - diff --git a/app/javascript/dashboard/routes/dashboard/contacts/components/ContactInfoPanel.vue b/app/javascript/dashboard/routes/dashboard/contacts/components/ContactInfoPanel.vue index 041052a09..3c32b7212 100644 --- a/app/javascript/dashboard/routes/dashboard/contacts/components/ContactInfoPanel.vue +++ b/app/javascript/dashboard/routes/dashboard/contacts/components/ContactInfoPanel.vue @@ -1,9 +1,17 @@