forked from podman-desktop/podman-desktop
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Allows to provide feedback from the tool itself (podman-desktop…
…#1078) fixes podman-desktop#1028 Change-Id: I230db5a705b34cf87d220d0b511d40e81b156130 Signed-off-by: Florent Benoit <[email protected]> Signed-off-by: Florent Benoit <[email protected]>
- Loading branch information
Showing
7 changed files
with
185 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,7 @@ | |
transform: translate(-50%, -50%); | ||
padding: 1em; | ||
border-radius: 0.2em; | ||
z-index: 50; | ||
} | ||
button { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
<script lang="ts"> | ||
import { faFrown, faGrinStars, faMeh, faSmile } from '@fortawesome/free-solid-svg-icons'; | ||
import Fa from 'svelte-fa/src/fa.svelte'; | ||
import Modal from '../dialogs/Modal.svelte'; | ||
import type { FeedbackProperties } from '../../../../preload/src/index'; | ||
let displayModal = false; | ||
// feedback of the user | ||
let smileyRating = 0; | ||
let tellUsWhyFeedback = ''; | ||
let contactInformation = ''; | ||
window.events?.receive('display-feedback', () => { | ||
displayModal = true; | ||
}); | ||
function hideModal(): void { | ||
displayModal = false; | ||
// reset fields | ||
smileyRating = 0; | ||
tellUsWhyFeedback = ''; | ||
contactInformation = ''; | ||
} | ||
function selectSmiley(item: number): void { | ||
smileyRating = item; | ||
} | ||
async function sendFeedback(): Promise<void> { | ||
const properties: FeedbackProperties = { | ||
rating: smileyRating, | ||
}; | ||
if (tellUsWhyFeedback) { | ||
properties.comment = tellUsWhyFeedback; | ||
} | ||
if (contactInformation) { | ||
properties.contact = contactInformation; | ||
} | ||
// send | ||
await window.sendFeedback(properties); | ||
// close the modal | ||
hideModal(); | ||
} | ||
</script> | ||
|
||
{#if displayModal} | ||
<Modal on:close="{() => hideModal()}"> | ||
<div | ||
class="inline-block w-full overflow-hidden text-left transition-all transform bg-zinc-800 z-50 rounded-xl shadow-xl shadow-neutral-900"> | ||
<div class="flex items-center justify-between bg-black px-5 py-4 border-b-2 border-violet-700"> | ||
<h1 class="text-xl font-bold">Share your feedback</h1> | ||
|
||
<button class="hover:text-gray-200 px-2 py-1" on:click="{() => hideModal()}"> | ||
<i class="fas fa-times" aria-hidden="true"></i> | ||
</button> | ||
</div> | ||
|
||
<div class="overflow-y-auto p-4"> | ||
<label for="smiley" class="block mb-2 text-sm font-medium text-gray-300 dark:text-gray-300" | ||
>How was your experience with Podman Desktop ?</label> | ||
<div class="flex space-x-4"> | ||
<div on:click="{() => selectSmiley(1)}"> | ||
<Fa | ||
size="24" | ||
class="cursor-pointer {smileyRating === 1 ? 'text-violet-400' : 'text-gray-500'}" | ||
icon="{faFrown}" /> | ||
</div> | ||
<div on:click="{() => selectSmiley(2)}"> | ||
<Fa | ||
size="24" | ||
class="cursor-pointer {smileyRating === 2 ? 'text-violet-400' : 'text-gray-500'}" | ||
icon="{faMeh}" /> | ||
</div> | ||
<div on:click="{() => selectSmiley(3)}"> | ||
<Fa | ||
size="24" | ||
class="cursor-pointer {smileyRating === 3 ? 'text-violet-400' : 'text-gray-500'}" | ||
icon="{faSmile}" /> | ||
</div> | ||
<div on:click="{() => selectSmiley(4)}"> | ||
<Fa | ||
size="24" | ||
class="cursor-pointer {smileyRating === 4 ? 'text-violet-400' : 'text-gray-500'}" | ||
icon="{faGrinStars}" /> | ||
</div> | ||
</div> | ||
|
||
<label for="tellUsWhyFeedback" class="block mt-4 mb-2 text-sm font-medium text-gray-300 dark:text-gray-300" | ||
>Tell us why, or share any suggestion or issue to improve your experience: ({1000 - tellUsWhyFeedback.length} characters | ||
left)</label> | ||
<textarea | ||
type="text" | ||
rows="4" | ||
maxlength="1000" | ||
name="tellUsWhyFeedback" | ||
id="tellUsWhyFeedback" | ||
bind:value="{tellUsWhyFeedback}" | ||
placeholder="Leave blank to generate a name" | ||
class="w-full p-2 outline-none text-sm bg-zinc-900 rounded-sm text-gray-400 placeholder-gray-400"></textarea> | ||
|
||
<label for="contactInformation" class="block mt-4 mb-2 text-sm font-medium text-gray-300 dark:text-gray-300" | ||
>Share your contact information if you'd like us to answer you:</label> | ||
<input | ||
type="text" | ||
name="contactInformation" | ||
id="contactInformation" | ||
bind:value="{contactInformation}" | ||
placeholder="Enter email address, phone number or leave blank for anonymous feedback" | ||
class="w-full p-2 outline-none text-sm bg-zinc-900 rounded-sm text-gray-400 placeholder-gray-400" /> | ||
|
||
<div class="pt-5 flex flex-row justify-end"> | ||
<button | ||
disabled="{smileyRating === 0}" | ||
class="pf-c-button pf-m-primary" | ||
type="button" | ||
on:click="{() => sendFeedback()}">Send feedback</button> | ||
</div> | ||
</div> | ||
</div> | ||
</Modal> | ||
{/if} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters