Skip to content

Commit

Permalink
test deactivate datepicker #3036
Browse files Browse the repository at this point in the history
  • Loading branch information
emilschn committed Sep 13, 2024
1 parent a7ab8c4 commit 5b63164
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 57 deletions.
28 changes: 15 additions & 13 deletions assets/scripts/vue/components/common/external/HistoDatePicker.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div class="histo-date-picker">
<Datepicker
v-model="dates"
<VueDatePicker
v-model="date"
@update:modelValue="handleDate"
locale="fr"
range
Expand All @@ -20,39 +20,41 @@

<script lang="ts">
import { defineComponent } from 'vue'
import Datepicker from '@vuepic/vue-datepicker'
import VueDatepicker from '@vuepic/vue-datepicker'
export default defineComponent({
name: 'HistoDatePicker',
components: { Datepicker },
expose: ['updateDate'],
components: { VueDatepicker },
// expose: ['updateDate'],
props: {
id: { type: String, default: null },
modelValue: { type: Array },
placeholder: { type: String, default: null }
},
watch: {
/*watch: {
modelValue (newValue: any) {
this.dates = newValue
}
},
data () {
},*/
data: function () {
return {
dates: this.modelValue
//dates: this.modelValue
date: null
}
},
emits: ['update:modelValue'],
methods: {
updateDate: function (newDates: Array<Date>) {
/*updateDate: function (newDates: Array<Date>) {
this.dates = newDates
},
},*/
handleDate: function (modelData: any) {
if (modelData !== null && modelData[1] === null) {
modelData[1] = new Date()
}
if (this.dates !== undefined && this.dates !== null) {
/* if (this.dates !== undefined && this.dates !== null) {
this.dates = modelData
}
} */
console.log(modelData)
this.$emit('update:modelValue', modelData)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,14 +138,14 @@
/>
</div>
<div class="fr-col-12 fr-col-lg-6 fr-col-xl-3 grey-background">
<HistoDatePicker
<!--HistoDatePicker
id="filter-date-depot"
ref="filter-date-depot"
v-model="sharedState.input.filters.dateDepot"
:placeholder="'Date de dépot'"
title="Rechercher par date de dépot"
@update:modelValue="onChange(false)"
/>
/-->
</div>
<div class="fr-col-12 fr-col-lg-6 fr-col-xl-3 grey-background">
<HistoSelect
Expand Down Expand Up @@ -191,14 +191,14 @@
/>
</div>
<div class="fr-col-12 fr-col-lg-6 fr-col-xl-3 grey-background">
<HistoDatePicker
<!--HistoDatePicker
id="filter-date-dernier-suivi"
ref="filter-date-dernier-suivi"
v-model="sharedState.input.filters.dateDernierSuivi"
:placeholder="'Date de dernier suivi'"
title="Rechercher par date de dernier suivi"
@update:modelValue="onChange(false)"
/>
/-->
</div>
<div v-if="sharedState.user.canSeeStatusAffectation" class="fr-col-12 fr-col-lg-4 fr-col-xl-3 grey-background">
<HistoSelect
Expand Down Expand Up @@ -308,7 +308,7 @@ import AppAutoComplete from '../../common/AppAutoComplete.vue'
import AppNumber from '../../common/AppNumber.vue'
import AppSearch from '../../common/AppSearch.vue'
import HistoSelect from '../../common/HistoSelect.vue'
import HistoDatePicker from '../../common/external/HistoDatePicker.vue'
//import HistoDatePicker from '../../common/external/HistoDatePicker.vue'
import HistoMultiSelect from '../../common/HistoMultiSelect.vue'
import { store } from '../store'
import { buildBadge } from '../services/badgeFilterLabelBuilder'
Expand All @@ -321,16 +321,16 @@ export default defineComponent({
AppAutoComplete,
AppSearch,
HistoMultiSelect,
HistoDatePicker,
//HistoDatePicker,
HistoSelect
},
props: {
onChange: { type: Function }
},
emits: ['changeTerritory', 'clickReset'],
computed: {
filtersSanitized () {
const filters = Object.entries(this.sharedState.input.filters).filter(([key, value]) => {
filtersSanitized (): any {
const filters: any = Object.entries(this.sharedState.input.filters).filter(([key, value]) => {
if (key === 'isImported' || key === 'showMyAffectationOnly' || key === 'showWithoutAffectationOnly') {
return false
}
Expand Down
10 changes: 5 additions & 5 deletions assets/scripts/vue/components/stats/TheHistoStatsFilters.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@
/>
</div>
<div class="fr-col-12 fr-col-lg-6 fr-col-xl-4">
<HistoDatePicker
<!--HistoDatePicker
id="histofiltersdatepicker"
ref="histofiltersdatepicker"
v-model="sharedState.filters.dateRange"
@update:modelValue="onChange(false)"
/>
/-->
</div>
<div class="fr-col-12 fr-col-lg-6 fr-col-xl-5">
<div class="fr-mb-3v">
Expand Down Expand Up @@ -88,7 +88,7 @@ import { store } from './store'
import HistoSelect from '../common/HistoSelect.vue'
import HistoMultiSelect from '../common/HistoMultiSelect.vue'
import HistoCheckbox from '../common/HistoCheckbox.vue'
import HistoDatePicker from '../common/external/HistoDatePicker.vue'
//import HistoDatePicker from '../common/external/HistoDatePicker.vue'
export default defineComponent({
name: 'TheHistoStatsFilters',
Expand All @@ -98,8 +98,8 @@ export default defineComponent({
components: {
HistoSelect,
HistoMultiSelect,
HistoCheckbox,
HistoDatePicker
HistoCheckbox/*,
HistoDatePicker*/
},
data () {
const etiquettes = new Array<string>()
Expand Down
43 changes: 15 additions & 28 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
"@sentry/browser": "^7.99.0",
"@sentry/tracing": "^7.99.0",
"@symfony/webpack-encore": "^3.0.0",
"@vuepic/vue-datepicker": "^3.4.6",
"@vuepic/vue-datepicker": "^9.0.3",
"axios": "^1.7.4",
"datatables.net-dt": "^1.12.1",
"datatables.net-vue3": "^1.0.0",
"libphonenumber-js": "^1.10.44",
"vue": "^3.2.37",
"vue": "^3.4.0",
"vue-chartjs": "^4.1.1",
"vue-loader": "^17.0.0",
"vue-template-compiler": "^2.7.8"
Expand Down
2 changes: 1 addition & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Encore
.enableVersioning(Encore.isProduction())

.configureBabel((config) => {
config.plugins.push('@babel/plugin-proposal-class-properties');
// config.plugins.push('@babel/plugin-proposal-class-properties');
})

// enables @babel/preset-env polyfills
Expand Down

0 comments on commit 5b63164

Please sign in to comment.