Skip to content

Commit

Permalink
PATCH: fix some styles and translations
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasRichel committed May 11, 2022
1 parent dea2776 commit 6fd9bdc
Show file tree
Hide file tree
Showing 19 changed files with 334 additions and 112 deletions.
39 changes: 30 additions & 9 deletions src/components/bcf-filters/BcfFilters.scss
Original file line number Diff line number Diff line change
@@ -1,33 +1,54 @@
.bcf-filters {
.btn-color-granite-light:enabled {
color: var(--color-primary);
}
&__btn-toggle {
&:enabled {
color: var(--color-primary);
}

.btn-color-granite-light:disabled {
background-color: var(--color-white);
color: var(--color-silver-dark);
&:disabled {
background-color: var(--color-white);
color: var(--color-silver-dark);
}
}


&__container {
position: absolute;
z-index: 1;
top: calc(32px + 12px);
left: 0;
width: 100%;
padding: var(--spacing-unit);
box-shadow: var(--box-shadow);
background-color: var(--color-white);

display: flex;
flex-direction: column;
gap: calc(var(--spacing-unit) * 2);

&__header {
display: flex;
justify-content: space-between;
align-items: center;

&__title {
font-size: 12px;
font-weight: 700;
font-size: 1.1rem;
font-weight: bold;
}
}

&__date {
p {
display: flex;
gap: calc(var(--spacing-unit) / 2);

.example {
margin-top: calc(var(--spacing-unit) / 2);
font-size: 11px;
}
}

&__actions {
display: flex;
justify-content: center;
}
}
}
93 changes: 52 additions & 41 deletions src/components/bcf-filters/BcfFilters.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
<template>
<div class="bcf-filters" v-click-away="closeFilters">
<BIMDataButton
class="btn-color-granite-light"
class="bcf-filters__btn-toggle"
:class="{ 'btn-active': showFilters }"
:disabled="!bcfTopics.length"
:disabled="bcfTopics.length === 0"
width="120px"
color="default"
fill
square
icon
Expand All @@ -18,13 +17,14 @@
color="default"
margin="0 6px 0 0"
/>
{{ $t("BcfComponents.BcfFilters.filtersButton") }}
<span>
{{ $t("BcfComponents.BcfFilters.filtersButton") }}
</span>
</BIMDataButton>

<transition name="slide-fade-up">
<div class="bcf-filters__container p-18" v-show="showFilters">
<div
class="bcf-filters__container__header flex items-center justify-between"
>
<div class="bcf-filters__container" v-show="showFilters">
<div class="bcf-filters__container__header">
<div class="bcf-filters__container__header__title">
{{ $t("BcfComponents.BcfFilters.filtersTitle") }}
</div>
Expand All @@ -34,12 +34,12 @@
size="xxs"
fill
color="primary"
@click="showFilters = false"
@click="closeFilters"
/>
</BIMDataButton>
</div>

<BIMDataSelect
class="m-t-24"
width="100%"
:multi="true"
:label="$t('BcfComponents.BcfFilters.priorityLabel')"
Expand All @@ -48,8 +48,8 @@
optionLabelKey="label"
v-model="priorities"
/>

<BIMDataSelect
class="m-t-24"
width="100%"
:multi="true"
:label="$t('BcfComponents.BcfFilters.statusLabel')"
Expand All @@ -58,16 +58,17 @@
optionLabelKey="label"
v-model="status"
/>
<div class="bcf-filters__container__date flex justify-between m-t-24">
<div class="m-r-6">

<div class="bcf-filters__container__date">
<div>
<BIMDataInput
margin="0"
v-model="startDateInput"
:placeholder="$t('BcfComponents.BcfFilters.startDatePlaceholder')"
:error="hasStartDateError"
errorMessage="Error"
/>
<p class="m-y-6">
<p class="example">
{{ $t("BcfComponents.BcfFilters.startDateExample") }}
</p>
</div>
Expand All @@ -79,13 +80,13 @@
:error="hasEndDateError"
errorMessage="Error"
/>
<p class="m-y-6">
<p class="example">
{{ $t("BcfComponents.BcfFilters.endDateExample") }}
</p>
</div>
</div>

<BIMDataSelect
class="m-t-24"
width="100%"
:multi="true"
:label="$t('BcfComponents.BcfFilters.assignedToLabel')"
Expand All @@ -94,8 +95,8 @@
optionLabelKey="label"
v-model="users"
/>

<BIMDataSelect
class="m-t-24"
width="100%"
:multi="true"
:label="$t('BcfComponents.BcfFilters.creatorsLabel')"
Expand All @@ -104,23 +105,25 @@
optionLabelKey="label"
v-model="creators"
/>

<BIMDataSelect
class="m-t-24"
width="100%"
:multi="true"
:label="$t('BcfComponents.BcfFilters.tagsLabel')"
:options="tagOptions"
v-model="tags"
/>
<div class="flex justify-center m-t-24">

<div class="bcf-filters__container__actions">
<BIMDataButton
class="m-r-12"
color="primary"
ghost
radius
@click="resetFilters"
>{{ $t("BcfComponents.BcfFilters.resetButton") }}</BIMDataButton
>
{{ $t("BcfComponents.BcfFilters.resetButton") }}
</BIMDataButton>
<BIMDataButton color="primary" fill radius @click="submitFilters">
<BIMDataIcon
name="search"
Expand All @@ -129,7 +132,9 @@
color="default"
margin="0 6px 0 0"
/>
<span>{{ $t("BcfComponents.BcfFilters.searchButton") }}</span>
<span>
{{ $t("BcfComponents.BcfFilters.searchButton") }}
</span>
</BIMDataButton>
</div>
</div>
Expand Down Expand Up @@ -195,7 +200,7 @@ export default {
});
});
// date
// start/end dates
const startDateInput = ref("");
const endDateInput = ref("");
const hasStartDateError = ref(false);
Expand Down Expand Up @@ -234,7 +239,7 @@ export default {
});
});
// creator's list
// creators list
const creators = ref([]);
const creatorOptions = computed(() => {
return Array.from(
Expand All @@ -259,15 +264,29 @@ export default {
.sort((a, b) => a.localeCompare(b, undefined, { sensitivity: "base" }));
});
// Validation date + emit formulaire
const submitFilters = () => {
const startDateConform = isStartDateConform(startDateInput);
const endDateConform = isEndDateConform(startDateInput, endDateInput);
if (
startDateInput.value &&
!isStartDateConform(startDateInput) ||
(!startDateInput.value && endDateInput.value)
) {
hasStartDateError.value = true;
return;
}
if (
startDateInput.value &&
endDateInput.value &&
!isEndDateConform(startDateInput, endDateInput)
) {
hasEndDateError.value = true;
return;
}
if (
priorities.value.length ||
status.value.length ||
(startDateConform && endDateConform) ||
startDateInput.value ||
(startDateInput.value && endDateInput.value) ||
users.value.length ||
creators.value.length ||
tags.value.length
Expand All @@ -282,14 +301,6 @@ export default {
tags: tags.value,
});
showFilters.value = false;
} else if (
startDateInput.value &&
endDateInput.value &&
!startDateConform &&
!endDateConform
) {
hasStartDateError.value = true;
hasEndDateError.value = true;
}
};
Expand Down Expand Up @@ -319,23 +330,23 @@ export default {
// References
creators,
creatorOptions,
endDateInput,
hasEndDateError,
hasStartDateError,
priorities,
priorityOptions,
showFilters,
startDateInput,
status,
statusOptions,
tags,
tagOptions,
users,
userOptions,
showFilters,
startDateInput,
endDateInput,
hasStartDateError,
hasEndDateError,
// Methods
closeFilters,
resetFilters,
submitFilters,
closeFilters,
toggleFilters
};
}
Expand Down
3 changes: 2 additions & 1 deletion src/components/bcf-statistics/BcfStatistics.scss
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@
}
}

