aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar vantezzen <hello@vantezzen.io>2020-02-12 11:36:35 +0100
committerLibravatar vantezzen <hello@vantezzen.io>2020-02-12 11:36:35 +0100
commit489056db04d98a9bad32cd0e0347bf6348fbb7b7 (patch)
treec1b15135d2db12a58d4e722f733f2a50e630c735
parentUpdate debugger URL to production API (diff)
downloadferdium-app-489056db04d98a9bad32cd0e0347bf6348fbb7b7.tar.gz
ferdium-app-489056db04d98a9bad32cd0e0347bf6348fbb7b7.tar.zst
ferdium-app-489056db04d98a9bad32cd0e0347bf6348fbb7b7.zip
Add error state to debug publisher
m---------recipes0
-rw-r--r--src/features/publishDebugInfo/Component.js30
-rw-r--r--src/i18n/locales/defaultMessages.json29
-rw-r--r--src/i18n/locales/en-US.json1
-rw-r--r--src/i18n/messages/src/features/publishDebugInfo/Component.json29
5 files changed, 65 insertions, 24 deletions
diff --git a/recipes b/recipes
Subproject f47c638a38baad7a978baf8e204743227f4005e Subproject f6da5d54280e5156c46c295ad48d6cdcd5e10bb
diff --git a/src/features/publishDebugInfo/Component.js b/src/features/publishDebugInfo/Component.js
index fbaa88a43..be90a1f99 100644
--- a/src/features/publishDebugInfo/Component.js
+++ b/src/features/publishDebugInfo/Component.js
@@ -22,6 +22,10 @@ const messages = defineMessages({
22 id: 'feature.publishDebugInfo.info', 22 id: 'feature.publishDebugInfo.info',
23 defaultMessage: '!!!Publishing your debug information helps us find issues and errors in Ferdi. By publishing your debug information you accept Ferdi Debugger\'s privacy policy and terms of service', 23 defaultMessage: '!!!Publishing your debug information helps us find issues and errors in Ferdi. By publishing your debug information you accept Ferdi Debugger\'s privacy policy and terms of service',
24 }, 24 },
25 error: {
26 id: 'feature.publishDebugInfo.error',
27 defaultMessage: '!!!There was an error while trying to publish the debug information. Please try again later or view the console for more information.',
28 },
25 privacy: { 29 privacy: {
26 id: 'feature.publishDebugInfo.privacy', 30 id: 'feature.publishDebugInfo.privacy',
27 defaultMessage: '!!!Privacy policy', 31 defaultMessage: '!!!Privacy policy',
@@ -86,6 +90,7 @@ export default @injectSheet(styles) @inject('stores') @observer class PublishDeb
86 90
87 state = { 91 state = {
88 log: null, 92 log: null,
93 error: false,
89 isSendingLog: false, 94 isSendingLog: false,
90 } 95 }
91 96
@@ -114,8 +119,9 @@ export default @injectSheet(styles) @inject('stores') @observer class PublishDeb
114 log: response.id, 119 log: response.id,
115 }); 120 });
116 } else { 121 } else {
117 // TODO: Show error message 122 this.setState({
118 this.close(); 123 error: true,
124 });
119 } 125 }
120 } 126 }
121 127
@@ -128,6 +134,8 @@ export default @injectSheet(styles) @inject('stores') @observer class PublishDeb
128 134
129 const { 135 const {
130 log, 136 log,
137 error,
138 isSendingLog,
131 } = this.state; 139 } = this.state;
132 140
133 const { intl } = this.context; 141 const { intl } = this.context;
@@ -136,13 +144,13 @@ export default @injectSheet(styles) @inject('stores') @observer class PublishDeb
136 <Modal 144 <Modal
137 isOpen={isModalVisible} 145 isOpen={isModalVisible}
138 shouldCloseOnOverlayClick 146 shouldCloseOnOverlayClick
139 close={this.close.bind(this)} 147 close={() => this.close()}
140 > 148 >
141 <div className={classes.container}> 149 <div className={classes.container}>
142 <H1> 150 <H1>
143 {intl.formatMessage(messages.title)} 151 {intl.formatMessage(messages.title)}
144 </H1> 152 </H1>
145 { log ? ( 153 { log && (
146 <> 154 <>
147 <p className={classes.info}>{intl.formatMessage(messages.published)}</p> 155 <p className={classes.info}>{intl.formatMessage(messages.published)}</p>
148 <Input 156 <Input
@@ -156,7 +164,13 @@ export default @injectSheet(styles) @inject('stores') @observer class PublishDeb
156 readonly 164 readonly
157 /> 165 />
158 </> 166 </>
159 ) : ( 167 )}
168
169 {error && (
170 <p className={classes.info}>{intl.formatMessage(messages.error)}</p>
171 )}
172
173 {!log && !error && (
160 <> 174 <>
161 <p className={classes.info}>{intl.formatMessage(messages.info)}</p> 175 <p className={classes.info}>{intl.formatMessage(messages.info)}</p>
162 176
@@ -171,11 +185,11 @@ export default @injectSheet(styles) @inject('stores') @observer class PublishDeb
171 type="button" 185 type="button"
172 label={intl.formatMessage(messages.publish)} 186 label={intl.formatMessage(messages.publish)}
173 className={classes.button} 187 className={classes.button}
174 onClick={this.publishDebugInfo.bind(this)} 188 onClick={() => this.publishDebugInfo()}
175 disabled={this.state.isSendingLog} 189 disabled={isSendingLog}
176 /> 190 />
177 </> 191 </>
178 ) } 192 )}
179 </div> 193 </div>
180 </Modal> 194 </Modal>
181 ); 195 );
diff --git a/src/i18n/locales/defaultMessages.json b/src/i18n/locales/defaultMessages.json
index 8d5a6b9c4..6ac9153a4 100644
--- a/src/i18n/locales/defaultMessages.json
+++ b/src/i18n/locales/defaultMessages.json
@@ -5052,55 +5052,68 @@
5052 } 5052 }
5053 }, 5053 },
5054 { 5054 {
5055 "defaultMessage": "!!!Privacy policy", 5055 "defaultMessage": "!!!There was an error while trying to publish the debug information. Please try again later or view the console for more information.",
5056 "end": { 5056 "end": {
5057 "column": 3, 5057 "column": 3,
5058 "line": 28 5058 "line": 28
5059 }, 5059 },
5060 "file": "src/features/publishDebugInfo/Component.js", 5060 "file": "src/features/publishDebugInfo/Component.js",
5061 "id": "feature.publishDebugInfo.error",
5062 "start": {
5063 "column": 9,
5064 "line": 25
5065 }
5066 },
5067 {
5068 "defaultMessage": "!!!Privacy policy",
5069 "end": {
5070 "column": 3,
5071 "line": 32
5072 },
5073 "file": "src/features/publishDebugInfo/Component.js",
5061 "id": "feature.publishDebugInfo.privacy", 5074 "id": "feature.publishDebugInfo.privacy",
5062 "start": { 5075 "start": {
5063 "column": 11, 5076 "column": 11,
5064 "line": 25 5077 "line": 29
5065 } 5078 }
5066 }, 5079 },
5067 { 5080 {
5068 "defaultMessage": "!!!Terms of service", 5081 "defaultMessage": "!!!Terms of service",
5069 "end": { 5082 "end": {
5070 "column": 3, 5083 "column": 3,
5071 "line": 32 5084 "line": 36
5072 }, 5085 },
5073 "file": "src/features/publishDebugInfo/Component.js", 5086 "file": "src/features/publishDebugInfo/Component.js",
5074 "id": "feature.publishDebugInfo.terms", 5087 "id": "feature.publishDebugInfo.terms",
5075 "start": { 5088 "start": {
5076 "column": 9, 5089 "column": 9,
5077 "line": 29 5090 "line": 33
5078 } 5091 }
5079 }, 5092 },
5080 { 5093 {
5081 "defaultMessage": "!!!Accept and publish", 5094 "defaultMessage": "!!!Accept and publish",
5082 "end": { 5095 "end": {
5083 "column": 3, 5096 "column": 3,
5084 "line": 36 5097 "line": 40
5085 }, 5098 },
5086 "file": "src/features/publishDebugInfo/Component.js", 5099 "file": "src/features/publishDebugInfo/Component.js",
5087 "id": "feature.publishDebugInfo.publish", 5100 "id": "feature.publishDebugInfo.publish",
5088 "start": { 5101 "start": {
5089 "column": 11, 5102 "column": 11,
5090 "line": 33 5103 "line": 37
5091 } 5104 }
5092 }, 5105 },
5093 { 5106 {
5094 "defaultMessage": "!!!Your debug log was published and is now availible at", 5107 "defaultMessage": "!!!Your debug log was published and is now availible at",
5095 "end": { 5108 "end": {
5096 "column": 3, 5109 "column": 3,
5097 "line": 40 5110 "line": 44
5098 }, 5111 },
5099 "file": "src/features/publishDebugInfo/Component.js", 5112 "file": "src/features/publishDebugInfo/Component.js",
5100 "id": "feature.publishDebugInfo.published", 5113 "id": "feature.publishDebugInfo.published",
5101 "start": { 5114 "start": {
5102 "column": 13, 5115 "column": 13,
5103 "line": 37 5116 "line": 41
5104 } 5117 }
5105 } 5118 }
5106 ], 5119 ],
diff --git a/src/i18n/locales/en-US.json b/src/i18n/locales/en-US.json
index f523bc380..ce41bb9ce 100644
--- a/src/i18n/locales/en-US.json
+++ b/src/i18n/locales/en-US.json
@@ -26,6 +26,7 @@
26 "feature.planSelection.personal.text": "More services, no waiting - ideal for personal use.", 26 "feature.planSelection.personal.text": "More services, no waiting - ideal for personal use.",
27 "feature.planSelection.pricesBasedOnAnnualPayment": "All prices based on yearly payment", 27 "feature.planSelection.pricesBasedOnAnnualPayment": "All prices based on yearly payment",
28 "feature.planSelection.pro.text": "Unlimited services and professional features for you - and your team.", 28 "feature.planSelection.pro.text": "Unlimited services and professional features for you - and your team.",
29 "feature.publishDebugInfo.error": "There was an error while trying to publish the debug information. Please try again later or view the console for more information.",
29 "feature.publishDebugInfo.info": "Publishing your debug information helps us find issues and errors in Ferdi. By publishing your debug information you accept Ferdi Debugger's privacy policy and terms of service", 30 "feature.publishDebugInfo.info": "Publishing your debug information helps us find issues and errors in Ferdi. By publishing your debug information you accept Ferdi Debugger's privacy policy and terms of service",
30 "feature.publishDebugInfo.privacy": "Privacy policy", 31 "feature.publishDebugInfo.privacy": "Privacy policy",
31 "feature.publishDebugInfo.publish": "Accept and publish", 32 "feature.publishDebugInfo.publish": "Accept and publish",
diff --git a/src/i18n/messages/src/features/publishDebugInfo/Component.json b/src/i18n/messages/src/features/publishDebugInfo/Component.json
index 500f2c01b..25048ace6 100644
--- a/src/i18n/messages/src/features/publishDebugInfo/Component.json
+++ b/src/i18n/messages/src/features/publishDebugInfo/Component.json
@@ -26,15 +26,28 @@
26 } 26 }
27 }, 27 },
28 { 28 {
29 "id": "feature.publishDebugInfo.error",
30 "defaultMessage": "!!!There was an error while trying to publish the debug information. Please try again later or view the console for more information.",
31 "file": "src/features/publishDebugInfo/Component.js",
32 "start": {
33 "line": 25,
34 "column": 9
35 },
36 "end": {
37 "line": 28,
38 "column": 3
39 }
40 },
41 {
29 "id": "feature.publishDebugInfo.privacy", 42 "id": "feature.publishDebugInfo.privacy",
30 "defaultMessage": "!!!Privacy policy", 43 "defaultMessage": "!!!Privacy policy",
31 "file": "src/features/publishDebugInfo/Component.js", 44 "file": "src/features/publishDebugInfo/Component.js",
32 "start": { 45 "start": {
33 "line": 25, 46 "line": 29,
34 "column": 11 47 "column": 11
35 }, 48 },
36 "end": { 49 "end": {
37 "line": 28, 50 "line": 32,
38 "column": 3 51 "column": 3
39 } 52 }
40 }, 53 },
@@ -43,11 +56,11 @@
43 "defaultMessage": "!!!Terms of service", 56 "defaultMessage": "!!!Terms of service",
44 "file": "src/features/publishDebugInfo/Component.js", 57 "file": "src/features/publishDebugInfo/Component.js",
45 "start": { 58 "start": {
46 "line": 29, 59 "line": 33,
47 "column": 9 60 "column": 9
48 }, 61 },
49 "end": { 62 "end": {
50 "line": 32, 63 "line": 36,
51 "column": 3 64 "column": 3
52 } 65 }
53 }, 66 },
@@ -56,11 +69,11 @@
56 "defaultMessage": "!!!Accept and publish", 69 "defaultMessage": "!!!Accept and publish",
57 "file": "src/features/publishDebugInfo/Component.js", 70 "file": "src/features/publishDebugInfo/Component.js",
58 "start": { 71 "start": {
59 "line": 33, 72 "line": 37,
60 "column": 11 73 "column": 11
61 }, 74 },
62 "end": { 75 "end": {
63 "line": 36, 76 "line": 40,
64 "column": 3 77 "column": 3
65 } 78 }
66 }, 79 },
@@ -69,11 +82,11 @@
69 "defaultMessage": "!!!Your debug log was published and is now availible at", 82 "defaultMessage": "!!!Your debug log was published and is now availible at",
70 "file": "src/features/publishDebugInfo/Component.js", 83 "file": "src/features/publishDebugInfo/Component.js",
71 "start": { 84 "start": {
72 "line": 37, 85 "line": 41,
73 "column": 13 86 "column": 13
74 }, 87 },
75 "end": { 88 "end": {
76 "line": 40, 89 "line": 44,
77 "column": 3 90 "column": 3
78 } 91 }
79 } 92 }