Skip to content

Commit

Permalink
chore: Refactor reports for RTL (#6517)
Browse files Browse the repository at this point in the history
* Refactor reports

* fix: spacing issues and minor fixes

---------

Co-authored-by: Nithin David <1277421+nithindavid@users.noreply.github.com>
  • Loading branch information
iamsivin and nithindavid committed Feb 23, 2023
1 parent 71f2b27 commit 60f953c
Show file tree
Hide file tree
Showing 13 changed files with 58 additions and 62 deletions.
4 changes: 2 additions & 2 deletions app/javascript/dashboard/assets/scss/_date-picker.scss
Expand Up @@ -14,11 +14,11 @@
}

.mx-input {
border: 1px solid var(--color-border);
border: 1px solid var(--s-200);
border-radius: var(--border-radius-normal);
box-shadow: none;
display: flex;
height: 4.6rem;
height: 4.0rem;
}

.mx-input:disabled,
Expand Down
8 changes: 4 additions & 4 deletions app/javascript/dashboard/assets/scss/_foundation-custom.scss
Expand Up @@ -7,6 +7,10 @@
}
}

select {
height: 4.0rem;
}

.card {
margin-bottom: var(--space-small);
padding: var(--space-normal);
Expand Down Expand Up @@ -64,7 +68,3 @@ code {
.padding-right-small {
padding-right: var(--space-one);
}

.margin-right-small {
margin-right: var(--space-small);
}
4 changes: 0 additions & 4 deletions app/javascript/dashboard/assets/scss/_utility-helpers.scss
@@ -1,7 +1,3 @@
.margin-right-small {
margin-right: var(--space-small);
}

.margin-bottom-small {
margin-bottom: var(--space-small);
}
Expand Down
Expand Up @@ -169,7 +169,7 @@
}

.multiselect-wrap--small {
$multiselect-height: 3.8rem;
$multiselect-height: 4.0rem;

.multiselect__tags,
.multiselect__input {
Expand Down
13 changes: 5 additions & 8 deletions app/javascript/dashboard/assets/scss/widgets/_reports.scss
@@ -1,11 +1,3 @@
.date-picker {
margin-left: var(--space-smaller);
}

.margin-left-small {
margin-left: var(--space-smaller);
}

.reports-option__rounded--item {
border-radius: 100%;
height: var(--space-two);
Expand All @@ -26,6 +18,10 @@
display: flex;
}

.reports-option__title {
margin: 0 var(--space-small);
}

.business-hours {
align-items: center;
display: flex;
Expand All @@ -37,6 +33,7 @@

.business-hours-text {
font-size: var(--font-size-small);
margin: 0 var(--space-small);
}

.switch {
Expand Down
Expand Up @@ -24,16 +24,13 @@
<inbox-name
v-if="hasMultipleInboxes"
:inbox="inbox"
class="margin-right-small"
class="margin-right-1"
/>
<span
v-if="isSnoozed"
class="snoozed--display-text margin-right-small"
>
<span v-if="isSnoozed" class="snoozed--display-text margin-right-1">
{{ snoozedDisplayText }}
</span>
<woot-button
class="user--profile__button margin-right-small"
class="user--profile__button margin-right-1"
size="small"
variant="link"
@click="$emit('contact-panel-toggle')"
Expand Down
@@ -1,5 +1,5 @@
<template>
<div class="bulk-action__agents">
<div v-on-clickaway="onClose" class="bulk-action__agents">
<div class="triangle" :style="cssVars">
<svg height="12" viewBox="0 0 24 12" width="24">
<path
Expand Down Expand Up @@ -50,7 +50,6 @@
:status="agent.availability_status"
:username="agent.name"
size="22px"
class="margin-right-small"
/>
<span class="reports-option__title">{{ agent.name }}</span>
</div>
Expand Down
Expand Up @@ -29,7 +29,7 @@
</div>
<woot-button
v-if="hasActiveSegments"
class="margin-right-small clear"
class="margin-right-1 clear"
color-scheme="alert"
icon="delete"
@click="onToggleDeleteSegmentsModal"
Expand All @@ -39,7 +39,7 @@
<div v-if="!hasActiveSegments" class="filters__button-wrap">
<div v-if="hasAppliedFilters" class="filters__applied-indicator" />
<woot-button
class="margin-right-small clear"
class="margin-right-1 clear"
color-scheme="secondary"
data-testid="create-new-contact"
icon="filter"
Expand All @@ -51,7 +51,7 @@

<woot-button
v-if="hasAppliedFilters && !hasActiveSegments"
class="margin-right-small clear"
class="margin-right-1 clear"
color-scheme="alert"
variant="clear"
icon="save"
Expand All @@ -60,7 +60,7 @@
{{ $t('CONTACTS_PAGE.FILTER_CONTACTS_SAVE') }}
</woot-button>
<woot-button
class="margin-right-small clear"
class="margin-right-1 clear"
color-scheme="success"
icon="person-add"
data-testid="create-new-contact"
Expand Down
Expand Up @@ -13,7 +13,7 @@
:src="contact.thumbnail"
:username="contact.name"
size="32px"
class="margin-right-small"
class="margin-right-1"
/>
</settings-header>

Expand Down
Expand Up @@ -58,6 +58,7 @@

<label
v-if="isOnOffType"
class="multiselect-wrap--small"
:class="{ error: $v.selectedAudience.$error }"
>
{{ $t('CAMPAIGN.ADD.FORM.AUDIENCE.LABEL') }}
Expand Down
Expand Up @@ -26,7 +26,7 @@
type="checkbox"
:value="event"
name="subscriptions"
class="margin-right-small"
class="margin-right-1"
/>
<span class="fs-small">
{{ `${getEventLabel(event)} (${event})` }}
Expand Down
@@ -1,6 +1,6 @@
<template>
<div class="flex-container flex-dir-column medium-flex-dir-row">
<div class="small-12 medium-3 pull-right">
<div class="small-12 medium-3 pull-right multiselect-wrap--small">
<multiselect
v-model="currentDateRangeSelection"
track-by="name"
Expand All @@ -17,6 +17,7 @@
</div>
<woot-date-range-picker
v-if="isDateRangeSelected"
class="margin-left-1"
show-range
:value="customDateRange"
:confirm-text="$t('REPORT.CUSTOM_DATE_RANGE.CONFIRM')"
Expand All @@ -25,7 +26,7 @@
/>
<div
v-if="notLast7Days && groupByFilter"
class="small-12 medium-3 pull-right margin-left-small"
class="small-12 medium-3 pull-right margin-left-1 margin-right-1 multiselect-wrap--small"
>
<p aria-hidden="true" class="hide">
{{ $t('REPORT.GROUP_BY_FILTER_DROPDOWN_LABEL') }}
Expand All @@ -43,7 +44,7 @@
</div>
<div
v-if="agentsFilter"
class="small-12 medium-3 pull-right margin-left-small"
class="small-12 medium-3 pull-right margin-left-1 margin-right-1 multiselect-wrap--small"
>
<multiselect
v-model="selectedAgents"
Expand All @@ -65,7 +66,7 @@
v-if="showBusinessHoursSwitch"
class="small-12 medium-3 business-hours"
>
<span class="business-hours-text margin-right-small">
<span class="business-hours-text margin-right-1">
{{ $t('REPORT.BUSINESS_HOURS') }}
</span>
<span>
Expand All @@ -76,13 +77,14 @@
</template>
<script>
import WootDateRangePicker from 'dashboard/components/ui/DateRangePicker.vue';
const CUSTOM_DATE_RANGE_ID = 5;
import subDays from 'date-fns/subDays';
import startOfDay from 'date-fns/startOfDay';
import getUnixTime from 'date-fns/getUnixTime';
import { GROUP_BY_FILTER } from '../constants';
import endOfDay from 'date-fns/endOfDay';
const CUSTOM_DATE_RANGE_ID = 5;
export default {
components: {
WootDateRangePicker,
Expand Down Expand Up @@ -207,9 +209,3 @@ export default {
},
};
</script>

<style lang="scss" scoped>
.date-picker {
margin-left: var(--space-smaller);
}
</style>
@@ -1,6 +1,9 @@
<template>
<div class="flex-container flex-dir-column medium-flex-dir-row">
<div v-if="type === 'agent'" class="small-12 medium-3 pull-right">
<div
v-if="type === 'agent'"
class="small-12 medium-3 pull-right multiselect-wrap--small"
>
<p>
{{ $t('AGENT_REPORTS.FILTER_DROPDOWN_LABEL') }}
</p>
Expand All @@ -21,7 +24,6 @@
:status="props.option.availability_status"
:username="props.option.name"
size="22px"
class="margin-right-small"
/>
<span class="reports-option__desc">
<span class="reports-option__title">{{ props.option.name }}</span>
Expand All @@ -35,14 +37,16 @@
:status="props.option.availability_status"
:username="props.option.name"
size="22px"
class="margin-right-small"
/>
<p>{{ props.option.name }}</p>
<p class="reports-option__title">{{ props.option.name }}</p>
</div>
</template>
</multiselect>
</div>
<div v-else-if="type === 'label'" class="small-12 medium-3 pull-right">
<div
v-else-if="type === 'label'"
class="small-12 medium-3 pull-right multiselect-wrap--small"
>
<p>
{{ $t('LABEL_REPORTS.FILTER_DROPDOWN_LABEL') }}
</p>
Expand All @@ -60,7 +64,7 @@
<div class="reports-option__wrap">
<div
:style="{ backgroundColor: props.option.color }"
class="reports-option__rounded--item margin-right-small"
class="reports-option__rounded--item"
/>
<span class="reports-option__desc">
<span class="reports-option__title">
Expand Down Expand Up @@ -88,7 +92,7 @@
</template>
</multiselect>
</div>
<div v-else class="small-12 medium-3 pull-right">
<div v-else class="small-12 medium-3 pull-right multiselect-wrap--small">
<p>
<template v-if="type === 'inbox'">
{{ $t('INBOX_REPORTS.FILTER_DROPDOWN_LABEL') }}
Expand All @@ -115,7 +119,9 @@
@input="changeFilterSelection"
/>
</div>
<div class="small-12 medium-3 pull-right margin-left-small">
<div
class="small-12 medium-3 pull-right margin-right-1 margin-left-1 multiselect-wrap--small"
>
<p>
{{ $t('REPORT.DURATION_FILTER_LABEL') }}
</p>
Expand All @@ -133,17 +139,21 @@
@select="changeDateSelection"
/>
</div>
<woot-date-range-picker
v-if="isDateRangeSelected"
show-range
:value="customDateRange"
:confirm-text="$t('REPORT.CUSTOM_DATE_RANGE.CONFIRM')"
:placeholder="$t('REPORT.CUSTOM_DATE_RANGE.PLACEHOLDER')"
@change="onChange"
/>
<div v-if="isDateRangeSelected" class="">
<p>
{{ $t('REPORT.CUSTOM_DATE_RANGE.PLACEHOLDER') }}
</p>
<woot-date-range-picker
show-range
:value="customDateRange"
:confirm-text="$t('REPORT.CUSTOM_DATE_RANGE.CONFIRM')"
:placeholder="$t('REPORT.CUSTOM_DATE_RANGE.PLACEHOLDER')"
@change="onChange"
/>
</div>
<div
v-if="notLast7Days"
class="small-12 medium-3 pull-right margin-left-small"
class="small-12 medium-3 pull-right margin-right-1 margin-left-1 multiselect-wrap--small"
>
<p>
{{ $t('REPORT.GROUP_BY_FILTER_DROPDOWN_LABEL') }}
Expand All @@ -160,7 +170,7 @@
/>
</div>
<div class="small-12 medium-3 business-hours">
<span class="business-hours-text margin-right-small">
<span class="business-hours-text">
{{ $t('REPORT.BUSINESS_HOURS') }}
</span>
<span>
Expand Down

0 comments on commit 60f953c

Please sign in to comment.