This is an automated email from the ASF dual-hosted git repository. ritesh pushed a commit to branch gh-pages in repository https://gitbox.apache.org/repos/asf/ozone-site.git
commit 854501e0e776e6ffebddb6770b11464178af6e65 Author: Ritesh H Shukla <[email protected]> AuthorDate: Wed Mar 26 12:54:58 2025 -0700 HDDS-12613. Add GitHub Discussions question form to the website. (#2) * HDDS-12613. Add GitHub Discussions question form to the website. This adds a form allowing users to submit questions to GitHub Discussions directly from the website. Key features include: - New "Ask a Question" page with form to submit questions - Form redirects to GitHub Discussions with pre-filled question - Added under community navigation section - Improved spacing and styling for better user experience Co-authored-by: Ritesh H Shukla <[email protected]> --- docusaurus.config.js | 4 + src/components/AskQuestionForm/index.js | 86 ++++++++++++++++++ src/components/AskQuestionForm/styles.module.css | 108 +++++++++++++++++++++++ src/pages/community/ask-a-question.md | 20 +++++ src/pages/community/report-an-issue.md | 34 ++++++- 5 files changed, 249 insertions(+), 3 deletions(-) diff --git a/docusaurus.config.js b/docusaurus.config.js index 6054289d..5c9f4eb4 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -157,6 +157,10 @@ const config = { to: 'community/report-an-issue', label: 'Report An Issue', }, + { + to: 'community/ask-a-question', + label: 'Ask a Question', + }, { to: 'community/how-to-contribute', label: 'How to Contribute', diff --git a/src/components/AskQuestionForm/index.js b/src/components/AskQuestionForm/index.js new file mode 100644 index 00000000..b75757fe --- /dev/null +++ b/src/components/AskQuestionForm/index.js @@ -0,0 +1,86 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import React, { useState } from 'react'; +import styles from './styles.module.css'; + +export default function AskQuestionForm() { + const [question, setQuestion] = useState(''); + const [title, setTitle] = useState(''); + + const handleSubmit = (e) => { + e.preventDefault(); + + // Create the GitHub Discussions URL with query parameters + const baseUrl = 'https://github.com/apache/ozone/discussions/new'; + const category = 'faq '; + const titleEncoded = encodeURIComponent(title); + const bodyEncoded = encodeURIComponent(question); + + const redirectUrl = `${baseUrl}?category=${category}&title=${titleEncoded}&body=${bodyEncoded}`; + + // Redirect to GitHub Discussions with the pre-filled question + window.location.href = redirectUrl; + }; + + return ( + <div className={styles.formContainer}> + <h2 className={styles.formTitle}>Ask a Question</h2> + <p className={styles.formDescription}>Have a question about Apache Ozone? Fill out this form and we'll redirect you to GitHub Discussions with your question pre-filled.</p> + + <form onSubmit={handleSubmit} className={styles.form}> + <div className={styles.formGroup}> + <label htmlFor="title" className={styles.label}>Question Title:</label> + <input + type="text" + id="title" + value={title} + onChange={(e) => setTitle(e.target.value)} + placeholder="Enter a title for your question" + required + className={styles.input} + /> + </div> + + <div className={styles.formGroup}> + <label htmlFor="question" className={styles.label}>Your Question:</label> + <textarea + id="question" + value={question} + onChange={(e) => setQuestion(e.target.value)} + placeholder="Describe your question in detail..." + required + className={styles.textarea} + rows={5} + /> + </div> + + <div className={styles.submitGroup}> + <button type="submit" className={styles.button}> + Submit to GitHub Discussions + </button> + <p className={styles.submitNote}> + Your question will be redirected to the official Apache Ozone GitHub Discussions board. + A GitHub account is required to participate. + </p> + </div> + </form> + </div> + ); +} \ No newline at end of file diff --git a/src/components/AskQuestionForm/styles.module.css b/src/components/AskQuestionForm/styles.module.css new file mode 100644 index 00000000..1fe64d8b --- /dev/null +++ b/src/components/AskQuestionForm/styles.module.css @@ -0,0 +1,108 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +.formContainer { + max-width: 700px; + margin: 0 auto 40px; + padding: 30px; + background-color: var(--ifm-background-surface-color); + border-radius: 8px; + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); +} + +.formTitle { + margin-top: 0; + margin-bottom: 12px; +} + +.formDescription { + margin-bottom: 30px; + color: var(--ifm-color-emphasis-700); +} + +.form { + display: flex; + flex-direction: column; + gap: 25px; +} + +.formGroup { + display: flex; + flex-direction: column; + gap: 8px; +} + +.label { + font-weight: 600; +} + +.input, +.textarea { + padding: 10px; + border: 1px solid var(--ifm-color-emphasis-300); + border-radius: 4px; + font-size: 16px; + background-color: var(--ifm-background-color); + color: var(--ifm-font-color-base); +} + +.textarea { + resize: vertical; + min-height: 120px; +} + +.button { + padding: 12px 20px; + background-color: var(--ifm-color-primary); + color: white; + border: none; + border-radius: 4px; + font-size: 16px; + font-weight: 600; + cursor: pointer; + transition: background-color 0.2s ease; + align-self: flex-start; +} + +.button:hover { + background-color: var(--ifm-color-primary-darker); +} + +.submitGroup { + display: flex; + flex-direction: column; + gap: 8px; +} + +.submitNote { + font-size: 14px; + color: var(--ifm-color-emphasis-700); + margin: 0; + max-width: 500px; +} + +@media (max-width: 768px) { + .formContainer { + padding: 15px; + } + + .button { + width: 100%; + } +} \ No newline at end of file diff --git a/src/pages/community/ask-a-question.md b/src/pages/community/ask-a-question.md new file mode 100644 index 00000000..28eb1b2f --- /dev/null +++ b/src/pages/community/ask-a-question.md @@ -0,0 +1,20 @@ +# Ask a Question About Apache Ozone + +<!-- markdownlint-disable --> +import AskQuestionForm from '@site/src/components/AskQuestionForm'; + +Have a question about Apache Ozone? Use the form below to submit your question to our GitHub Discussions. The form will redirect you to GitHub with your question pre-filled. + +<AskQuestionForm /> +<!-- markdownlint-enable --> + +## About GitHub Discussions + +[GitHub Discussions](https://github.com/apache/ozone/discussions) is where our community comes together to ask and answer questions, share ideas, and discuss Apache Ozone. It's a great place to: + +- Get help with using Apache Ozone +- Share your experiences with the community +- Discuss ideas for improving Ozone +- Connect with other Ozone users and contributors + +After submitting your question through this form, you'll be redirected to GitHub where you can track responses and engage with the community. You'll need a GitHub account to participate in discussions. diff --git a/src/pages/community/report-an-issue.md b/src/pages/community/report-an-issue.md index 8643212e..3db8b64f 100644 --- a/src/pages/community/report-an-issue.md +++ b/src/pages/community/report-an-issue.md @@ -1,5 +1,33 @@ -# Report an Issue +# Report an Issue or Ask a Question -**TODO [HDDS-9870](https://issues.apache.org/jira/browse/HDDS-9870) Fill in this page.** +<!-- markdownlint-disable --> -This can link to other relevant sections as necessary, like Jira account sign up in [Communication Channels](communication-channels). It should include best practices for filing detailed Jira descriptions, titles, and adding labels or other fields. +import AskQuestionForm from '@site/src/components/AskQuestionForm'; + +## Have a Question? + +If you have a question about Apache Ozone, you can use the form below to submit it to our GitHub Discussions. This will redirect you to GitHub where you can continue the conversation with the community. + +{/*We're using a special Docusaurus comment style to allow the React component*/} +<AskQuestionForm /> + +<!-- markdownlint-enable --> + +## Report a Bug + +If you've found a bug in Apache Ozone, please report it in our issue tracker. Before filing a new issue, please search for existing issues to avoid duplicates. + +1. Create a [Jira account](https://issues.apache.org/jira/secure/Signup!default.jspa) if you don't have one +2. Go to the [Ozone Jira project](https://issues.apache.org/jira/projects/HDDS/issues) +3. Click "Create" to report a new issue + +### Best Practices for Reporting Issues + +When creating a new issue, please include: + +- A clear, descriptive title +- Detailed steps to reproduce the problem +- Expected behavior vs. actual behavior +- Version of Ozone you're using +- Environment details (OS, Java version, etc.) +- Any relevant logs or screenshots --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
