From 40db0d5f7d828c54f4477374e508435497ceea86 Mon Sep 17 00:00:00 2001 From: "Petter H. Juliussen" Date: Tue, 10 Oct 2023 09:27:36 +0200 Subject: [PATCH] Fix key result values table responsiveness --- src/components/KeyResultValuesList.vue | 126 ++++++------------------- 1 file changed, 30 insertions(+), 96 deletions(-) diff --git a/src/components/KeyResultValuesList.vue b/src/components/KeyResultValuesList.vue index 6f85d1538..1c5643d5b 100644 --- a/src/components/KeyResultValuesList.vue +++ b/src/components/KeyResultValuesList.vue @@ -7,6 +7,7 @@ {{ $t('widget.history.date') }} {{ $t('widget.history.comment') }} + @@ -15,56 +16,30 @@ {{ formatValue(record.value) }} - {{ dateExtraShort(record.timestamp.toDate()) }} + + {{ dateExtraShort(record.timestamp.toDate()) }} + + + +

{{ record.comment }}

-
-

{{ record.comment }}

-
- - -
-
+ {{ addedBy(record) }} -
- - -
+ - - @@ -73,16 +48,12 @@ import { mapGetters } from 'vuex'; import { dateExtraShort } from '@/util'; import { formatValue } from '@/util/keyResultProgress'; import { PktButton } from '@oslokommune/punkt-vue2'; -import ProfileModal from '@/components/modals/ProfileModal.vue'; -import UserLink from '@/components/widgets/WidgetProgressHistory/UserLink.vue'; export default { name: 'KeyResultValuesList', components: { PktButton, - ProfileModal, - UserLink, }, props: { @@ -92,11 +63,6 @@ export default { }, }, - data: () => ({ - showProfileModal: false, - chosenProfileId: null, - }), - computed: { ...mapGetters(['hasEditRights']), }, @@ -105,14 +71,9 @@ export default { formatValue, dateExtraShort, - openProfileModal(profileId) { - this.showProfileModal = true; - this.chosenProfileId = profileId; - }, - - closeProfileModal() { - this.showProfileModal = false; - this.chosenProfileId = null; + addedBy(record) { + const user = record.editedBy || record.createdBy; + return user ? user.displayName || user.id : null; }, }, }; @@ -134,7 +95,7 @@ export default { border-spacing: 0 0.5rem; th { - padding: 0 2rem; + padding: 0 1rem; text-align: left; @include get-text('pkt-txt-14-medium'); @@ -149,13 +110,15 @@ export default { } td { - padding: 1rem 2rem; + padding: 1rem; text-align: left; + text-wrap: balance; background-color: var(--color-white); @include get-text('pkt-txt-14'); &:nth-child(1) { @include get-text('pkt-txt-16-bold'); + padding: 1rem 2rem; color: var(--color-yellow-100); text-align: center; text-wrap: nowrap; @@ -163,50 +126,21 @@ export default { } &:nth-child(2) { - padding-right: 1rem; + padding-left: 2rem; text-align: center; } &:nth-child(3) { - padding-left: 1rem; - - > div { - display: flex; - flex-direction: column; - gap: 0.5rem; - - > p { - @include get-text('pkt-txt-14-light'); - } - - > div { - display: flex; - gap: 1rem; - align-items: center; - - .pkt-btn { - margin-left: auto; - } - - @include bp('desktop-up') { - display: none; - } - } - } + width: 100%; } &:nth-child(4) { @include table-cell-desktop-up; + min-width: 10rem; + } - > div { - display: flex; - gap: 0.5rem; - align-items: center; - - .pkt-btn { - margin-left: auto; - } - } + &:nth-child(5) { + padding-left: 0; } } }