This repository has been archived by the owner on Oct 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
feat: Ajout d'une section "Temps passé" dans le formulaire d'édition d'un service #446
Open
jbuget
wants to merge
5
commits into
main
Choose a base branch
from
feat/temps-passe-par-service
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
8a6442f
feat(service-form): support service spending time
jbuget d250bce
test: add Vitest UI
jbuget 488d18a
test: configure project to allow component testing
jbuget c50fada
fix (ci): adding optional dependency rollup
jbuget cba9961
chore(ignore): exclude .history directory used by VSCode extension
jbuget File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
src/lib/components/specialized/services/fields-participation.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<script lang="ts"> | ||
import FieldSet from "$lib/components/display/fieldset.svelte"; | ||
import BasicInputField from "$lib/components/forms/fields/basic-input-field.svelte"; | ||
import type { Service } from "$lib/types"; | ||
|
||
export let service: Service; | ||
</script> | ||
|
||
<FieldSet title="Participation du bénéficiaire"> | ||
<BasicInputField | ||
type="number" | ||
id="spendingTimeTotalHours" | ||
description="Nombre total d'heures investies par le bénéficiaire, ex : 18" | ||
bind:value={service.spendingTimeTotalHours} | ||
/> | ||
|
||
<BasicInputField | ||
type="text" | ||
id="spendingTimePrecision" | ||
description="Précision sur la répartition des heures passées, ex : « 6h par semaine, pendant 3 semaines »" | ||
bind:value={service.spendingTimePrecision} | ||
/> | ||
</FieldSet> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -365,6 +365,18 @@ export const serviceSchema: v.Schema = { | |
default: false, | ||
rules: [v.isBool()], | ||
}, | ||
spendingTimeTotalHours: { | ||
label: "Temps passé", | ||
default: false, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion: Je mettrais plutôt |
||
rules: [v.isInteger()], | ||
}, | ||
spendingTimePrecision: { | ||
label: "Précision sur le temps passé", | ||
default: "", | ||
maxLength: 60, | ||
post: [v.trim], | ||
rules: [v.isString(), v.maxStrLength(60)], | ||
}, | ||
}; | ||
|
||
export const inclusionNumeriqueSchema: v.Schema = { | ||
|
@@ -442,6 +454,8 @@ export const draftSchema: v.Schema = { | |
recurrence: serviceSchema.recurrence, | ||
suspensionDate: serviceSchema.suspensionDate, | ||
useInclusionNumeriqueScheme: serviceSchema.useInclusionNumeriqueScheme, | ||
spendingTimeTotalHours: serviceSchema.spendingTimeTotalHours, | ||
spendingTimePrecision: serviceSchema.spendingTimePrecision, | ||
}; | ||
|
||
export const contribSchema: v.Schema = { | ||
|
@@ -500,4 +514,6 @@ export const modelSchema: v.Schema = { | |
onlineForm: serviceSchema.onlineForm, | ||
recurrence: serviceSchema.recurrence, | ||
suspensionDate: serviceSchema.suspensionDate, | ||
spendingTimeTotalHours: serviceSchema.spendingTimeTotalHours, | ||
spendingTimePrecision: serviceSchema.spendingTimePrecision, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question: en plus des conversions, ne devrait-on pas également toujours appeler le
onBlur()
et leonChange()
duFieldWrapper
afin que la validation du schéma se fasse ?