[Query Copilot] Sample Prompt implementation and other (#1489)

* Sample Prompts and ComboBox implementation

* Adding DeletePopup and SamplePrompts

* Implementation of Delete/Copy code buttons

* Adjusted changes based on the comments for Modal

* Reverded implementation of inline prompt

* Updated function

* Replacing const to function

* Unused icons deleted

* Comments removed

* Additional styling based on designs

* Test snapshots

* Implementation of popup for copying code

* Tests updated/added

* Background color changed

* Resolving lint issue

* CopyPopup snapshot updated

* Merged with master

* Implementations fixed based on comments

* Test Snapshots updated

* Query copilot updated

* Resolving minor bug with Delete popup

---------

Co-authored-by: Predrag Klepic <v-prklepic@microsoft.com>
This commit is contained in:
Predrag Klepic 2023-06-28 10:11:03 +02:00 committed by GitHub
parent 444f1b66fd
commit f3c96b91bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
18 changed files with 1403 additions and 144 deletions

View File

@ -0,0 +1,3 @@
<svg width="20" height="22" viewBox="0 0 20 22" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M7.4852 1.13266C6.25055 1.69386 5.20039 2.5918 5.20039 3.8002V7.41652C5.39862 7.40568 5.59878 7.4002 5.80039 7.4002C6.00246 7.4002 6.20261 7.40569 6.40039 7.41649V5.83795C6.72565 6.08075 7.09627 6.29095 7.4852 6.46774C8.77401 7.05356 10.5123 7.4002 12.4004 7.4002C14.2885 7.4002 16.0268 7.05356 17.3156 6.46774C17.7045 6.29095 18.0752 6.08075 18.4004 5.83795V15.8002C18.4004 16.2486 17.9731 16.8507 16.819 17.3753C15.7191 17.8752 14.1574 18.2002 12.4005 18.2002L12.4004 18.7995C12.4004 19.0077 12.379 19.208 12.3392 19.4001L12.4004 19.4002C14.2885 19.4002 16.0268 19.0535 17.3156 18.4677C18.5503 17.9066 19.6004 17.0086 19.6004 15.8002V3.8002C19.6004 2.5918 18.5503 1.69386 17.3156 1.13266C16.0268 0.546827 14.2885 0.200195 12.4004 0.200195C10.5123 0.200195 8.77401 0.546827 7.4852 1.13266ZM7.98176 5.37529C6.82769 4.85071 6.40039 4.24866 6.40039 3.8002C6.40039 3.35173 6.82769 2.74968 7.98176 2.2251C9.08168 1.72513 10.6434 1.4002 12.4004 1.4002C14.1574 1.4002 15.7191 1.72513 16.819 2.2251C17.9731 2.74968 18.4004 3.35173 18.4004 3.8002C18.4004 4.24866 17.9731 4.85071 16.819 5.37529C15.7191 5.87526 14.1574 6.2002 12.4004 6.2002C10.6434 6.2002 9.08168 5.87526 7.98176 5.37529ZM6.40039 8.61851C6.76422 8.64085 7.11714 8.68327 7.4555 8.74374C7.93669 8.82972 8.38843 8.95219 8.80015 9.10529C10.2475 9.64345 11.2004 10.56 11.2004 11.6002C11.2004 13.257 8.78273 14.6002 5.80039 14.6002C2.81805 14.6002 0.400391 13.257 0.400391 11.6002C0.400391 10.056 2.50043 8.78432 5.20039 8.61851C5.39739 8.60641 5.59759 8.6002 5.80039 8.6002C6.00319 8.6002 6.20339 8.60641 6.40039 8.61851ZM11.1112 19.3454C10.6494 20.7416 8.44723 21.7995 5.80039 21.7995C2.81805 21.7995 0.400391 20.4564 0.400391 18.7995V14.0648C0.706223 14.3399 1.04834 14.5755 1.39925 14.7705C2.58615 15.4299 4.14455 15.8002 5.80039 15.8002C7.45623 15.8002 9.01463 15.4299 10.2015 14.7705C10.553 14.5752 10.8957 14.3391 11.202 14.0633C11.2015 15.2351 11.2008 16.9706 11.2005 18.1486V18.1508C11.2004 18.3942 11.2004 18.6137 11.2004 18.7995C11.2004 18.986 11.1698 19.1684 11.1112 19.3454Z" fill="#0078D4"/>
</svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@ -0,0 +1,3 @@
<svg width="20" height="22" viewBox="0 0 20 22" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M0.799805 3.99971C0.799805 2.79131 1.8498 1.89371 3.0798 1.33211C4.6378 0.684806 6.313 0.367334 7.9998 0.39971C9.68664 0.367334 11.3618 0.684806 12.9198 1.33211C14.1498 1.89371 15.1998 2.79131 15.1998 3.99971V10.1304C14.827 10.1594 14.4604 10.2471 14.1138 10.3906C14.0755 10.4066 14.0375 10.423 13.9998 10.4403V6.03971C13.6631 6.28732 13.301 6.49849 12.9198 6.66971C11.3616 7.3162 9.6864 7.63285 7.9998 7.59971C6.313 7.63209 4.6378 7.31461 3.0798 6.66731C2.69864 6.49686 2.33662 6.28648 1.9998 6.03971V15.9997C1.9998 16.4485 2.427 17.0497 3.5814 17.5753C4.98209 18.1502 6.48605 18.4308 7.9998 18.3997L8.02536 18.4002C8.03904 18.4647 8.05452 18.529 8.0718 18.593L7.15982 19.5098C7.13596 19.5337 7.11282 19.5582 7.09042 19.5832C5.71356 19.507 4.35728 19.198 3.0798 18.6673C1.8498 18.1057 0.799805 17.2081 0.799805 15.9997V3.99971ZM1.9998 3.99971C1.9998 4.44851 2.427 5.04971 3.5814 5.57531C4.98209 6.15018 6.48605 6.4308 7.9998 6.39971C9.5136 6.4308 11.0176 6.15018 12.4182 5.57531C13.5726 5.04971 13.9998 4.44851 13.9998 3.99971C13.9998 3.55091 13.5726 2.94971 12.4182 2.42411C11.0176 1.84924 9.5136 1.56863 7.9998 1.59971C6.48605 1.56863 4.98209 1.84924 3.5814 2.42411C2.427 2.94971 1.9998 3.55091 1.9998 3.99971ZM19.0373 11.0246C19.15 10.9122 19.2133 10.7595 19.2134 10.6003C19.2136 10.441 19.1504 10.2883 19.0379 10.1756C18.9254 10.0629 18.7728 9.99963 18.6136 9.99952C18.4543 9.9994 18.3016 10.0626 18.1889 10.175L16.7657 11.5982C16.7506 11.6187 16.7366 11.64 16.7237 11.6618C16.2658 11.3886 15.7297 11.2755 15.2004 11.3407C14.6711 11.4058 14.1785 11.6456 13.8005 12.0218L13.0805 12.7418C12.8603 12.9626 12.7366 13.2616 12.7366 13.5734C12.7366 13.8853 12.8603 14.1843 13.0805 14.405L14.8109 16.1318C15.0317 16.3525 15.331 16.4764 15.6431 16.4764C15.9552 16.4764 16.2546 16.3525 16.4753 16.1318L17.1953 15.4118C17.5718 15.0338 17.8117 14.541 17.8769 14.0114C17.942 13.4817 17.829 12.9456 17.5553 12.4874C17.5777 12.4753 17.599 12.4612 17.6189 12.4454L19.0373 11.0246ZM12.2317 15.2498C12.1225 15.1405 11.9928 15.054 11.8501 14.9948C11.7074 14.9356 11.5546 14.9053 11.4001 14.9053C11.2457 14.9053 11.0927 14.9356 10.95 14.9948C10.8073 15.054 10.6777 15.1405 10.5685 15.2498L9.84852 15.9698C9.47196 16.3478 9.23208 16.8406 9.16692 17.3702C9.10176 17.8998 9.21492 18.436 9.48852 18.8942C9.46632 18.9066 9.44508 18.9206 9.42492 18.9362L8.00652 20.3582C7.89722 20.4714 7.83674 20.6229 7.8381 20.7802C7.83947 20.9376 7.90258 21.088 8.01384 21.1993C8.12508 21.3105 8.27556 21.3736 8.43288 21.375C8.5902 21.3763 8.74176 21.3158 8.85492 21.2066L10.2769 19.7834C10.2926 19.7631 10.3072 19.7419 10.3201 19.7198C10.778 19.993 11.3141 20.1061 11.8434 20.0409C12.3727 19.9756 12.8653 19.736 13.2433 19.3598L13.9633 18.6398C14.184 18.419 14.3078 18.1197 14.3078 17.8076C14.3078 17.4955 14.184 17.1961 13.9633 16.9754L12.2317 15.2498Z" fill="#0078D4"/>
</svg>

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

@ -0,0 +1,34 @@
<svg width="32" height="34" viewBox="0 0 32 34" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M13 0.739258L16 1.04436V9.68622L11.2 10.8013L9.60002 12.9967V16.4479C9.60002 18.7669 10.8545 20.9045 12.879 22.0353L17.4036 24.5626L9.6 28.69L6.35592 29.1523L3.27902 27.4337C1.25445 26.3028 0 24.1652 0 21.8462V11.7591C0 9.43952 1.25512 7.30147 3.28055 6.17085L12.3174 1.12639L12.3121 1.13012L13 0.739258Z" fill="url(#paint0_radial_857_143948)"/>
<path d="M13 0.739258L16 1.04436V9.68622L11.2 10.8013L9.60002 12.9967V16.4479C9.60002 18.7669 10.8545 20.9045 12.879 22.0353L17.4036 24.5626L9.6 28.69L6.35592 29.1523L3.27902 27.4337C1.25445 26.3028 0 24.1652 0 21.8462V11.7591C0 9.43952 1.25512 7.30147 3.28055 6.17085L12.3174 1.12639L12.3121 1.13012L13 0.739258Z" fill="url(#paint1_linear_857_143948)"/>
<path d="M22.399 12.001L30.399 16.801L31.999 18.401V21.8452C31.999 24.1642 30.7446 26.3018 28.72 27.4327L19.12 32.7949C17.1804 33.8784 14.8177 33.8784 12.878 32.7949L3.27804 27.4327C3.09146 27.3284 2.91141 27.2157 2.73828 27.095L3.278 27.3965C5.21762 28.4799 7.58035 28.4799 9.51996 27.3965L19.12 22.0342C21.1445 20.9033 22.399 18.7657 22.399 16.4467V12.001Z" fill="url(#paint2_radial_857_143948)"/>
<path d="M22.399 12.001L30.399 16.801L31.999 18.401V21.8452C31.999 24.1642 30.7446 26.3018 28.72 27.4327L19.12 32.7949C17.1804 33.8784 14.8177 33.8784 12.878 32.7949L3.27804 27.4327C3.09146 27.3284 2.91141 27.2157 2.73828 27.095L3.278 27.3965C5.21762 28.4799 7.58035 28.4799 9.51996 27.3965L19.12 22.0342C21.1445 20.9033 22.399 18.7657 22.399 16.4467V12.001Z" fill="url(#paint3_linear_857_143948)"/>
<path d="M28.7191 6.17053L19.119 0.811705C17.1802 -0.270568 14.819 -0.270568 12.8802 0.811704L12.3151 1.1271C10.6239 2.31737 9.59961 4.26472 9.59961 6.36025V13.0461L12.8802 11.2149C14.819 10.1326 17.1802 10.1326 19.119 11.2149L28.7191 16.5737C30.6984 17.6786 31.9421 19.7456 31.9977 22.0039C31.999 21.9514 31.9996 21.8987 31.9996 21.8459V11.7588C31.9996 9.4392 30.7445 7.30115 28.7191 6.17053Z" fill="url(#paint4_radial_857_143948)"/>
<path d="M28.7191 6.17053L19.119 0.811705C17.1802 -0.270568 14.819 -0.270568 12.8802 0.811704L12.3151 1.1271C10.6239 2.31737 9.59961 4.26472 9.59961 6.36025V13.0461L12.8802 11.2149C14.819 10.1326 17.1802 10.1326 19.119 11.2149L28.7191 16.5737C30.6984 17.6786 31.9421 19.7456 31.9977 22.0039C31.999 21.9514 31.9996 21.8987 31.9996 21.8459V11.7588C31.9996 9.4392 30.7445 7.30115 28.7191 6.17053Z" fill="url(#paint5_linear_857_143948)"/>
<defs>
<radialGradient id="paint0_radial_857_143948" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(13.5054 9.8837) rotate(112.544) scale(23.4519 19.3067)">
<stop offset="0.206732" stop-color="#4995D0"/>
<stop offset="0.875628" stop-color="#0078D4"/>
</radialGradient>
<linearGradient id="paint1_linear_857_143948" x1="11.0625" y1="26.6174" x2="9.78695" y2="24.2436" gradientUnits="userSpaceOnUse">
<stop offset="0.9999" stop-color="#0078D4"/>
<stop offset="1" stop-color="#0078D4" stop-opacity="0"/>
</linearGradient>
<radialGradient id="paint2_radial_857_143948" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(6.899 24.5214) rotate(-3.9995) scale(24.6197 15.4594)">
<stop offset="0.140029" stop-color="#80C8FF"/>
<stop offset="0.952721" stop-color="#0078D4"/>
</radialGradient>
<linearGradient id="paint3_linear_857_143948" x1="26.8932" y1="15.5508" x2="25.5491" y2="17.8921" gradientUnits="userSpaceOnUse">
<stop offset="0.9999" stop-color="#3F8AC3"/>
<stop offset="1" stop-color="#8C66BA" stop-opacity="0"/>
</linearGradient>
<radialGradient id="paint4_radial_857_143948" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(26.632 16.3878) rotate(-138.33) scale(22.8015 13.0047)">
<stop stop-color="#7BC6FF"/>
<stop offset="0.839255" stop-color="#0078D4"/>
</radialGradient>
<linearGradient id="paint5_linear_857_143948" x1="9.59961" y1="8.71337" x2="12.2131" y2="8.71337" gradientUnits="userSpaceOnUse">
<stop offset="0.9999" stop-color="#0078D4"/>
<stop offset="1" stop-color="#436DCD" stop-opacity="0"/>
</linearGradient>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 4.0 KiB

View File

@ -0,0 +1,3 @@
<svg width="12" height="20" viewBox="0 0 12 8" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M0 5.5V4.75H0.75V5.5H0ZM0 3.25V2.5H0.75V3.25H0ZM2.25 3.25V2.5H12V3.25H2.25ZM0 1V0.25H0.75V1H0ZM2.25 0.25H12V1H2.25V0.25ZM2.25 5.5V4.75H12V5.5H2.25ZM0 7.75V7H0.75V7.75H0ZM2.25 7.75V7H12V7.75H2.25Z" fill="#0078D4"/>
</svg>

After

Width:  |  Height:  |  Size: 325 B

3
images/SimplePrompts.svg Normal file
View File

@ -0,0 +1,3 @@
<svg width="19" height="21" viewBox="0 0 19 21" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M0 4C0 3.30945 0.3153 2.70664 0.77423 2.22025C1.2294 1.73784 1.85301 1.33745 2.56668 1.01752C3.99575 0.3769 5.91738 0 8 0C10.0826 0 12.0042 0.3769 13.4333 1.01752C14.147 1.33745 14.7706 1.73784 15.2258 2.22025C15.6847 2.70664 16 3.30945 16 4V10.2572C15.5537 9.8886 15.0482 9.589 14.5 9.3749V6.39242C14.1791 6.61282 13.8194 6.80942 13.4333 6.98248C12.0042 7.6231 10.0826 8 8 8C5.91738 8 3.99575 7.6231 2.56668 6.98248C2.18063 6.80942 1.82094 6.61282 1.5 6.39242V16C1.5 16.2069 1.59044 16.4591 1.86525 16.7503C2.14382 17.0456 2.58195 17.3455 3.18027 17.6137C4.37519 18.1494 6.0786 18.5 8 18.5C8.2396 18.5 8.4759 18.4945 8.7081 18.484C9.3109 19.0579 10.0438 19.4964 10.858 19.7507C9.9673 19.9127 9.0023 20 8 20C5.91738 20 3.99575 19.6231 2.56668 18.9825C1.85301 18.6626 1.2294 18.2622 0.77423 17.7798C0.3153 17.2934 0 16.6906 0 16V4ZM1.5 4C1.5 4.20691 1.59044 4.45909 1.86525 4.75034C2.14382 5.04559 2.58195 5.3455 3.18027 5.61372C4.37519 6.14937 6.0786 6.5 8 6.5C9.9214 6.5 11.6248 6.14937 12.8197 5.61372C13.418 5.3455 13.8562 5.04559 14.1348 4.75034C14.4096 4.45909 14.5 4.20691 14.5 4C14.5 3.79309 14.4096 3.54091 14.1348 3.24966C13.8562 2.95441 13.418 2.65449 12.8197 2.38628C11.6248 1.85063 9.9214 1.5 8 1.5C6.0786 1.5 4.37519 1.85063 3.18027 2.38628C2.58195 2.65449 2.14382 2.95441 1.86525 3.24966C1.59044 3.54091 1.5 3.79309 1.5 4ZM12.5 19C13.4719 19 14.3718 18.6919 15.1074 18.1681L17.7197 20.7803C18.0126 21.0732 18.4874 21.0732 18.7803 20.7803C19.0732 20.4874 19.0732 20.0126 18.7803 19.7197L16.1681 17.1074C16.6919 16.3718 17 15.4719 17 14.5C17 12.0147 14.9853 10 12.5 10C10.0147 10 8 12.0147 8 14.5C8 16.9853 10.0147 19 12.5 19ZM12.5 17.5C10.8431 17.5 9.5 16.1569 9.5 14.5C9.5 12.8431 10.8431 11.5 12.5 11.5C14.1569 11.5 15.5 12.8431 15.5 14.5C15.5 16.1569 14.1569 17.5 12.5 17.5Z" fill="#0078D4"/>
</svg>

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@ -0,0 +1,4 @@
<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M7 14C10.866 14 14 10.866 14 7C14 3.13401 10.866 0 7 0C3.13401 0 0 3.13401 0 7C0 10.866 3.13401 14 7 14Z" fill="#57A300"/>
<path d="M3.10891 7.25414C3.04416 7.18502 3.01091 7.09402 3.01441 6.99952C3.01791 6.90414 3.05816 6.81664 3.12816 6.75102L3.85879 6.07552C3.92529 6.01514 4.01016 5.98189 4.09854 5.98189C4.19654 5.98189 4.29104 6.02302 4.35754 6.09477L6.22654 8.10027L9.55766 3.83464C9.62504 3.74802 9.72653 3.69727 9.83678 3.69727C9.91553 3.69727 9.98991 3.72264 10.0529 3.77077L10.8457 4.38239C10.997 4.49439 11.0294 4.71227 10.9157 4.86714L6.65616 10.321C6.49079 10.5328 6.17491 10.5468 5.99116 10.3499L3.10891 7.25414Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 756 B

View File

@ -0,0 +1,11 @@
import { shallow } from "enzyme";
import React from "react";
import { any } from "underscore";
import { CopyPopup } from "./CopyPopup";
describe("Copy Popup snapshot test", () => {
it("should render when showCopyPopup is true", () => {
const wrapper = shallow(<CopyPopup showCopyPopup={true} setShowCopyPopup={() => any} />);
expect(wrapper).toMatchSnapshot();
});
});

View File

@ -0,0 +1,63 @@
import { IconButton, Image, Stack, Text } from "@fluentui/react";
import React, { Dispatch, SetStateAction } from "react";
import Success from "../../../../images/successfulPopup.svg";
export const CopyPopup = ({
showCopyPopup,
setShowCopyPopup,
}: {
showCopyPopup: boolean;
setShowCopyPopup: Dispatch<SetStateAction<boolean>>;
}): JSX.Element => {
const closePopup = () => {
setShowCopyPopup(false);
};
return showCopyPopup ? (
<Stack
style={{
position: "fixed",
width: 345,
height: 66,
padding: 10,
gap: 5,
top: 75,
right: 20,
background: "#FFFFFF",
boxShadow: "0 2px 6px rgba(0, 0, 0, 0.16)",
}}
>
<Stack
horizontal
verticalAlign="center"
style={{ display: "flex", justifyContent: "space-between", padding: "5px, 2px, 0px, 0px" }}
>
<Stack horizontal verticalAlign="center" style={{ display: "flex", gap: 10 }}>
<Image style={{ width: 15, height: 15 }} src={Success} />
<Text>
<b>Code copied successfully</b>
</Text>
</Stack>
<IconButton
styles={{
root: {
border: "none",
backgroundColor: "transparent",
padding: 0,
selectors: {
"&:focus": {
outline: "none",
},
},
},
}}
iconProps={{ iconName: "Cancel" }}
onClick={closePopup}
/>
</Stack>
<Text style={{ marginTop: -10 }}>The query has been copied to the clipboard</Text>
</Stack>
) : (
<></>
);
};

View File

@ -0,0 +1,11 @@
import { shallow } from "enzyme";
import React from "react";
import { any } from "underscore";
import { DeletePopup } from "./DeletePopup";
describe("Delete Popup snapshot test", () => {
it("should render when showDeletePopup is true", () => {
const wrapper = shallow(<DeletePopup showDeletePopup={true} setShowDeletePopup={() => any} setQuery={() => any} />);
expect(wrapper).toMatchSnapshot();
});
});

View File

@ -0,0 +1,38 @@
import { DefaultButton, Modal, PrimaryButton, Stack, Text } from "@fluentui/react";
import React, { Dispatch, SetStateAction } from "react";
export const DeletePopup = ({
showDeletePopup,
setShowDeletePopup,
setQuery,
}: {
showDeletePopup: boolean;
setShowDeletePopup: Dispatch<SetStateAction<boolean>>;
setQuery: Dispatch<SetStateAction<string>>;
}): JSX.Element => {
const deleteCode = () => {
setQuery("");
setShowDeletePopup(false);
};
return (
<Modal isOpen={showDeletePopup} styles={{ main: { minHeight: "122px", minWidth: "880px" } }}>
<Stack style={{ padding: "16px 24px", height: "auto" }}>
<Text style={{ height: 24, fontSize: "18px" }}>
<b>Delete code?</b>
</Text>
<Text style={{ marginTop: 10, marginBottom: 20 }}>
This will clear the query from the query builder pane along with all comments and also reset the prompt pane
</Text>
<Stack horizontal tokens={{ childrenGap: 10 }} horizontalAlign="start">
<PrimaryButton style={{ padding: "0px 20px", height: 24 }} onClick={deleteCode}>
Delete
</PrimaryButton>
<DefaultButton style={{ padding: "0px 20px", height: 24 }} onClick={() => setShowDeletePopup(false)}>
Close
</DefaultButton>
</Stack>
</Stack>
</Modal>
);
};

View File

@ -0,0 +1,88 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Copy Popup snapshot test should render when showCopyPopup is true 1`] = `
<Stack
style={
Object {
"background": "#FFFFFF",
"boxShadow": "0 2px 6px rgba(0, 0, 0, 0.16)",
"gap": 5,
"height": 66,
"padding": 10,
"position": "fixed",
"right": 20,
"top": 75,
"width": 345,
}
}
>
<Stack
horizontal={true}
style={
Object {
"display": "flex",
"justifyContent": "space-between",
"padding": "5px, 2px, 0px, 0px",
}
}
verticalAlign="center"
>
<Stack
horizontal={true}
style={
Object {
"display": "flex",
"gap": 10,
}
}
verticalAlign="center"
>
<Image
src=""
style={
Object {
"height": 15,
"width": 15,
}
}
/>
<Text>
<b>
Code copied successfully
</b>
</Text>
</Stack>
<CustomizedIconButton
iconProps={
Object {
"iconName": "Cancel",
}
}
onClick={[Function]}
styles={
Object {
"root": Object {
"backgroundColor": "transparent",
"border": "none",
"padding": 0,
"selectors": Object {
"&:focus": Object {
"outline": "none",
},
},
},
}
}
/>
</Stack>
<Text
style={
Object {
"marginTop": -10,
}
}
>
The query has been copied to the clipboard
</Text>
</Stack>
`;

View File

@ -0,0 +1,79 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Delete Popup snapshot test should render when showDeletePopup is true 1`] = `
<Modal
isOpen={true}
styles={
Object {
"main": Object {
"minHeight": "122px",
"minWidth": "880px",
},
}
}
>
<Stack
style={
Object {
"height": "auto",
"padding": "16px 24px",
}
}
>
<Text
style={
Object {
"fontSize": "18px",
"height": 24,
}
}
>
<b>
Delete code?
</b>
</Text>
<Text
style={
Object {
"marginBottom": 20,
"marginTop": 10,
}
}
>
This will clear the query from the query builder pane along with all comments and also reset the prompt pane
</Text>
<Stack
horizontal={true}
horizontalAlign="start"
tokens={
Object {
"childrenGap": 10,
}
}
>
<CustomizedPrimaryButton
onClick={[Function]}
style={
Object {
"height": 24,
"padding": "0px 20px",
}
}
>
Delete
</CustomizedPrimaryButton>
<CustomizedDefaultButton
onClick={[Function]}
style={
Object {
"height": 24,
"padding": "0px 20px",
}
}
>
Close
</CustomizedDefaultButton>
</Stack>
</Stack>
</Modal>
`;

View File

@ -31,7 +31,10 @@ import { EditorReact } from "Explorer/Controls/Editor/EditorReact";
import Explorer from "Explorer/Explorer";
import { useCommandBar } from "Explorer/Menus/CommandBar/CommandBarComponentAdapter";
import { SaveQueryPane } from "Explorer/Panes/SaveQueryPane/SaveQueryPane";
import { CopyPopup } from "Explorer/QueryCopilot/Popup/CopyPopup";
import { DeletePopup } from "Explorer/QueryCopilot/Popup/DeletePopup";
import { submitFeedback } from "Explorer/QueryCopilot/QueryCopilotUtilities";
import { SamplePrompts, SamplePromptsProps } from "Explorer/QueryCopilot/SamplePrompts/SamplePrompts";
import { QueryResultSection } from "Explorer/Tabs/QueryTab/QueryResultSection";
import { userContext } from "UserContext";
import { queryPagesUntilContentPresent } from "Utils/QueryUtils";
@ -39,10 +42,11 @@ import { useQueryCopilot } from "hooks/useQueryCopilot";
import { useSidePanel } from "hooks/useSidePanel";
import React, { useState } from "react";
import SplitterLayout from "react-splitter-layout";
import CopilotIcon from "../../../images/Copilot.svg";
import ExecuteQueryIcon from "../../../images/ExecuteQuery.svg";
import HintIcon from "../../../images/Hint.svg";
import CopilotIcon from "../../../images/QueryCopilotNewLogo.svg";
import RecentIcon from "../../../images/Recent.svg";
import SamplePromptsIcon from "../../../images/SamplePromptsIcon.svg";
import SaveQueryIcon from "../../../images/save-cosmos.svg";
import { useTabs } from "../../hooks/useTabs";
@ -81,6 +85,33 @@ export const QueryCopilotTab: React.FC<QueryCopilotTabProps> = ({
const [queryIterator, setQueryIterator] = useState<MinimalQueryIterator>();
const [queryResults, setQueryResults] = useState<QueryResults>();
const [errorMessage, setErrorMessage] = useState<string>("");
const [isSamplePromptsOpen, setIsSamplePromptsOpen] = useState<boolean>(false);
const [showDeletePopup, setShowDeletePopup] = useState<boolean>(false);
const [showFeedbackBar, setShowFeedbackBar] = useState<boolean>(false);
const [showCopyPopup, setshowCopyPopup] = useState<boolean>(false);
const sampleProps: SamplePromptsProps = {
isSamplePromptsOpen: isSamplePromptsOpen,
setIsSamplePromptsOpen: setIsSamplePromptsOpen,
setTextBox: setUserPrompt,
};
const copyGeneratedCode = () => {
if (!query) {
return;
}
const queryElement = document.createElement("textarea");
queryElement.value = query;
document.body.appendChild(queryElement);
queryElement.select();
document.execCommand("copy");
document.body.removeChild(queryElement);
setshowCopyPopup(true);
setTimeout(() => {
setshowCopyPopup(false);
}, 6000);
};
const cachedHistoriesString = localStorage.getItem(`${userContext.databaseAccount?.id}-queryCopilotHistories`);
const cachedHistories = cachedHistoriesString?.split(",");
@ -91,7 +122,6 @@ export const QueryCopilotTab: React.FC<QueryCopilotTabProps> = ({
setHistories(newHistories);
localStorage.setItem(`${userContext.databaseAccount.id}-queryCopilotHistories`, newHistories.join(","));
};
const generateSQLQuery = async (): Promise<void> => {
try {
setIsGeneratingQuery(true);
@ -100,6 +130,7 @@ export const QueryCopilotTab: React.FC<QueryCopilotTabProps> = ({
containerSchema: QueryCopilotSampleContainerSchema,
userPrompt: userPrompt,
};
setShowDeletePopup(false);
const response = await fetch("https://copilotorchestrater.azurewebsites.net/generateSQLQuery", {
method: "POST",
headers: {
@ -124,6 +155,7 @@ export const QueryCopilotTab: React.FC<QueryCopilotTabProps> = ({
} finally {
setIsGeneratingQuery(false);
useTabs.getState().setIsTabExecuting(false);
setShowFeedbackBar(true);
}
};
@ -182,7 +214,16 @@ export const QueryCopilotTab: React.FC<QueryCopilotTabProps> = ({
hasPopup: false,
};
return [executeQueryBtn, saveQueryBtn];
const samplePromptsBtn = {
iconSrc: SamplePromptsIcon,
iconAlt: "Sample Prompts",
onCommandClick: () => setIsSamplePromptsOpen(true),
commandButtonLabel: "Sample Prompts",
ariaLabel: "Sample Prompts",
hasPopup: false,
};
return [executeQueryBtn, saveQueryBtn, samplePromptsBtn];
};
React.useEffect(() => {
@ -321,57 +362,70 @@ export const QueryCopilotTab: React.FC<QueryCopilotTabProps> = ({
</Link>
</Text>
<Stack style={{ backgroundColor: "#FFF8F0", padding: "2px 8px" }} horizontal verticalAlign="center">
<Text style={{ fontWeight: 600, fontSize: 12 }}>Provide feedback on the query generated</Text>
{showCallout && !hideFeedbackModalForLikedQueries && (
<Callout
style={{ padding: 8 }}
target="#likeBtn"
onDismiss={() => {
setShowCallout(false);
submitFeedback({ generatedQuery, likeQuery, description: "", userPrompt: userPrompt });
{showFeedbackBar ? (
<Stack style={{ backgroundColor: "#FFF8F0", padding: "2px 8px" }} horizontal verticalAlign="center">
<Text style={{ fontWeight: 600, fontSize: 12 }}>Provide feedback on the query generated</Text>
{showCallout && !hideFeedbackModalForLikedQueries && (
<Callout
style={{ padding: 8 }}
target="#likeBtn"
onDismiss={() => {
setShowCallout(false);
submitFeedback({ generatedQuery, likeQuery, description: "", userPrompt: userPrompt });
}}
directionalHint={DirectionalHint.topCenter}
>
<Text>
Thank you. Need to give{" "}
<Link
onClick={() => {
setShowCallout(false);
useQueryCopilot.getState().openFeedbackModal(generatedQuery, true, userPrompt);
}}
>
more feedback?
</Link>
</Text>
</Callout>
)}
<IconButton
id="likeBtn"
style={{ marginLeft: 20 }}
iconProps={{ iconName: likeQuery === true ? "LikeSolid" : "Like" }}
onClick={() => {
setLikeQuery(true);
setShowCallout(true);
}}
directionalHint={DirectionalHint.topCenter}
/>
<IconButton
style={{ margin: "0 10px" }}
iconProps={{ iconName: likeQuery === false ? "DislikeSolid" : "Dislike" }}
onClick={() => {
setLikeQuery(false);
setShowCallout(false);
useQueryCopilot.getState().openFeedbackModal(generatedQuery, false, userPrompt);
}}
/>
<Separator vertical style={{ color: "#EDEBE9" }} />
<CommandBarButton
onClick={copyGeneratedCode}
iconProps={{ iconName: "Copy" }}
style={{ margin: "0 10px", backgroundColor: "#FFF8F0", transition: "background-color 0.3s ease" }}
>
<Text>
Thank you. Need to give{" "}
<Link
onClick={() => {
setShowCallout(false);
useQueryCopilot.getState().openFeedbackModal(generatedQuery, true, userPrompt);
}}
>
more feedback?
</Link>
</Text>
</Callout>
)}
<IconButton
id="likeBtn"
style={{ marginLeft: 20 }}
iconProps={{ iconName: likeQuery === true ? "LikeSolid" : "Like" }}
onClick={() => {
setLikeQuery(true);
setShowCallout(true);
}}
/>
<IconButton
style={{ margin: "0 10px" }}
iconProps={{ iconName: likeQuery === false ? "DislikeSolid" : "Dislike" }}
onClick={() => {
setLikeQuery(false);
setShowCallout(false);
useQueryCopilot.getState().openFeedbackModal(generatedQuery, false, userPrompt);
}}
/>
<Separator vertical styles={{ root: { selectors: { "::before": { background: "#E1DFDD" } } } }} />
<CommandBarButton iconProps={{ iconName: "Copy" }} style={{ margin: "0 10px", backgroundColor: "#FFF8F0" }}>
Copy code
</CommandBarButton>
<CommandBarButton iconProps={{ iconName: "Delete" }} style={{ backgroundColor: "#FFF8F0" }}>
Delete code
</CommandBarButton>
</Stack>
Copy code
</CommandBarButton>
<CommandBarButton
onClick={() => setShowDeletePopup(true)}
iconProps={{ iconName: "Delete" }}
style={{ margin: "0 10px", backgroundColor: "#FFF8F0", transition: "background-color 0.3s ease" }}
>
Delete code
</CommandBarButton>
</Stack>
) : (
<></>
)}
<Stack className="tabPaneContentContainer">
<SplitterLayout vertical={true} primaryIndex={0} primaryMinSize={100} secondaryMinSize={200}>
<EditorReact
@ -393,6 +447,13 @@ export const QueryCopilotTab: React.FC<QueryCopilotTabProps> = ({
/>
</SplitterLayout>
</Stack>
{isSamplePromptsOpen ? <SamplePrompts sampleProps={sampleProps} /> : <></>}
{query !== "" && query.trim().length !== 0 ? (
<DeletePopup showDeletePopup={showDeletePopup} setShowDeletePopup={setShowDeletePopup} setQuery={setQuery} />
) : (
<></>
)}
<CopyPopup showCopyPopup={showCopyPopup} setShowCopyPopup={setshowCopyPopup} />
</Stack>
);
};

View File

@ -0,0 +1,26 @@
import { shallow } from "enzyme";
import React from "react";
import { SamplePrompts, SamplePromptsProps } from "./SamplePrompts";
describe("Sample Prompts snapshot test", () => {
it("should render properly if isSamplePromptsOpen is true", () => {
const sampleProps: SamplePromptsProps = {
isSamplePromptsOpen: true,
setIsSamplePromptsOpen: () => undefined,
setTextBox: () => undefined,
};
const wrapper = shallow(<SamplePrompts sampleProps={sampleProps} />);
expect(wrapper).toMatchSnapshot();
});
it("should render properly if isSamplePromptsOpen is false", () => {
const sampleProps: SamplePromptsProps = {
isSamplePromptsOpen: false,
setIsSamplePromptsOpen: () => undefined,
setTextBox: () => undefined,
};
const wrapper = shallow(<SamplePrompts sampleProps={sampleProps} />);
expect(wrapper).toMatchSnapshot();
});
});

View File

@ -0,0 +1,138 @@
import { DefaultButton, FontIcon, IconButton, Image, Modal, Stack, Text } from "@fluentui/react";
import React, { Dispatch, SetStateAction } from "react";
import ComplexPrompts from "../../../../images/ComplexPrompts.svg";
import IntermediatePrompts from "../../../../images/IntermediatePrompts.svg";
import SimplePrompts from "../../../../images/SimplePrompts.svg";
export interface SamplePromptsProps {
isSamplePromptsOpen: boolean;
setIsSamplePromptsOpen: Dispatch<SetStateAction<boolean>>;
setTextBox: Dispatch<SetStateAction<string>>;
}
const SampleUserInputs: string[] = [
"Show me products less than 100 dolars",
"Show schema",
"Show items with a description that contains a number between 0 and 99 inclusive.",
"Write a query to return all records in this table created in the last thirty days",
"Show all the products that customer Bob has reviewed.",
"Which computers are more than 300 dollars and less than 400 dollars?",
];
export const SamplePrompts = ({ sampleProps }: { sampleProps: SamplePromptsProps }): JSX.Element => {
const updateTextBox = (userInput: string) => {
sampleProps.setTextBox(userInput);
sampleProps.setIsSamplePromptsOpen(false);
};
return (
<Modal isOpen={sampleProps.isSamplePromptsOpen}>
<Stack
style={{ padding: "16px 24px", overflowY: "auto", maxHeight: "calc(100vh - 120px)" }}
role="dialog"
aria-modal="true"
>
<Stack>
<Stack horizontal style={{ display: "flex", justifyContent: "space-between" }}>
<Text style={{ fontSize: 24, fontWeight: 600 }}>Sample Prompts</Text>
<IconButton
styles={{
root: {
border: "none",
backgroundColor: "transparent",
padding: 0,
selectors: {
"&:hover": {
backgroundColor: "transparent",
color: "#000", // Set the desired color for the X button on hover
},
"&:focus": {
outline: "none",
},
},
},
}}
iconProps={{ iconName: "Cancel" }}
onClick={() => sampleProps.setIsSamplePromptsOpen(false)}
/>
</Stack>
<Text style={{ fontWeight: 400, fontSize: 13, marginTop: 10 }}>
Here are some sample prompts for writing queries in NoSQL, ranging from simple to complex
</Text>
</Stack>
<Stack style={{ marginTop: 30, display: "flex" }}>
<Stack horizontal verticalAlign="center">
<Image style={{ width: 25, height: 25 }} src={SimplePrompts} />
<Text style={{ fontSize: 14, fontWeight: 600 }}>Simple Prompts</Text>
</Stack>
</Stack>
<Stack horizontal style={{ gap: 35 }}>
<DefaultButton
style={{ width: 352, height: 135, background: "#F6F6F7" }}
onClick={() => updateTextBox(SampleUserInputs[0])}
>
<Text style={{ height: 80, fontSize: 13 }}>{SampleUserInputs[0]}</Text>
<FontIcon style={{ position: "absolute", left: "92.61%" }} aria-label="Forward" iconName="Forward" />
</DefaultButton>
<DefaultButton
style={{ width: 352, height: 135, background: "#F6F6F7" }}
onClick={() => updateTextBox(SampleUserInputs[1])}
>
<Text style={{ height: 80, fontSize: 13 }}>{SampleUserInputs[1]}</Text>
<FontIcon style={{ position: "absolute", left: "92.61%" }} aria-label="Forward" iconName="Forward" />
</DefaultButton>
</Stack>
<Stack style={{ marginTop: 30, display: "flex" }}>
<Stack horizontal verticalAlign="center">
<Image style={{ width: 25, height: 25 }} src={IntermediatePrompts} />
<Text style={{ fontSize: 14, fontWeight: 600 }}>Intermediate Prompts</Text>
</Stack>
</Stack>
<Stack horizontal style={{ gap: 35 }}>
<DefaultButton
style={{ width: 352, height: 135, background: "#F6F6F7" }}
onClick={() => updateTextBox(SampleUserInputs[2])}
>
<Text style={{ height: 80, fontSize: 13 }}>{SampleUserInputs[2]}</Text>
<FontIcon style={{ position: "absolute", left: "92.61%" }} aria-label="Forward" iconName="Forward" />
</DefaultButton>
<DefaultButton
style={{ width: 352, height: 135, background: "#F6F6F7" }}
onClick={() => updateTextBox(SampleUserInputs[3])}
>
<Text style={{ height: 80, fontSize: 13 }}>{SampleUserInputs[3]}</Text>
<FontIcon style={{ position: "absolute", left: "92.61%" }} aria-label="Forward" iconName="Forward" />
</DefaultButton>
</Stack>
<Stack style={{ marginTop: 30, display: "flex" }}>
<Stack horizontal verticalAlign="center">
<Image style={{ width: 25, height: 25 }} src={ComplexPrompts} />
<Text style={{ fontSize: 14, fontWeight: 600 }}>Complex Prompts</Text>
</Stack>
</Stack>
<Stack horizontal style={{ gap: 35 }}>
<DefaultButton
style={{ width: 352, height: 135, background: "#F6F6F7" }}
onClick={() => updateTextBox(SampleUserInputs[4])}
>
<Text style={{ height: 80, fontSize: 13 }}>{SampleUserInputs[4]}</Text>
<FontIcon style={{ position: "absolute", left: "92.61%" }} aria-label="Forward" iconName="Forward" />
</DefaultButton>
<DefaultButton
style={{ width: 352, height: 135, background: "#F6F6F7" }}
onClick={() => updateTextBox(SampleUserInputs[5])}
>
<Text style={{ height: 80, fontSize: 13 }}>{SampleUserInputs[5]}</Text>
<FontIcon style={{ position: "absolute", left: "92.61%" }} aria-label="Forward" iconName="Forward" />
</DefaultButton>
</Stack>
</Stack>
</Modal>
);
};

View File

@ -0,0 +1,781 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Sample Prompts snapshot test should render properly if isSamplePromptsOpen is false 1`] = `
<Modal
isOpen={false}
>
<Stack
aria-modal="true"
role="dialog"
style={
Object {
"maxHeight": "calc(100vh - 120px)",
"overflowY": "auto",
"padding": "16px 24px",
}
}
>
<Stack>
<Stack
horizontal={true}
style={
Object {
"display": "flex",
"justifyContent": "space-between",
}
}
>
<Text
style={
Object {
"fontSize": 24,
"fontWeight": 600,
}
}
>
Sample Prompts
</Text>
<CustomizedIconButton
iconProps={
Object {
"iconName": "Cancel",
}
}
onClick={[Function]}
styles={
Object {
"root": Object {
"backgroundColor": "transparent",
"border": "none",
"padding": 0,
"selectors": Object {
"&:focus": Object {
"outline": "none",
},
"&:hover": Object {
"backgroundColor": "transparent",
"color": "#000",
},
},
},
}
}
/>
</Stack>
<Text
style={
Object {
"fontSize": 13,
"fontWeight": 400,
"marginTop": 10,
}
}
>
Here are some sample prompts for writing queries in NoSQL, ranging from simple to complex
</Text>
</Stack>
<Stack
style={
Object {
"display": "flex",
"marginTop": 30,
}
}
>
<Stack
horizontal={true}
verticalAlign="center"
>
<Image
src=""
style={
Object {
"height": 25,
"width": 25,
}
}
/>
<Text
style={
Object {
"fontSize": 14,
"fontWeight": 600,
}
}
>
Simple Prompts
</Text>
</Stack>
</Stack>
<Stack
horizontal={true}
style={
Object {
"gap": 35,
}
}
>
<CustomizedDefaultButton
onClick={[Function]}
style={
Object {
"background": "#F6F6F7",
"height": 135,
"width": 352,
}
}
>
<Text
style={
Object {
"fontSize": 13,
"height": 80,
}
}
>
Show me products less than 100 dolars
</Text>
<FontIcon
aria-label="Forward"
iconName="Forward"
style={
Object {
"left": "92.61%",
"position": "absolute",
}
}
/>
</CustomizedDefaultButton>
<CustomizedDefaultButton
onClick={[Function]}
style={
Object {
"background": "#F6F6F7",
"height": 135,
"width": 352,
}
}
>
<Text
style={
Object {
"fontSize": 13,
"height": 80,
}
}
>
Show schema
</Text>
<FontIcon
aria-label="Forward"
iconName="Forward"
style={
Object {
"left": "92.61%",
"position": "absolute",
}
}
/>
</CustomizedDefaultButton>
</Stack>
<Stack
style={
Object {
"display": "flex",
"marginTop": 30,
}
}
>
<Stack
horizontal={true}
verticalAlign="center"
>
<Image
src=""
style={
Object {
"height": 25,
"width": 25,
}
}
/>
<Text
style={
Object {
"fontSize": 14,
"fontWeight": 600,
}
}
>
Intermediate Prompts
</Text>
</Stack>
</Stack>
<Stack
horizontal={true}
style={
Object {
"gap": 35,
}
}
>
<CustomizedDefaultButton
onClick={[Function]}
style={
Object {
"background": "#F6F6F7",
"height": 135,
"width": 352,
}
}
>
<Text
style={
Object {
"fontSize": 13,
"height": 80,
}
}
>
Show items with a description that contains a number between 0 and 99 inclusive.
</Text>
<FontIcon
aria-label="Forward"
iconName="Forward"
style={
Object {
"left": "92.61%",
"position": "absolute",
}
}
/>
</CustomizedDefaultButton>
<CustomizedDefaultButton
onClick={[Function]}
style={
Object {
"background": "#F6F6F7",
"height": 135,
"width": 352,
}
}
>
<Text
style={
Object {
"fontSize": 13,
"height": 80,
}
}
>
Write a query to return all records in this table created in the last thirty days
</Text>
<FontIcon
aria-label="Forward"
iconName="Forward"
style={
Object {
"left": "92.61%",
"position": "absolute",
}
}
/>
</CustomizedDefaultButton>
</Stack>
<Stack
style={
Object {
"display": "flex",
"marginTop": 30,
}
}
>
<Stack
horizontal={true}
verticalAlign="center"
>
<Image
src=""
style={
Object {
"height": 25,
"width": 25,
}
}
/>
<Text
style={
Object {
"fontSize": 14,
"fontWeight": 600,
}
}
>
Complex Prompts
</Text>
</Stack>
</Stack>
<Stack
horizontal={true}
style={
Object {
"gap": 35,
}
}
>
<CustomizedDefaultButton
onClick={[Function]}
style={
Object {
"background": "#F6F6F7",
"height": 135,
"width": 352,
}
}
>
<Text
style={
Object {
"fontSize": 13,
"height": 80,
}
}
>
Show all the products that customer Bob has reviewed.
</Text>
<FontIcon
aria-label="Forward"
iconName="Forward"
style={
Object {
"left": "92.61%",
"position": "absolute",
}
}
/>
</CustomizedDefaultButton>
<CustomizedDefaultButton
onClick={[Function]}
style={
Object {
"background": "#F6F6F7",
"height": 135,
"width": 352,
}
}
>
<Text
style={
Object {
"fontSize": 13,
"height": 80,
}
}
>
Which computers are more than 300 dollars and less than 400 dollars?
</Text>
<FontIcon
aria-label="Forward"
iconName="Forward"
style={
Object {
"left": "92.61%",
"position": "absolute",
}
}
/>
</CustomizedDefaultButton>
</Stack>
</Stack>
</Modal>
`;
exports[`Sample Prompts snapshot test should render properly if isSamplePromptsOpen is true 1`] = `
<Modal
isOpen={true}
>
<Stack
aria-modal="true"
role="dialog"
style={
Object {
"maxHeight": "calc(100vh - 120px)",
"overflowY": "auto",
"padding": "16px 24px",
}
}
>
<Stack>
<Stack
horizontal={true}
style={
Object {
"display": "flex",
"justifyContent": "space-between",
}
}
>
<Text
style={
Object {
"fontSize": 24,
"fontWeight": 600,
}
}
>
Sample Prompts
</Text>
<CustomizedIconButton
iconProps={
Object {
"iconName": "Cancel",
}
}
onClick={[Function]}
styles={
Object {
"root": Object {
"backgroundColor": "transparent",
"border": "none",
"padding": 0,
"selectors": Object {
"&:focus": Object {
"outline": "none",
},
"&:hover": Object {
"backgroundColor": "transparent",
"color": "#000",
},
},
},
}
}
/>
</Stack>
<Text
style={
Object {
"fontSize": 13,
"fontWeight": 400,
"marginTop": 10,
}
}
>
Here are some sample prompts for writing queries in NoSQL, ranging from simple to complex
</Text>
</Stack>
<Stack
style={
Object {
"display": "flex",
"marginTop": 30,
}
}
>
<Stack
horizontal={true}
verticalAlign="center"
>
<Image
src=""
style={
Object {
"height": 25,
"width": 25,
}
}
/>
<Text
style={
Object {
"fontSize": 14,
"fontWeight": 600,
}
}
>
Simple Prompts
</Text>
</Stack>
</Stack>
<Stack
horizontal={true}
style={
Object {
"gap": 35,
}
}
>
<CustomizedDefaultButton
onClick={[Function]}
style={
Object {
"background": "#F6F6F7",
"height": 135,
"width": 352,
}
}
>
<Text
style={
Object {
"fontSize": 13,
"height": 80,
}
}
>
Show me products less than 100 dolars
</Text>
<FontIcon
aria-label="Forward"
iconName="Forward"
style={
Object {
"left": "92.61%",
"position": "absolute",
}
}
/>
</CustomizedDefaultButton>
<CustomizedDefaultButton
onClick={[Function]}
style={
Object {
"background": "#F6F6F7",
"height": 135,
"width": 352,
}
}
>
<Text
style={
Object {
"fontSize": 13,
"height": 80,
}
}
>
Show schema
</Text>
<FontIcon
aria-label="Forward"
iconName="Forward"
style={
Object {
"left": "92.61%",
"position": "absolute",
}
}
/>
</CustomizedDefaultButton>
</Stack>
<Stack
style={
Object {
"display": "flex",
"marginTop": 30,
}
}
>
<Stack
horizontal={true}
verticalAlign="center"
>
<Image
src=""
style={
Object {
"height": 25,
"width": 25,
}
}
/>
<Text
style={
Object {
"fontSize": 14,
"fontWeight": 600,
}
}
>
Intermediate Prompts
</Text>
</Stack>
</Stack>
<Stack
horizontal={true}
style={
Object {
"gap": 35,
}
}
>
<CustomizedDefaultButton
onClick={[Function]}
style={
Object {
"background": "#F6F6F7",
"height": 135,
"width": 352,
}
}
>
<Text
style={
Object {
"fontSize": 13,
"height": 80,
}
}
>
Show items with a description that contains a number between 0 and 99 inclusive.
</Text>
<FontIcon
aria-label="Forward"
iconName="Forward"
style={
Object {
"left": "92.61%",
"position": "absolute",
}
}
/>
</CustomizedDefaultButton>
<CustomizedDefaultButton
onClick={[Function]}
style={
Object {
"background": "#F6F6F7",
"height": 135,
"width": 352,
}
}
>
<Text
style={
Object {
"fontSize": 13,
"height": 80,
}
}
>
Write a query to return all records in this table created in the last thirty days
</Text>
<FontIcon
aria-label="Forward"
iconName="Forward"
style={
Object {
"left": "92.61%",
"position": "absolute",
}
}
/>
</CustomizedDefaultButton>
</Stack>
<Stack
style={
Object {
"display": "flex",
"marginTop": 30,
}
}
>
<Stack
horizontal={true}
verticalAlign="center"
>
<Image
src=""
style={
Object {
"height": 25,
"width": 25,
}
}
/>
<Text
style={
Object {
"fontSize": 14,
"fontWeight": 600,
}
}
>
Complex Prompts
</Text>
</Stack>
</Stack>
<Stack
horizontal={true}
style={
Object {
"gap": 35,
}
}
>
<CustomizedDefaultButton
onClick={[Function]}
style={
Object {
"background": "#F6F6F7",
"height": 135,
"width": 352,
}
}
>
<Text
style={
Object {
"fontSize": 13,
"height": 80,
}
}
>
Show all the products that customer Bob has reviewed.
</Text>
<FontIcon
aria-label="Forward"
iconName="Forward"
style={
Object {
"left": "92.61%",
"position": "absolute",
}
}
/>
</CustomizedDefaultButton>
<CustomizedDefaultButton
onClick={[Function]}
style={
Object {
"background": "#F6F6F7",
"height": 135,
"width": 352,
}
}
>
<Text
style={
Object {
"fontSize": 13,
"height": 80,
}
}
>
Which computers are more than 300 dollars and less than 400 dollars?
</Text>
<FontIcon
aria-label="Forward"
iconName="Forward"
style={
Object {
"left": "92.61%",
"position": "absolute",
}
}
/>
</CustomizedDefaultButton>
</Stack>
</Stack>
</Modal>
`;

View File

@ -92,97 +92,6 @@ exports[`Query copilot tab snapshot test should render with initial input 1`] =
Read preview terms
</StyledLinkBase>
</Text>
<Stack
horizontal={true}
style={
Object {
"backgroundColor": "#FFF8F0",
"padding": "2px 8px",
}
}
verticalAlign="center"
>
<Text
style={
Object {
"fontSize": 12,
"fontWeight": 600,
}
}
>
Provide feedback on the query generated
</Text>
<CustomizedIconButton
iconProps={
Object {
"iconName": "Like",
}
}
id="likeBtn"
onClick={[Function]}
style={
Object {
"marginLeft": 20,
}
}
/>
<CustomizedIconButton
iconProps={
Object {
"iconName": "Dislike",
}
}
onClick={[Function]}
style={
Object {
"margin": "0 10px",
}
}
/>
<Separator
styles={
Object {
"root": Object {
"selectors": Object {
"::before": Object {
"background": "#E1DFDD",
},
},
},
}
}
vertical={true}
/>
<CustomizedCommandBarButton
iconProps={
Object {
"iconName": "Copy",
}
}
style={
Object {
"backgroundColor": "#FFF8F0",
"margin": "0 10px",
}
}
>
Copy code
</CustomizedCommandBarButton>
<CustomizedCommandBarButton
iconProps={
Object {
"iconName": "Delete",
}
}
style={
Object {
"backgroundColor": "#FFF8F0",
}
}
>
Delete code
</CustomizedCommandBarButton>
</Stack>
<Stack
className="tabPaneContentContainer"
>
@ -215,5 +124,9 @@ exports[`Query copilot tab snapshot test should render with initial input 1`] =
/>
</t>
</Stack>
<CopyPopup
setShowCopyPopup={[Function]}
showCopyPopup={false}
/>
</Stack>
`;

View File

@ -23,10 +23,10 @@ import { ReactTabKind, useTabs } from "hooks/useTabs";
import * as React from "react";
import ConnectIcon from "../../../images/Connect_color.svg";
import ContainersIcon from "../../../images/Containers.svg";
import CopilotIcon from "../../../images/Copilot.svg";
import LinkIcon from "../../../images/Link_blue.svg";
import NotebookColorIcon from "../../../images/Notebooks.svg";
import PowerShellIcon from "../../../images/PowerShell.svg";
import CopilotIcon from "../../../images/QueryCopilotNewLogo.svg";
import QuickStartIcon from "../../../images/Quickstart_Lightning.svg";
import NotebookIcon from "../../../images/notebook/Notebook-resource.svg";
import CollectionIcon from "../../../images/tree-collection.svg";