Commit fcd1709 1 parent ac59c73 commit fcd1709 Copy full SHA for fcd1709
File tree 7 files changed +73
-57
lines changed
7 files changed +73
-57
lines changed Original file line number Diff line number Diff line change
1
+ <div class =" box" >
2
+ {{ #if this.decryptionFailed }}
3
+ <h2 data-test-error-type =" decryption-failed" >
4
+ {{ t " error.poll.decryptionFailed.title" }}
5
+ </h2 >
6
+ <p >
7
+ {{ t " error.poll.decryptionFailed.description" }}
8
+ </p >
9
+ {{ else if this.notFound}}
10
+ <h2 data-test-error-type =" not-found" >
11
+ {{ t " error.poll.notFound.title" }}
12
+ </h2 >
13
+ <p >
14
+ {{ t " error.poll.notFound.description" }}
15
+ </p >
16
+ <ul >
17
+ <li >
18
+ {{ t " error.poll.notFound.reasons.expired" }}
19
+ </li >
20
+ <li >
21
+ {{ t " error.poll.notFound.reasons.typo" }}
22
+ </li >
23
+ </ul >
24
+ {{ else }}
25
+ <h2 data-test-error-type =" unexpected" >
26
+ {{ t " error.generic.unexpected.title" }}
27
+ </h2 >
28
+ <p >
29
+ {{ t " error.generic.unexpected.description" }}
30
+ </p >
31
+ {{ /if }}
32
+ </div >
Original file line number Diff line number Diff line change
1
+ import Component from '@glimmer/component' ;
2
+ import sjcl from 'sjcl' ;
3
+ import { NotFoundError } from '../utils/api' ;
4
+
5
+ export interface PollErrorSignature {
6
+ // The arguments accepted by the component
7
+ Args : {
8
+ error : unknown ;
9
+ } ;
10
+ // Any blocks yielded by the component
11
+ Blocks : {
12
+ default : [ ] ;
13
+ } ;
14
+ // The element to which `...attributes` is applied in the component template
15
+ Element : null ;
16
+ }
17
+
18
+ export default class PollError extends Component < PollErrorSignature > {
19
+ get decryptionFailed ( ) {
20
+ const { error } = this . args ;
21
+
22
+ return error instanceof sjcl . exception . corrupt ;
23
+ }
24
+
25
+ get notFound ( ) {
26
+ const { error } = this . args ;
27
+
28
+ return error instanceof NotFoundError ;
29
+ }
30
+ }
31
+
32
+ declare module '@glint/environment-ember-loose/registry' {
33
+ export default interface Registry {
34
+ PollError : typeof PollError ;
35
+ }
36
+ }
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -17,4 +17,5 @@ Router.map(function () {
17
17
this . route ( 'options-datetime' ) ;
18
18
this . route ( 'settings' ) ;
19
19
} ) ;
20
+ this . route ( 'poll-error' ) ;
20
21
} ) ;
Original file line number Diff line number Diff line change
1
+ import Route from '@ember/routing/route' ;
2
+
3
+ export default class PollErrorRoute extends Route < Error > { }
Original file line number Diff line number Diff line change 1
- <div class =" box" >
2
- {{ #if this.decryptionFailed }}
3
- <h2 data-test-error-type =" decryption-failed" >
4
- {{ t " error.poll.decryptionFailed.title" }}
5
- </h2 >
6
- <p >
7
- {{ t " error.poll.decryptionFailed.description" }}
8
- </p >
9
- {{ else if this.notFound}}
10
- <h2 data-test-error-type =" not-found" >
11
- {{ t " error.poll.notFound.title" }}
12
- </h2 >
13
- <p >
14
- {{ t " error.poll.notFound.description" }}
15
- </p >
16
- <ul >
17
- <li >
18
- {{ t " error.poll.notFound.reasons.expired" }}
19
- </li >
20
- <li >
21
- {{ t " error.poll.notFound.reasons.typo" }}
22
- </li >
23
- </ul >
24
- {{ else }}
25
- <h2 data-test-error-type =" unexpected" >
26
- {{ t " error.generic.unexpected.title" }}
27
- </h2 >
28
- <p >
29
- {{ t " error.generic.unexpected.description" }}
30
- </p >
31
- {{ /if }}
32
- </div >
1
+ <PollError @error ={{ @model }} />
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments