From 55b2c9824b8cca36d9e9ef73c67203614b7b1606 Mon Sep 17 00:00:00 2001 From: Mehul Kiran Chaudhari <55375534+MehulKChaudhari@users.noreply.github.com> Date: Fri, 13 Dec 2024 03:02:35 +0530 Subject: [PATCH 1/4] Add: Submit issue on GitHub Button --- .../components/Footer/Footer.tsx | 2 +- .../components/Playground/Playground.tsx | 19 +++++++++++++++++++ .../Playground/__tests__/Playground.test.tsx | 16 ++++++++++++++++ 3 files changed, 36 insertions(+), 1 deletion(-) diff --git a/apps/playground-web/components/Footer/Footer.tsx b/apps/playground-web/components/Footer/Footer.tsx index 72f2d49..a4c383f 100644 --- a/apps/playground-web/components/Footer/Footer.tsx +++ b/apps/playground-web/components/Footer/Footer.tsx @@ -41,7 +41,7 @@ export default function Footer() { > + ); } diff --git a/apps/playground-web/components/Playground/__tests__/Playground.test.tsx b/apps/playground-web/components/Playground/__tests__/Playground.test.tsx index a500e69..82c8744 100644 --- a/apps/playground-web/components/Playground/__tests__/Playground.test.tsx +++ b/apps/playground-web/components/Playground/__tests__/Playground.test.tsx @@ -11,6 +11,8 @@ const setupTest = () => { const terminalContainerElement = screen.getByTestId('terminal-container'); const searchBoxContainerElement = screen.getByTestId('searchbox-container'); const searchBoxWrapperElement = screen.getByTestId('searchbox-wrapper'); + const submitIssueButtonElement = screen.getByTestId('submit-issue-button'); + const submitIssueLinkElement = screen.getByTestId('submit-issue-link'); return { playgroundElement, @@ -19,6 +21,8 @@ const setupTest = () => { terminalContainerElement, searchBoxContainerElement, searchBoxWrapperElement, + submitIssueButtonElement, + submitIssueLinkElement, ...utils, }; }; @@ -40,4 +44,16 @@ describe('Playground component', () => { expect(searchBoxContainerElement).toBeInTheDocument(); expect(searchBoxWrapperElement).toBeInTheDocument(); }); + + it('renders the "Submit an Issue" button', () => { + const { + submitIssueButtonElement, + submitIssueLinkElement, + } = setupTest(); + + expect(submitIssueButtonElement).toBeInTheDocument(); + expect(submitIssueLinkElement).toBeInTheDocument(); + expect(submitIssueLinkElement).toHaveAttribute('href', 'https://github.com/DiceDB/dice/issues/new/choose'); + expect(submitIssueLinkElement).toHaveAttribute('aria-label', 'Submit an issue or feedback'); + }); }); From fef4bb0217c7e286def72153a760e22368107abe Mon Sep 17 00:00:00 2001 From: Mehul Kiran Chaudhari <55375534+MehulKChaudhari@users.noreply.github.com> Date: Sat, 14 Dec 2024 19:02:51 +0530 Subject: [PATCH 2/4] fix: GitHub link --- apps/playground-web/components/Playground/Playground.tsx | 2 +- .../components/Playground/__tests__/Playground.test.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/playground-web/components/Playground/Playground.tsx b/apps/playground-web/components/Playground/Playground.tsx index c4714f7..e3e942e 100644 --- a/apps/playground-web/components/Playground/Playground.tsx +++ b/apps/playground-web/components/Playground/Playground.tsx @@ -59,7 +59,7 @@ function Header() {

PlayGround

{ expect(submitIssueButtonElement).toBeInTheDocument(); expect(submitIssueLinkElement).toBeInTheDocument(); - expect(submitIssueLinkElement).toHaveAttribute('href', 'https://github.com/DiceDB/dice/issues/new/choose'); + expect(submitIssueLinkElement).toHaveAttribute('href', 'https://github.com/DiceDB/playground-mono/issues/new'); expect(submitIssueLinkElement).toHaveAttribute('aria-label', 'Submit an issue or feedback'); }); }); From 06bb5bbfc8790a5fa655f3ad8961446aab30b383 Mon Sep 17 00:00:00 2001 From: pshubham Date: Tue, 17 Dec 2024 10:44:01 +0530 Subject: [PATCH 3/4] Remove footer and add issue/bug template --- .github/ISSUE_TEMPLATE/report_bug.md | 30 ++++ .../components/Footer/Footer.tsx | 134 ------------------ .../components/Playground/Playground.tsx | 12 +- 3 files changed, 40 insertions(+), 136 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/report_bug.md diff --git a/.github/ISSUE_TEMPLATE/report_bug.md b/.github/ISSUE_TEMPLATE/report_bug.md new file mode 100644 index 0000000..100abcb --- /dev/null +++ b/.github/ISSUE_TEMPLATE/report_bug.md @@ -0,0 +1,30 @@ +--- +name: Bug in DiceDB Playground +about: Report a bug in the DiceDB Playground +title: '' +labels: '' +assignees: '' +--- + +## Bug Category + +- [ ] UI +- [ ] Backend + +## Steps to Reproduce + +``` +{steps_to_reproduce} +``` + +## Expected Behavior + +``` + +``` + +## Actual Behavior + +``` + +``` diff --git a/apps/playground-web/components/Footer/Footer.tsx b/apps/playground-web/components/Footer/Footer.tsx index a4c383f..49b4991 100644 --- a/apps/playground-web/components/Footer/Footer.tsx +++ b/apps/playground-web/components/Footer/Footer.tsx @@ -13,140 +13,6 @@ export default function Footer() { className="bg-white border-t border-gray-100 py-12" data-testid="footer" > -
-
-
-

