Skip to content

Commit 71a9965

Browse files
feedback form added (#42)
1 parent eba6735 commit 71a9965

File tree

4 files changed

+160
-84
lines changed

4 files changed

+160
-84
lines changed

package-lock.json

+7-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+86-75
Original file line numberDiff line numberDiff line change
@@ -16,79 +16,79 @@
1616
],
1717
"license": "MIT",
1818
"preferences": [
19-
{
20-
"name": "preferredEditor",
21-
"title": "Default Workspace Editor",
22-
"description": "Choose your Preferred editor for Gitpod",
23-
"type": "dropdown",
24-
"data": [
25-
{
26-
"title": "VS Code Browser",
27-
"value": "code"
28-
},
29-
{
30-
"title": "VS Code Desktop",
31-
"value": "code-desktop"
32-
},
33-
{
34-
"title": "IntelliJ",
35-
"value": "intellij"
36-
},
37-
{
38-
"title": "GoLand",
39-
"value": "goland"
40-
},
41-
{
42-
"title": "PhpStorm",
43-
"value": "phpstorm"
44-
},
45-
{
46-
"title": "PyCharm",
47-
"value": "pycharm"
48-
},
49-
{
50-
"title": "RubyMine",
51-
"value": "rubymine"
52-
},
53-
{
54-
"title": "WebStorm",
55-
"value": "webstorm"
56-
},
57-
{
58-
"title": "Rider",
59-
"value": "rider"
60-
},
61-
{
62-
"title": "CLion",
63-
"value": "clion"
64-
}
65-
],
66-
"required": true
67-
},
68-
{
69-
"name": "useLatest",
70-
"label": "Latest Release (Unstable)",
71-
"description": "Use the latest version for each editor. Insiders for VS Code, EAP for JetBrains IDEs.",
72-
"type": "checkbox",
73-
"required": true
74-
},
75-
{
76-
"name": "preferredEditorClass",
77-
"title": "Default Workspace Class",
78-
"description": "Up to 4 cores, 8GB RAM, 30GB storage in Standard and Up to 8 cores, 16GB RAM, 50GB storage in Large",
79-
"type": "dropdown",
80-
"data": [
81-
{
82-
"title": "Standard",
83-
"value": "g1-standard"
84-
},
85-
{
86-
"title": "Large",
87-
"value": "g1-large"
88-
}
89-
],
90-
"required": true
91-
},
19+
{
20+
"name": "preferredEditor",
21+
"title": "Default Workspace Editor",
22+
"description": "Choose your Preferred editor for Gitpod",
23+
"type": "dropdown",
24+
"data": [
25+
{
26+
"title": "VS Code Browser",
27+
"value": "code"
28+
},
29+
{
30+
"title": "VS Code Desktop",
31+
"value": "code-desktop"
32+
},
33+
{
34+
"title": "IntelliJ",
35+
"value": "intellij"
36+
},
37+
{
38+
"title": "GoLand",
39+
"value": "goland"
40+
},
41+
{
42+
"title": "PhpStorm",
43+
"value": "phpstorm"
44+
},
45+
{
46+
"title": "PyCharm",
47+
"value": "pycharm"
48+
},
49+
{
50+
"title": "RubyMine",
51+
"value": "rubymine"
52+
},
53+
{
54+
"title": "WebStorm",
55+
"value": "webstorm"
56+
},
57+
{
58+
"title": "Rider",
59+
"value": "rider"
60+
},
61+
{
62+
"title": "CLion",
63+
"value": "clion"
64+
}
65+
],
66+
"required": true
67+
},
68+
{
69+
"name": "useLatest",
70+
"label": "Latest Release (Unstable)",
71+
"description": "Use the latest version for each editor. Insiders for VS Code, EAP for JetBrains IDEs.",
72+
"type": "checkbox",
73+
"required": true
74+
},
75+
{
76+
"name": "preferredEditorClass",
77+
"title": "Default Workspace Class",
78+
"description": "Up to 4 cores, 8GB RAM, 30GB storage in Standard and Up to 8 cores, 16GB RAM, 50GB storage in Large",
79+
"type": "dropdown",
80+
"data": [
81+
{
82+
"title": "Standard",
83+
"value": "g1-standard"
84+
},
85+
{
86+
"title": "Large",
87+
"value": "g1-large"
88+
}
89+
],
90+
"required": true
91+
},
9292
{
9393
"name": "gitpodUrl",
9494
"title": "Gitpod's URL Endpoint",
@@ -97,7 +97,7 @@
9797
"type": "textfield",
9898
"required": false
9999
}
100-
],
100+
],
101101
"commands": [
102102
{
103103
"name": "open_in_gitpod",
@@ -123,6 +123,18 @@
123123
"template"
124124
]
125125
},
126+
{
127+
"name": "feedback_form",
128+
"title": "Feedback",
129+
"subtitle": "Gitpod Templates (Beta)",
130+
"description": "We'd love your valuable feedback",
131+
"mode": "view",
132+
"keywords": [
133+
"gitpod",
134+
"gp",
135+
"feedback"
136+
]
137+
},
126138
{
127139
"name": "gitpod_dashboard",
128140
"title": "List Gitpod Workspaces",
@@ -138,7 +150,6 @@
138150
"type": "password",
139151
"required": true
140152
}
141-
]
142153
},
143154
{
144155
"name": "menubar",

src/feedback_form.tsx

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
import {
2+
ActionPanel,
3+
Form,
4+
Action,
5+
} from "@raycast/api";
6+
import fetch from "node-fetch";
7+
8+
import View from "./components/View";
9+
10+
function FeedbackForm() {
11+
return (
12+
<Form
13+
navigationTitle={`Feedback Form for Gitpod Extension(Beta)`}
14+
actions={
15+
<ActionPanel>
16+
<Action.SubmitForm title="Submit Feedback"
17+
onSubmit={async (values) => {
18+
console.log(values)
19+
const res = await fetch(`https://raycast-extension-feedback.vercel.app/api-v1`, {
20+
method: "POST",
21+
headers: { 'Content-Type': 'application/json' },
22+
body: JSON.stringify({...values,tags:values.tags.join(",")})
23+
})
24+
const data = await res.json();
25+
console.log("resp",data)
26+
}} />
27+
</ActionPanel>
28+
}
29+
>
30+
<Form.Dropdown id="command" title="Command" defaultValue="Open in Gitpod">
31+
<Form.Dropdown.Item value="Open in Gitpod" title="Open in Gitpod" />
32+
<Form.Dropdown.Item value="Open Workspaces" title="Open Workspaces" />
33+
<Form.Dropdown.Item value="Find Gitpod Templates" title="Find Gitpod Templates" />
34+
<Form.Dropdown.Item value="New Feature Request" title="New Feature" />
35+
</Form.Dropdown>
36+
<Form.TextField title="Title of Issue" id="title" placeholder="Any issue you've been facing..." />
37+
<Form.TextArea enableMarkdown={true} title="Description" id="comment" placeholder={"Issue/Feature in brief (markdown supported)"} />
38+
<Form.Dropdown id="type" title="Type" defaultValue="Issue">
39+
<Form.Dropdown.Item value="Issue" title="Issue" />
40+
<Form.Dropdown.Item value="Feature Request" title="Feature Request" />
41+
</Form.Dropdown>
42+
<Form.TagPicker id="tags" title="Tags" defaultValue={["bug", "github"]}>
43+
<Form.TagPicker.Item value="bug" title="bug" icon="🐞" />
44+
<Form.TagPicker.Item value="convenience" title="convenience" icon={"🏪"} />
45+
<Form.TagPicker.Item value="question" title="question" icon="❓" />
46+
<Form.TagPicker.Item value="documentation" title="documentation" icon="📚" />
47+
<Form.TagPicker.Item value="enhancement" title="enhancement" icon="📈" />
48+
<Form.TagPicker.Item value="github" title="github" icon="🎓" />
49+
</Form.TagPicker>
50+
</Form>
51+
)
52+
}
53+
54+
55+
export default function Command() {
56+
return (
57+
<View>
58+
<FeedbackForm />
59+
</View>
60+
);
61+
}
62+

src/open_repo_context.tsx

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { List, Cache, Toast, showToast } from "@raycast/api";
1+
import { List, Cache, Toast, showToast, LocalStorage } from "@raycast/api";
22
import { usePromise } from "@raycast/utils";
33
import { useEffect, useState } from "react";
44

@@ -94,8 +94,10 @@ function SearchContext({ repository }: SearchContextProps) {
9494
result.branches = branches;
9595
}
9696

97-
if (n == 2) {
98-
cache.set(repository.nameWithOwner, JSON.stringify(result));
97+
if (n == 2) {
98+
if (!cache.has(repository.nameWithOwner)){
99+
cache.set(repository.nameWithOwner, JSON.stringify(result));
100+
}
99101
}
100102

101103
return result;

0 commit comments

Comments
 (0)