From 67476682494c7ea7f14164133693561a7de03ac6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C5=82gorzata=20Bie=C5=84?= Date: Wed, 6 Nov 2024 16:42:38 +0100 Subject: [PATCH] refactor: fix bundle for ticket-fields --- assets/new-request-form-bundle.js | 17 ----------------- assets/service-catalog-bundle.js | 4 ++++ rollup.config.mjs | 1 - .../service-catalog/ServiceCatalogItemPage.tsx | 4 ++++ templates/document_head.hbs | 1 - 5 files changed, 8 insertions(+), 19 deletions(-) diff --git a/assets/new-request-form-bundle.js b/assets/new-request-form-bundle.js index 3631c1f8a..aa2b15e51 100644 --- a/assets/new-request-form-bundle.js +++ b/assets/new-request-form-bundle.js @@ -761,23 +761,6 @@ function AnswerBotModal({ authToken, interactionAccessToken, articles, requestId }, children: t("new-request-form.answer-bot-modal.solve-request", "Yes, close my request") }) })] }), jsxRuntimeExports.jsx(Close$1, { "aria-label": t("new-request-form.close-label", "Close") })] })); } -function DropDown({ field, onChange }) { - const { label, options, error, value, name, required, description } = field; - const selectionValue = value == null ? "" : value.toString(); - const wrapperRef = reactExports.useRef(null); - reactExports.useEffect(() => { - if (wrapperRef.current && required) { - const combobox = wrapperRef.current.querySelector("[role=combobox]"); - combobox?.setAttribute("aria-required", "true"); - } - }, [wrapperRef, required]); - return (jsxRuntimeExports.jsxs(Field, { children: [jsxRuntimeExports.jsxs(Label, { children: [label, required && jsxRuntimeExports.jsx(Span, { "aria-hidden": "true", children: "*" })] }), description && (jsxRuntimeExports.jsx(Hint$1, { dangerouslySetInnerHTML: { __html: description } })), jsxRuntimeExports.jsxs(Combobox, { ref: wrapperRef, inputProps: { name, required }, isEditable: false, validation: error ? "error" : undefined, inputValue: selectionValue, selectionValue: selectionValue, renderValue: ({ selection }) => selection?.label || jsxRuntimeExports.jsx(EmptyValueOption, {}), onChange: ({ selectionValue }) => { - if (selectionValue !== undefined) { - onChange(selectionValue); - } - }, children: [!required && (jsxRuntimeExports.jsx(Option, { value: "", label: "-", children: jsxRuntimeExports.jsx(EmptyValueOption, {}) })), options.map((option) => (jsxRuntimeExports.jsx(Option, { value: option.value.toString(), label: option.name }, option.value)))] }), error && jsxRuntimeExports.jsx(Message$1, { validation: "error", children: error })] })); -} - const StyledParagraph = styled(Paragraph) ` margin: ${(props) => props.theme.space.md} 0; `; diff --git a/assets/service-catalog-bundle.js b/assets/service-catalog-bundle.js index 835d5815f..fd3c15f4b 100644 --- a/assets/service-catalog-bundle.js +++ b/assets/service-catalog-bundle.js @@ -339,6 +339,10 @@ const ButtonWrapper = styled.div ` display: flex; flex-direction: column; align-items: center; + bottom: 0; + left: 0; + right: 0; + width: 100%; @media (max-width: ${(props) => props.theme.breakpoints.md}) { position: sticky; diff --git a/rollup.config.mjs b/rollup.config.mjs index 89a4bf91a..6d46cc5d0 100644 --- a/rollup.config.mjs +++ b/rollup.config.mjs @@ -36,7 +36,6 @@ export default defineConfig([ "new-request-form": "src/modules/new-request-form/index.tsx", "flash-notifications": "src/modules/flash-notifications/index.ts", "service-catalog": "src/modules/service-catalog/index.tsx", - "ticket-fields": "src/modules/ticket-fields/index.tsx", }, output: { dir: "assets", diff --git a/src/modules/service-catalog/ServiceCatalogItemPage.tsx b/src/modules/service-catalog/ServiceCatalogItemPage.tsx index 93dcbfea0..2bce885e4 100644 --- a/src/modules/service-catalog/ServiceCatalogItemPage.tsx +++ b/src/modules/service-catalog/ServiceCatalogItemPage.tsx @@ -101,6 +101,10 @@ const ButtonWrapper = styled.div` display: flex; flex-direction: column; align-items: center; + bottom: 0; + left: 0; + right: 0; + width: 100%; @media (max-width: ${(props) => props.theme.breakpoints.md}) { position: sticky; diff --git a/templates/document_head.hbs b/templates/document_head.hbs index a51aed67b..92f035646 100644 --- a/templates/document_head.hbs +++ b/templates/document_head.hbs @@ -14,7 +14,6 @@ "new-request-form": "{{asset 'new-request-form-bundle.js'}}", "flash-notifications": "{{asset 'flash-notifications-bundle.js'}}", "service-catalog": "{{asset 'service-catalog-bundle.js'}}", - "ticket-fields": "{{asset 'ticket-fields-bundle.js'}}", "new-request-form-translations": "{{asset 'new-request-form-translations-bundle.js'}}", "shared": "{{asset 'shared-bundle.js'}}", "ticket-fields": "{{asset 'ticket-fields-bundle.js'}}",