.bimdata-paginated-list:deep() {
::v-deep .bimdata-paginated-list,
:deep(.bimdata-paginated-list) {
ul:first-child {
height: 144px;
}
Expand Down
40 changes: 22 additions & 18 deletions src/components/bcf-topic-create/BcfTopicCreate.scss
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,15 @@
}

.btn-upload {
&:not(:disabled) label {
width: 100%;
height: 100%;
label {
display: flex;
justify-content: center;
align-items: center;
}

&:not(:disabled) label {
width: 100%;
height: 100%;
cursor: pointer;
}
}
Expand All @@ -109,23 +112,24 @@
}

&__body {
&:deep() {
.bimdata-input {
input {
font-size: 13px;
color: var(--color-granite);
}
}
.bimdata-select {
margin: 30px 0;
.bimdata-select {
margin: 30px 0;
font-size: 13px;
}
::v-deep .bimdata-input,
:deep(.bimdata-input) {
input {
font-size: 13px;
color: var(--color-granite);
}
.bimdata-textarea {
textarea {
font-family: var(--primary-font);
font-size: 13px;
color: var(--color-granite);
}
}
::v-deep .bimdata-textarea,
:deep(.bimdata-textarea) {
textarea {
font-family: var(--primary-font);
font-size: 13px;
color: var(--color-granite);
resize: vertical;
}
}
}
Expand Down
1 change: 0 additions & 1 deletion src/components/bcf-topic-create/BcfTopicCreate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@
:label="$t('BcfComponents.BcfTopicCreate.descriptionLabel')"
v-model="topicDescription"
fitContent
resizable
/>
<BIMDataSelect
width="100%"
Expand Down
Loading

0 comments on commit 6fd9bdc

Please sign in to comment.