Michelle Lam commited on
Commit
b5e7dfa
1 Parent(s): 9a85cb5

Adds Feedback button, adds status icons to Save button

Browse files
indie_label_svelte/package-lock.json CHANGED
The diff for this file is too large to render. See raw diff
 
indie_label_svelte/package.json CHANGED
@@ -25,7 +25,7 @@
25
  "@smui/checkbox": "^6.0.0-beta.2",
26
  "@smui/chips": "^6.0.0-beta.2",
27
  "@smui/circular-progress": "^6.0.0-beta.4",
28
- "@smui/common": "^6.0.0-beta.2",
29
  "@smui/data-table": "^6.0.0-beta.2",
30
  "@smui/drawer": "^6.0.0-beta.4",
31
  "@smui/form-field": "^6.0.0-beta.2",
 
25
  "@smui/checkbox": "^6.0.0-beta.2",
26
  "@smui/chips": "^6.0.0-beta.2",
27
  "@smui/circular-progress": "^6.0.0-beta.4",
28
+ "@smui/common": "^6.1.4",
29
  "@smui/data-table": "^6.0.0-beta.2",
30
  "@smui/drawer": "^6.0.0-beta.4",
31
  "@smui/form-field": "^6.0.0-beta.2",
indie_label_svelte/public/global.css CHANGED
@@ -54,6 +54,12 @@ input, button, select, textarea {
54
  border-radius: 2px;
55
  }
56
 
 
 
 
 
 
 
57
  input:disabled {
58
  color: #ccc;
59
  }
 
54
  border-radius: 2px;
55
  }
56
 
57
+ a {
58
+ -webkit-padding: 0.4em 0;
59
+ padding: 0.4em;
60
+ margin: 0 0 0.5em 0;
61
+ }
62
+
63
  input:disabled {
64
  color: #ccc;
65
  }
indie_label_svelte/src/HypothesisPanel.svelte CHANGED
@@ -1,5 +1,6 @@
1
  <script lang="ts">
2
  import { onMount } from "svelte";
 
3
  import ClusterResults from "./ClusterResults.svelte";
4
  import SubmitReportDialog from "./SubmitReportDialog.svelte";
5
 
@@ -23,6 +24,7 @@
23
  import Checkbox from '@smui/checkbox';
24
  import FormField from '@smui/form-field';
25
  import IconButton from "@smui/icon-button";
 
26
  import Radio from '@smui/radio';
27
 
28
  export let model;
@@ -52,6 +54,7 @@
52
  let editErrorType = false;
53
  let unfinished_count = 0;
54
  let has_complete_report = false;
 
55
 
56
  function setActive(value: string) {
57
  selected = value;
@@ -132,7 +135,11 @@
132
 
133
  let promise_save = Promise.resolve(null);
134
  function handleSaveReport() {
 
135
  promise_save = saveReport();
 
 
 
136
  }
137
 
138
  async function saveReport() {
@@ -485,6 +492,7 @@
485
 
486
  <div class="panel_footer">
487
  <div class="panel_footer_contents">
 
488
  <Button
489
  on:click={handleNewReport}
490
  variant="outlined"
@@ -494,6 +502,7 @@
494
  <Label>New</Label>
495
  </Button>
496
 
 
497
  <!-- <Button
498
  on:click={handleDeleteReport}
499
  variant="outlined"
@@ -503,14 +512,29 @@
503
  <Label>Delete</Label>
504
  </Button> -->
505
 
 
506
  <Button
507
  on:click={handleSaveReport}
508
  variant="outlined"
509
  color="secondary"
510
  >
511
- <Label>Save</Label>
 
 
 
 
 
 
 
 
 
 
 
 
 
512
  </Button>
513
 
 
514
  {#key has_complete_report}
515
  <Button
516
  on:click={handleSubmitReport}
@@ -522,22 +546,19 @@
522
  </Button>
523
  {/key}
524
 
 
 
 
 
 
 
 
 
 
 
 
 
525
 
526
- <div>
527
- <span style="color: grey"><i>Last saved:
528
- {#await promise_save}
529
- <CircularProgress style="height: 32px; width: 32px;" indeterminate />
530
- {:then result}
531
- {#if result}
532
- {new Date().toLocaleTimeString()}
533
- {:else}
534
-
535
- {/if}
536
- {:catch error}
537
- <p style="color: red">{error.message}</p>
538
- {/await}
539
- </i></span>
540
- </div>
541
  </div>
542
  </div>
543
  {/if}
 
1
  <script lang="ts">
2
  import { onMount } from "svelte";
3
+ import { fade } from 'svelte/transition';
4
  import ClusterResults from "./ClusterResults.svelte";
5
  import SubmitReportDialog from "./SubmitReportDialog.svelte";
6
 
 
24
  import Checkbox from '@smui/checkbox';
25
  import FormField from '@smui/form-field';
26
  import IconButton from "@smui/icon-button";
27
+ import { Icon } from "@smui/common";
28
  import Radio from '@smui/radio';
29
 
30
  export let model;
 
54
  let editErrorType = false;
55
  let unfinished_count = 0;
56
  let has_complete_report = false;
57
+ let save_check_visible = false; // Whether the save checkmark is visible
58
 
59
  function setActive(value: string) {
60
  selected = value;
 
135
 
136
  let promise_save = Promise.resolve(null);
137
  function handleSaveReport() {
138
+ // Briefly display checkmark
139
  promise_save = saveReport();
140
+ save_check_visible = true;
141
+ // Hide save checkmark after 1 second
142
+ setTimeout(() => save_check_visible = false, 1000);
143
  }
144
 
145
  async function saveReport() {
 
492
 
493
  <div class="panel_footer">
494
  <div class="panel_footer_contents">
495
+ <!-- New button -->
496
  <Button
497
  on:click={handleNewReport}
498
  variant="outlined"
 
502
  <Label>New</Label>
503
  </Button>
504
 
505
+ <!-- Delete button -->
506
  <!-- <Button
507
  on:click={handleDeleteReport}
508
  variant="outlined"
 
512
  <Label>Delete</Label>
513
  </Button> -->
514
 
515
+ <!-- Save button -->
516
  <Button
517
  on:click={handleSaveReport}
518
  variant="outlined"
519
  color="secondary"
520
  >
521
+ <Label>
522
+ {#await promise_save}
523
+ <CircularProgress style="height: 13.5px; width: 13.5px;" indeterminate />
524
+ {:then result}
525
+ {#if result && save_check_visible}
526
+ <span transition:fade>
527
+ <Icon class="material-icons">check</Icon>
528
+ </span>
529
+ {/if}
530
+ {:catch error}
531
+ <span style="color: red">{error.message}</span>
532
+ {/await}
533
+ Save
534
+ </Label>
535
  </Button>
536
 
537
+ <!-- Send to Avid button -->
538
  {#key has_complete_report}
539
  <Button
540
  on:click={handleSubmitReport}
 
546
  </Button>
547
  {/key}
548
 
549
+ <!-- Feedback button -->
550
+ <Button
551
+ href="https://forms.gle/vDXchpbBFjDeKjJA6"
552
+ target="_blank"
553
+ variant="outlined"
554
+ color="secondary"
555
+ >
556
+ <Label>
557
+ <Icon class="material-icons">feedback_outline</Icon>
558
+ Feedback
559
+ </Label>
560
+ </Button>
561
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
562
  </div>
563
  </div>
564
  {/if}