From 29b43f799059a85af7804efdf170c103d2e335bc Mon Sep 17 00:00:00 2001 From: Johanna Szepanski <johanna.szepanski@softhouse.se> Date: Mon, 15 Apr 2024 13:41:39 +0200 Subject: [PATCH] updated git ref story --- .../common/Git/GitRefAutocomplete.stories.js | 38 ++++++++++++++----- 1 file changed, 28 insertions(+), 10 deletions(-) diff --git a/src/stories/common/Git/GitRefAutocomplete.stories.js b/src/stories/common/Git/GitRefAutocomplete.stories.js index 91a1a195..f6d81785 100644 --- a/src/stories/common/Git/GitRefAutocomplete.stories.js +++ b/src/stories/common/Git/GitRefAutocomplete.stories.js @@ -7,25 +7,43 @@ export default { const exampleOptions = [ { - reference: "Version-1", - shortReference: "Version-1", - description: "", - commitDate: "2024-01-12T12:24:13.000+00:00" + reference: "V.1.0.0", + short_reference: "d03bbc5s", + description: "This is a TAG description", + commit_date: "2024-01-11T12:24:13.000+00:00", + type: "TAG" }, { reference: "d03bbc5aaffb888f0fa567b05bb620d38f0f39ef", - shortReference: "d03bbc5a", + short_reference: "d03bbc5a", description: "Generated by CE template", - commitDate: "2024-01-12T12:24:13.000+00:00" + commit_date: "2024-01-12T12:24:13.000+00:00", + type: "COMMIT" + }, + { + reference: "d03bbc5aaffb888f0fa567b05bb620d38f0f3hjehw", + short_reference: "d03bbhsa", + description: + "This is a very long commit description, This is a very long commit description, This is a very long commit description, This is a very long commit description, This is a very long commit description", + commit_date: "2024-01-13T12:24:13.000+00:00", + type: "COMMIT" + }, + { + reference: "V.2.0.0", + short_reference: "d0ryfbc5s", + description: + "This is a very long tag description, This is a very long tag description, This is a very long tag description, This is a very long tag description, This is a very long tag description", + commit_date: "2024-01-21T12:24:13.000+00:00", + type: "TAG" } ]; const Template = ({ loading, options, disabled, ...props }) => { - const onGitQueryValueSelect = (value) => { + const handleSelect = (value) => { console.log({ onGitQueryValueSelect: value }); }; - const onGitQueryStringChange = (value) => { + const handleOnChange = (value) => { console.log({ onGitQueryStringChange: value }); }; @@ -36,8 +54,8 @@ const Template = ({ loading, options, disabled, ...props }) => { loading={loading} options={options} disabled={disabled} - onGitQueryValueSelect={onGitQueryValueSelect} - onGitQueryStringChange={onGitQueryStringChange} + onSelect={(_, value) => handleSelect(value)} + onInputChange={(_, value) => handleOnChange(value)} {...props} /> ); -- GitLab