- DiceDB -

- - - - - - -
- -
-

Developers

- -
- -
-

Examples

- -
- -
-

Us and Socials

- - -
-
-
); } diff --git a/apps/playground-web/components/Playground/Playground.tsx b/apps/playground-web/components/Playground/Playground.tsx index e3e942e..2a9c96b 100644 --- a/apps/playground-web/components/Playground/Playground.tsx +++ b/apps/playground-web/components/Playground/Playground.tsx @@ -47,6 +47,13 @@ function Header() { className="navbar flex items-center justify-between py-5" >
+ +

PlayGround

From 717fbb495bd89300b6ccd9ac989b601bc3671abb Mon Sep 17 00:00:00 2001 From: pshubham Date: Tue, 17 Dec 2024 11:09:22 +0530 Subject: [PATCH 4/4] Update test cases and fix lint issues --- .../components/Footer/Footer.tsx | 13 +- .../Footer/__tests__/Footer.test.tsx | 133 ------------------ .../components/Playground/Playground.tsx | 60 ++++---- .../Playground/__tests__/Playground.test.tsx | 37 ++++- 4 files changed, 61 insertions(+), 182 deletions(-) delete mode 100644 apps/playground-web/components/Footer/__tests__/Footer.test.tsx diff --git a/apps/playground-web/components/Footer/Footer.tsx b/apps/playground-web/components/Footer/Footer.tsx index 49b4991..e025f57 100644 --- a/apps/playground-web/components/Footer/Footer.tsx +++ b/apps/playground-web/components/Footer/Footer.tsx @@ -1,18 +1,7 @@ 'use client'; import React from 'react'; -import { Twitter } from '@mui/icons-material'; -import GitHub from '@mui/icons-material/GitHub'; -import People from '@mui/icons-material/People'; -import { Button } from '@dicedb/ui/button'; -import Link from 'next/link'; export default function Footer() { - return ( -
-
- ); + return
; } diff --git a/apps/playground-web/components/Footer/__tests__/Footer.test.tsx b/apps/playground-web/components/Footer/__tests__/Footer.test.tsx deleted file mode 100644 index 061290e..0000000 --- a/apps/playground-web/components/Footer/__tests__/Footer.test.tsx +++ /dev/null @@ -1,133 +0,0 @@ -import '@testing-library/jest-dom'; -import { render, screen } from '@testing-library/react'; -import Footer from '../Footer'; - -const setupTest = () => { - const utils = render(