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

FiltersSideBar v3 #3230

Merged
merged 1 commit into from
Jun 6, 2024
Merged

FiltersSideBar v3 #3230

merged 1 commit into from
Jun 6, 2024

Conversation

DavidFyon
Copy link
Contributor

@DavidFyon DavidFyon commented Oct 24, 2023

FiltersSideBar

<template>
	<VLayout>
		<PageContainer>
			<FiltersSideBar v-model="filters">
				<template #name="{ attrs }">
					<VTextField
						v-bind="attrs"
						color="primary"
						label="Nom"
						variant="outlined"
						hide-details
					/>
				</template>

				<template #folder="{ attrs }">
					<p class="text-secondary">
						Vous pouvez filtrer entre les dossiers de type
						<b>Arrêt de Travail (AT)</b> et
						<b>Maladie Professionnelle (MP)</b> ou <b>Autre</b>.
					</p>

					<VSelect
						v-bind="attrs"
						:items="folderTypes"
						color="primary"
						label="Type de dossier"
						multiple
						variant="outlined"
						return-object
						hide-details
					/>
				</template>

				<template #updated-at="{ attrs }">
					<DatePicker
						v-bind="attrs"
						label="Date de mise à jour"
						outlined
					/>
				</template>

				<template #period="{ attrs }">
					<PeriodField v-bind="attrs" outlined />
				</template>

				<template #profession="{ attrs }">
					<SearchListField
						v-bind="attrs"
						:items="professionList"
					/>
				</template>
			</FiltersSideBar>
		</PageContainer>
	</VLayout>
</template>

<script lang="ts">
import { defineComponent } from "vue";

import PageContainer from "@/elements/PageContainer/PageContainer.vue";
import FiltersSideBar from "@/patterns/FiltersSideBar/FiltersSideBar.vue";
import DatePicker from "@/patterns/DatePicker/DatePicker.vue";
import PeriodField from "@/patterns/PeriodField/PeriodField.vue";
import SearchListField from "@/patterns/SearchListField/SearchListField.vue";

import { ChipItem } from "@/elements/ChipList/types";

export default defineComponent({
	components: {
		PageContainer,
		FiltersSideBar,
		DatePicker,
		PeriodField,
		SearchListField,
	},
	data() {
		return {
			filters: [
				{
					name: "name",
					title: "Identité",
				},
				{
					name: "folder",
					title: "Type de dossier",
				},
				{
					name: 'updated-at',
					title: 'Mise à jour'
				},
				{
					name: "period",
					title: "Période",
					formatChip: ([min, max]: [number, number]): ChipItem[] => [
						{
							text: `Du ${min} au ${max}`,
							value: [min, max]
						}
					]
				},
				{
					name: "profession",
					title: "Profession",
				},
			],

			folderTypes: [
				{
					title: "AT",
					value: "at",
				},
				{
					title: "MP",
					value: "mp",
				},
				{
					title: "Autre",
					value: "other",
				},
			],

			professionList: [
				{
					label: "Chirurgien-dentiste",
					value: "chirurgien-dentiste",
				},
				{
					label: "Infirmier",
					value: "infirmier",
				},
				{
					label: "Orthophoniste",
					value: "orthophoniste",
				},
				{
					label: "Orthoptiste",
					value: "orthoptiste",
				},
				{
					label: "Pédicure-podologue",
					value: "pedicure-podologue",
				},
				{
					label: "Pharmacien",
					value: "pharmacien",
				},
			],
		};
	},
});
</script>

@DavidFyon DavidFyon self-assigned this Oct 24, 2023
@DavidFyon DavidFyon changed the title FiltersSideBar v3 WIP - FiltersSideBar v3 Oct 24, 2023
@DavidFyon DavidFyon marked this pull request as draft October 24, 2023 15:08
@DavidFyon
Copy link
Contributor Author

Besoin des composants PeriodField, SearchListField, ChipList

@deraw deraw linked an issue Oct 26, 2023 that may be closed by this pull request
@deraw deraw changed the title WIP - FiltersSideBar v3 FiltersSideBar v3 Oct 26, 2023
@deraw deraw removed the blocked label Dec 4, 2023
@4dr1en 4dr1en changed the base branch from v2-bridge to bridge/PeriodField April 23, 2024 15:31
@4dr1en 4dr1en changed the base branch from bridge/PeriodField to v2-bridge April 23, 2024 15:32
@4dr1en 4dr1en assigned 4dr1en and unassigned DavidFyon Apr 24, 2024
@4dr1en 4dr1en marked this pull request as ready for review April 24, 2024 12:23
Copy link
Contributor

@VachetVirginie VachetVirginie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Erreur => Error: [Vuetify] Could not find injected layout, il manque surement une balise v-layout dans ton component, il me semble que nous avons rencontre ce type de pb sur le Header et le Footer a verifier la solution utilisee

@DavidFyon
Copy link
Contributor Author

DavidFyon commented May 31, 2024

@VachetVirginie j'ai l'impression qu'il y a un soucis avec le DatePicker, à checker ensemble
@DavidFyon
a check ce qui ce passe sur les $attrs ici https://wetestbridge.netlify.app/date-picker tout ce passe bien

Capture d’écran 2024-05-31 à 15 27 50

TODO :

  • Check DatePicker
  • Fix warnings Tests :
    [Vue warn]: Attempting to mutate prop "modelValue". Props are readonly.

Il faut aussi check le pb de typage du v-model

  • Check v-model type

@VachetVirginie
Copy link
Contributor

C'est etrange le pb ne se pose pas sur la maj https://wetestbridge.netlify.app/date-picker

@VachetVirginie
Copy link
Contributor

ca vient des attrs le datePicker attend une date on lui passe une string

add components + tests

last changes

merge + fix code

✨bridge: migrate component

✅bridge: fix coverage + fix type in event

fix reset filters

fix tests

fix v-model type error

fix datePicker

fix datePicker tests

add class on date-picker

fix tests warn
@DavidFyon DavidFyon merged commit 42ae426 into v2-bridge Jun 6, 2024
@DavidFyon DavidFyon deleted the bridge/FiltersSideBar branch June 6, 2024 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FiltersSideBar
4 participants