Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix alignment issues with RTL languages support #898

Closed
wants to merge 10 commits into from
6 changes: 6 additions & 0 deletions app/frontend/src/assets/scss/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -592,3 +592,9 @@ a,
justify-content: center;
min-height: 300px;
}

.label .v-label {
right: 0 !important;
left: auto !important;
}

14 changes: 10 additions & 4 deletions app/frontend/src/components/admin/AdminFormsTable.vue
Original file line number Diff line number Diff line change
@@ -1,24 +1,29 @@
<template>
<div>
<div :class="{ 'dir-rtl': isRTL }">
<v-row no-gutters>
<v-col cols="12" sm="8">
<v-col cols="6">
<v-checkbox
class="pl-3"
:class="isRTL ? 'float-right' : 'float-left'"
v-model="activeOnly"
:label="$t('trans.adminFormsTable.showDeletedForms')"
@click="refeshForms"
/>
</v-col>
<v-col cols="12" sm="4">
<v-col cols="6">
<!-- search input -->
<div class="submissions-search">
<div
class="submissions-search"
:class="isRTL ? 'float-left' : 'float-right'"
>
<v-text-field
v-model="search"
append-icon="mdi-magnify"
:label="$t('trans.adminFormsTable.search')"
single-line
hide-details
class="pb-5"
:class="[{ 'dir-rtl': isRTL }, isRTL ? 'label' : null]"
/>
</div>
</v-col>
Expand Down Expand Up @@ -85,6 +90,7 @@ export default {
},
computed: {
...mapGetters('admin', ['formList']),
...mapGetters('form', ['isRTL']),
calcHeaders() {
return this.headers.filter(
(x) => x.value !== 'updatedAt' || this.activeOnly
Expand Down
12 changes: 11 additions & 1 deletion app/frontend/src/components/admin/AdminPage.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<v-tabs>
<v-tabs :class="{ 'dir-rtl': isRTL }">
<v-tab>{{ $t('trans.adminPage.forms') }}</v-tab>
<v-tab>{{ $t('trans.adminPage.users') }}</v-tab>
<v-tab>{{ $t('trans.adminPage.developer') }}</v-tab>
Expand All @@ -15,6 +15,7 @@
</template>

<script>
import { mapGetters } from 'vuex';
export default {
name: 'AdminPage',
components: {
Expand All @@ -30,5 +31,14 @@ export default {
adminDashboardUrl: this.$config.adminDashboardUrl,
};
},
computed: {
...mapGetters('form', ['isRTL']),
},
};
</script>
<style lang="css" scoped>
.dir-rtl {
direction: rtl !important;
text-align: right;
}
</style>
9 changes: 7 additions & 2 deletions app/frontend/src/components/admin/AdminUsersTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,20 @@
<div>
<v-row no-gutters>
<v-spacer />
<v-col cols="12" sm="4">
<v-col cols="12">
<!-- search input -->
<div class="submissions-search">
<div
class="submissions-search"
:class="isRTL ? 'float-left' : 'float-right'"
>
<v-text-field
v-model="search"
append-icon="mdi-magnify"
:label="$t('trans.adminUsersTable.search')"
single-line
hide-details
class="pb-5"
:class="[{ 'dir-rtl': isRTL }, isRTL ? 'label' : null]"
/>
</div>
</v-col>
Expand Down Expand Up @@ -58,6 +62,7 @@ export default {
},
computed: {
...mapGetters('admin', ['userList']),
...mapGetters('form', ['isRTL']),
headers() {
return [
{
Expand Down
19 changes: 17 additions & 2 deletions app/frontend/src/components/base/BaseDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
@keydown.esc="closeDialog"
>
<v-card>
<div class="dialog-body">
<div class="dialog-body" :class="{ 'dir-rtl': isRTL }">
<div v-if="showCloseButton">
<v-spacer />
<v-icon color="primary" class="float-right m-3" @click="closeDialog"
Expand Down Expand Up @@ -47,7 +47,12 @@
<span>{{ $t('trans.baseDialog.continue') }}</span>
</slot>
</v-btn>
<v-btn class="mb-5" outlined @click="closeDialog">
<v-btn
:class="{ 'dir-rtl': isRTL }"
class="mb-5"
outlined
@click="closeDialog"
>
<slot name="button-text-cancel">
<span>{{ $t('trans.baseDialog.cancel') }}</span>
</slot>
Expand All @@ -58,6 +63,7 @@
class="mb-5 mr-5"
color="primary"
depressed
:class="{ 'dir-rtl': isRTL }"
@click="continueDialog"
>
<slot name="button-text-continue">
Expand Down Expand Up @@ -104,6 +110,8 @@
</template>

<script>
import { mapGetters } from 'vuex';

export default {
name: 'BaseDialog',
methods: {
Expand All @@ -120,6 +128,9 @@ export default {
this.$emit('custom-dialog');
},
},
computed: {
...mapGetters('form', ['isRTL']),
},
props: {
value: {
default: false,
Expand Down Expand Up @@ -159,4 +170,8 @@ export default {
flex: 1 1 auto;
width: 90%;
}
.dir-rtl {
direction: rtl !important;
text-align: right !important;
}
</style>
13 changes: 12 additions & 1 deletion app/frontend/src/components/base/BaseFilter.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<v-card>
<v-card :class="{ 'dir-rtl': isRTL }">
<v-card-title class="text-h5 pb-0 titleWrapper">
<slot name="filter-title"></slot>
</v-card-title>
Expand All @@ -18,6 +18,7 @@
filled
dense
class="mt-3"
:class="[{ 'dir-rtl': isRTL }, isRTL ? 'label' : 'label']"
>
</v-text-field>
<v-tooltip bottom>
Expand Down Expand Up @@ -63,6 +64,7 @@
<v-btn
@click="cancelFilterData"
class="mt-3 ml-3 primary--text"
:class="isRTL ? 'mr-3' : 'ml-3'"
outlined
>{{ $t('trans.baseFilter.cancel') }}</v-btn
>
Expand All @@ -71,6 +73,7 @@
</template>

<script>
import { mapGetters } from 'vuex';
import i18n from '@/internationalization';
import { library } from '@fortawesome/fontawesome-svg-core';
import { faRepeat } from '@fortawesome/free-solid-svg-icons';
Expand Down Expand Up @@ -130,6 +133,9 @@ export default {
default: i18n.t('trans.baseFilter.filter'),
},
},
computed: {
...mapGetters('form', ['isRTL']),
},
data() {
return {
selectedData: this.preselectedData,
Expand Down Expand Up @@ -187,6 +193,11 @@ export default {
color: #000000 !important;
}

.dir-rtl {
direction: rtl !important;
text-align: right;
}

.hr {
height: 1px;
border: none;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class="text-center">
<div class="text-center" style="z-index: 100">
<v-menu offset-y>
<template v-slot:activator="{ on, attrs }">
<v-btn dark outlined v-bind="attrs" v-on="on" class="ml-3">
Expand Down
12 changes: 10 additions & 2 deletions app/frontend/src/components/base/BaseNotificationBar.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<v-alert
:class="'target-notification ' + notification.class"
:class="['target-notification ' + notification.class, { 'dir-rtl': isRTL }]"
:icon="notification.icon"
prominent
dismissible
Expand All @@ -13,7 +13,7 @@
</template>

<script>
import { mapActions } from 'vuex';
import { mapActions, mapGetters } from 'vuex';
export default {
name: 'BaseNotificationBar',
props: {
Expand All @@ -30,6 +30,9 @@ export default {
timeout: null,
};
},
computed: {
...mapGetters('form', ['isRTL']),
},
methods: {
...mapActions('notifications', ['deleteNotification']),
alertClosed() {
Expand All @@ -53,4 +56,9 @@ export default {
.target-notification >>> .v-alert__icon.v-icon:after {
display: none;
}

.dir-rtl {
direction: rtl !important;
text-align: right;
}
</style>
14 changes: 11 additions & 3 deletions app/frontend/src/components/base/BaseNotificationContainer.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class="notification-container">
<div class="notification-container" :class="{ 'dir-rtl': isRTL }">
<BaseNotificationBar
v-for="notification in notifications"
:key="notification.id"
Expand All @@ -9,10 +9,13 @@
</template>

<script>
import { mapState } from 'vuex';
import { mapState, mapGetters } from 'vuex';
export default {
name: 'BaseNotificationContainer',
computed: mapState('notifications', ['notifications']),
computed: {
...mapState('notifications', ['notifications']),
...mapGetters('form', ['isRTL']),
},
};
</script>

Expand All @@ -25,4 +28,9 @@ export default {
margin-top: 15px;
width: 50%;
}

.dir-rtl {
direction: rtl !important;
text-align: right;
}
</style>
8 changes: 7 additions & 1 deletion app/frontend/src/components/designer/FloatButton.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<template>
<div
:class="{ 'dir-rtl': true }"
:style="[
{
display: 'flex',
Expand Down Expand Up @@ -206,7 +207,7 @@ export default {
};
},
computed: {
...mapGetters('form', ['multiLanguage']),
...mapGetters('form', ['multiLanguage', 'isRTL']),
},
props: {
formId: String,
Expand Down Expand Up @@ -521,4 +522,9 @@ export default {
text-align: center;
word-break: break-word;
}

.dir-rtl {
direction: rtl !important;
text-align: right;
}
</style>
Loading