diff --git a/app.config.environment.alpha.js b/app.config.environment.alpha.js index e0c4b0b3eef2dc34174673b70fb38d0e48f04934..e88d5fe707e160b0c6df0bb2e29b6b4429b0b89a 100644 --- a/app.config.environment.alpha.js +++ b/app.config.environment.alpha.js @@ -19,6 +19,9 @@ module.exports = { __STACK_ASSETS__: target !== 'mobile', __PIWIK_TRACKER_URL__: JSON.stringify('https://statweb.grandlyon.com/'), __PIWIK_SITEID__: 117, + __SENTRY_DSN__: JSON.stringify( + 'https://c868f6010f3f431d95be8f70d7f37666@grandlyon.errors.cozycloud.cc/6' + ), }), ], optimization: { diff --git a/app.config.environment.dev.js b/app.config.environment.dev.js index 31cbe4a8ce3c192dae0a38450fa5cfafbb4af6aa..558975d4198359f44e6d0e2debc03e7414f3fc0f 100644 --- a/app.config.environment.dev.js +++ b/app.config.environment.dev.js @@ -23,6 +23,9 @@ const stackProvidedLibsConfig = { __STACK_ASSETS__: true, __PIWIK_TRACKER_URL__: JSON.stringify('http://localhost:9800/'), __PIWIK_SITEID__: 1, + __SENTRY_DSN__: JSON.stringify( + 'https://c868f6010f3f431d95be8f70d7f37666@grandlyon.errors.cozycloud.cc/6' + ), }), ], module: { diff --git a/app.config.environment.prod.js b/app.config.environment.prod.js index 7dc15dbcfe681d98d64c73b52327f5c51f27a5f1..8b6b811a93840c9cab11b0984005b7778d7ef8d4 100644 --- a/app.config.environment.prod.js +++ b/app.config.environment.prod.js @@ -19,6 +19,9 @@ module.exports = { __STACK_ASSETS__: target !== 'mobile', __PIWIK_TRACKER_URL__: JSON.stringify('https://statweb.grandlyon.com/'), __PIWIK_SITEID__: 118, + __SENTRY_DSN__: JSON.stringify( + 'https://c868f6010f3f431d95be8f70d7f37666@grandlyon.errors.cozycloud.cc/6' + ), }), ], optimization: { diff --git a/src/components/Options/OptionsView.tsx b/src/components/Options/OptionsView.tsx index 3d3beb07ece85f801db03e2d62bf23df7b73a9fb..3b5c630496dc8a3fbdf5c486a08c6c664dd06c2a 100644 --- a/src/components/Options/OptionsView.tsx +++ b/src/components/Options/OptionsView.tsx @@ -19,9 +19,9 @@ const OptionsView: React.FC = () => { setHeaderHeight(height) } - const testWithRelease = () => { + const envFiles = () => { console.log('click icon') - throw new Error('custom error') + throw new Error('custom error 2') } return ( <> @@ -31,7 +31,7 @@ const OptionsView: React.FC = () => { desktopTitleKey={'common.title_options'} ></Header> <Content height={headerHeight}> - <button onClick={testWithRelease}>Break the world</button>; + <button onClick={envFiles}>Break the world</button>; <ProfileTypeOptions /> <ExportOptions /> <ReportOptions /> diff --git a/src/components/Options/pwet.json b/src/components/Options/pwet.json new file mode 100644 index 0000000000000000000000000000000000000000..8ea454a15f88c4a987afe4ef46b059a52076fa7d --- /dev/null +++ b/src/components/Options/pwet.json @@ -0,0 +1,5 @@ +{ +{"event_id":"14f16100e2eb41e8a46cb50ebafd3dee","sent_at":"2022-11-25T15:43:25.610Z","sdk":{"name":"sentry.javascript.react","version":"7.20.1"},"trace":{"environment":"development","release":"2.0.0","public_key":"c868f6010f3f431d95be8f70d7f37666","trace_id":"75b08df1dc554ad2b99546f0ed90de74","sample_rate":"1"}} +{"type":"transaction"}, +{"contexts":{"state":{"state":{"type":"redux","value":"[Object]"}},"trace":{"op":"navigation","span_id":"95102b50b9ff7c20","tags":{"effectiveConnectionType":"4g","hardwareConcurrency":"8","sentry_reportAllChanges":false},"trace_id":"75b08df1dc554ad2b99546f0ed90de74"}},"spans":[{"data":{"method":"GET","url":"http://cozy.tools:8080/settings/disk-usage","type":"fetch"},"description":"GET http://cozy.tools:8080/settings/disk-usage","op":"http.client","parent_span_id":"95102b50b9ff7c20","span_id":"b3b7b09249367271","start_timestamp":1669391004.1857002,"status":"ok","tags":{"http.status_code":"200"},"timestamp":1669391004.426,"trace_id":"75b08df1dc554ad2b99546f0ed90de74"},{"data":{"method":"GET","url":"http://cozy.tools:8080/settings/context","type":"fetch"},"description":"GET http://cozy.tools:8080/settings/context","op":"http.client","parent_span_id":"95102b50b9ff7c20","span_id":"b55ec8be318aa094","start_timestamp":1669391004.1868,"status":"ok","tags":{"http.status_code":"200"},"timestamp":1669391004.4245,"trace_id":"75b08df1dc554ad2b99546f0ed90de74"},{"data":{"method":"GET","url":"http://cozy.tools:8080/settings/instance","type":"fetch"},"description":"GET http://cozy.tools:8080/settings/instance","op":"http.client","parent_span_id":"95102b50b9ff7c20","span_id":"b19394a9a9521e29","start_timestamp":1669391004.1876001,"status":"ok","tags":{"http.status_code":"200"},"timestamp":1669391004.4249,"trace_id":"75b08df1dc554ad2b99546f0ed90de74"},{"data":{"method":"POST","url":"http://cozy.tools:8080/data/com.grandlyon.ecolyo.usageevent/","type":"fetch"},"description":"POST http://cozy.tools:8080/data/com.grandlyon.ecolyo.usageevent/","op":"http.client","parent_span_id":"95102b50b9ff7c20","span_id":"93624145d5596126","start_timestamp":1669391004.1897001,"status":"ok","tags":{"http.status_code":"201"},"timestamp":1669391004.4262002,"trace_id":"75b08df1dc554ad2b99546f0ed90de74"},{"description":"Main UI thread blocked","op":"ui.long-task","parent_span_id":"95102b50b9ff7c20","span_id":"bf9109797132d0ff","start_timestamp":1669391004.1108,"timestamp":1669391004.1948001,"trace_id":"75b08df1dc554ad2b99546f0ed90de74"},{"data":{"method":"POST","url":"http://cozy.tools:8080/data/com.grandlyon.enedis.day/_find","type":"fetch"},"description":"POST http://cozy.tools:8080/data/com.grandlyon.enedis.day/_find","op":"http.client","parent_span_id":"95102b50b9ff7c20","span_id":"af5a77a4a0a454a5","start_timestamp":1669391004.4513001,"status":"ok","tags":{"http.status_code":"200"},"timestamp":1669391004.4945,"trace_id":"75b08df1dc554ad2b99546f0ed90de74"},{"data":{"method":"POST","url":"http://cozy.tools:8080/data/com.grandlyon.egl.day/_find","type":"fetch"},"description":"POST http://cozy.tools:8080/data/com.grandlyon.egl.day/_find","op":"http.client","parent_span_id":"95102b50b9ff7c20","span_id":"b2020a416bc3f700","start_timestamp":1669391004.4541001,"status":"ok","tags":{"http.status_code":"200"},"timestamp":1669391004.5994,"trace_id":"75b08df1dc554ad2b99546f0ed90de74"},{"description":"Main UI thread blocked","op":"ui.long-task","parent_span_id":"95102b50b9ff7c20","span_id":"8b8aeec77bd9379c","start_timestamp":1669391004.2036002,"timestamp":1669391004.4146001,"trace_id":"75b08df1dc554ad2b99546f0ed90de74"},{"description":"Main UI thread blocked","op":"ui.long-task","parent_span_id":"95102b50b9ff7c20","span_id":"a6c81b41cf4ed027","start_timestamp":1669391004.4262,"timestamp":1669391004.4891999,"trace_id":"75b08df1dc554ad2b99546f0ed90de74"},{"data":{"method":"POST","url":"http://cozy.tools:8080/data/com.grandlyon.egl.day/_find","type":"fetch"},"description":"POST http://cozy.tools:8080/data/com.grandlyon.egl.day/_find","op":"http.client","parent_span_id":"95102b50b9ff7c20","span_id":"a03ba0ae03453c16","start_timestamp":1669391004.5133,"status":"ok","tags":{"http.status_code":"200"},"timestamp":1669391004.5669003,"trace_id":"75b08df1dc554ad2b99546f0ed90de74"},{"data":{"method":"POST","url":"http://cozy.tools:8080/data/com.grandlyon.grdf.day/_find","type":"fetch"},"description":"POST http://cozy.tools:8080/data/com.grandlyon.grdf.day/_find","op":"http.client","parent_span_id":"95102b50b9ff7c20","span_id":"8b7f8ae948990564","start_timestamp":1669391004.5689,"status":"ok","tags":{"http.status_code":"200"},"timestamp":1669391004.5901,"trace_id":"75b08df1dc554ad2b99546f0ed90de74"},{"data":{"Transfer Size":0,"Encoded Body Size":0,"Decoded Body Size":0},"description":"http://localhost:8888/3/ecolyo.js","op":"resource.script","parent_span_id":"95102b50b9ff7c20","span_id":"a07e604dc98fcff6","start_timestamp":1669391004.1632,"timestamp":1669391004.1701,"trace_id":"75b08df1dc554ad2b99546f0ed90de74"},{"data":{"Transfer Size":300,"Encoded Body Size":4064,"Decoded Body Size":4064},"description":"/icon.svg","op":"resource.img","parent_span_id":"95102b50b9ff7c20","span_id":"ac566dd2b55dce44","start_timestamp":1669391004.1904001,"timestamp":1669391004.243,"trace_id":"75b08df1dc554ad2b99546f0ed90de74"},{"description":"⚛ Unknown [update] (#9606)","op":"mark","parent_span_id":"95102b50b9ff7c20","span_id":"9fcee79011064dc4","start_timestamp":1669391004.4264,"timestamp":1669391004.4264,"trace_id":"75b08df1dc554ad2b99546f0ed90de74"},{"data":{"Transfer Size":0,"Encoded Body Size":0,"Decoded Body Size":0},"description":"http://localhost:9800/index.php?module=CoreAdminHome&action=optOut&language=fr&backgroundColor=121212&fontColor=e0e0e0&fontSize=&fontFamily=sans-serif","op":"resource.iframe","parent_span_id":"95102b50b9ff7c20","span_id":"97e90f81f4860737","start_timestamp":1669391004.4415,"timestamp":1669391004.4866,"trace_id":"75b08df1dc554ad2b99546f0ed90de74"}],"start_timestamp":1669391004.1151001,"tags":{"effectiveConnectionType":"4g","hardwareConcurrency":"8","sentry_reportAllChanges":false},"timestamp":1669391004.5994,"transaction":"/","type":"transaction","transaction_info":{"source":"url","changes":[],"propagations":0},"platform":"javascript","event_id":"14f16100e2eb41e8a46cb50ebafd3dee","environment":"development","release":"2.0.0","sdk":{"integrations":["InboundFilters","FunctionToString","TryCatch","Breadcrumbs","GlobalHandlers","LinkedErrors","Dedupe","HttpContext","BrowserTracing"],"name":"sentry.javascript.react","version":"7.20.1","packages":[{"name":"npm:@sentry/react","version":"7.20.1"}]},"breadcrumbs":[{"timestamp":1669390990.593,"category":"fetch","data":{"method":"POST","url":"http://cozy.tools:8080/data/com.grandlyon.enedis.day/_find","__span":"982a12a1820acfba","status_code":200},"type":"http"},{"timestamp":1669390990.624,"category":"fetch","data":{"method":"POST","url":"http://cozy.tools:8080/data/com.grandlyon.egl.day/_find","__span":"9506b61950885e12","status_code":200},"type":"http"},{"timestamp":1669390990.656,"category":"fetch","data":{"method":"POST","url":"http://cozy.tools:8080/data/com.grandlyon.grdf.day/_find","__span":"a82b0c8c07251115","status_code":200},"type":"http"},{"timestamp":1669390990.694,"category":"fetch","data":{"method":"POST","url":"http://cozy.tools:8080/data/com.grandlyon.enedis.day/_find","__span":"9d7b4b05f616e388","status_code":200},"type":"http"},{"timestamp":1669390990.713,"category":"fetch","data":{"method":"POST","url":"http://cozy.tools:8080/data/com.grandlyon.egl.day/_find","__span":"bcf7b48da5859a25","status_code":200},"type":"http"},{"timestamp":1669390990.73,"category":"fetch","data":{"method":"POST","url":"http://cozy.tools:8080/data/com.grandlyon.grdf.day/_find","__span":"867d32ed781eb826","status_code":200},"type":"http"},{"timestamp":1669390990.731,"category":"console","data":{"arguments":["ecolyo","info","[Initialization] Fluid Status loaded"],"logger":"console"},"level":"log","message":"ecolyo info [Initialization] Fluid Status loaded"},{"timestamp":1669390990.731,"category":"redux.action","data":{"type":"SET_FLUID_STATUS","payload":[{"fluidType":0,"status":1,"firstDataDate":"[DateTime]","lastDataDate":"[DateTime]","connection":"[Object]"},{"fluidType":1,"status":300,"firstDataDate":"[DateTime]","lastDataDate":"[DateTime]","connection":"[Object]"},{"fluidType":2,"status":300,"firstDataDate":"[DateTime]","lastDataDate":"[DateTime]","connection":"[Object]"}]},"type":"info"},{"timestamp":1669390990.732,"category":"redux.action","data":{"type":"SET_SELECTED_DATE","payload":"2022-10-09T00:00:00.000Z"},"type":"info"},{"timestamp":1669390990.75,"category":"fetch","data":{"method":"GET","url":"http://cozy.tools:8080/data/com.grandlyon.ecolyo.challenge/_normal_docs?include_docs=true&limit=100","__span":"9bd38cf23c575064","status_code":200},"type":"http"},{"timestamp":1669390990.766,"category":"fetch","data":{"method":"POST","url":"http://cozy.tools:8080/data/com.grandlyon.ecolyo.duel/_all_docs?include_docs=true","__span":"8b0d2b2278a9fccf","status_code":200},"type":"http"},{"timestamp":1669390990.787,"category":"fetch","data":{"method":"GET","url":"http://cozy.tools:8080/data/com.grandlyon.ecolyo.challenge/_normal_docs?include_docs=true&limit=100","__span":"8e164c44b6a83bca","status_code":200},"type":"http"},{"timestamp":1669390990.805,"category":"fetch","data":{"method":"POST","url":"http://cozy.tools:8080/data/com.grandlyon.ecolyo.exploration/_all_docs?include_docs=true","__span":"817296e86e84f925","status_code":200},"type":"http"},{"timestamp":1669390990.824,"category":"fetch","data":{"method":"GET","url":"http://cozy.tools:8080/data/com.grandlyon.ecolyo.challenge/_normal_docs?include_docs=true&limit=100","__span":"a4761883ace2f26a","status_code":200},"type":"http"},{"timestamp":1669390990.841,"category":"fetch","data":{"method":"POST","url":"http://cozy.tools:8080/data/com.grandlyon.ecolyo.quiz/_all_docs?include_docs=true","__span":"ae2e9a9345396241","status_code":200},"type":"http"},{"timestamp":1669390990.868,"category":"fetch","data":{"method":"GET","url":"http://cozy.tools:8080/data/com.grandlyon.ecolyo.userchallenge/_normal_docs?include_docs=true&limit=100","__span":"8e23565bf3cc0ac5","status_code":200},"type":"http"},{"timestamp":1669390990.869,"category":"console","data":{"arguments":["cozy-stack-client","warn","Selector fields should be manually indexed to prevent unexpected behaviour"],"logger":"console"},"level":"log","message":"cozy-stack-client warn Selector fields should be manually indexed to prevent unexpected behaviour"},{"timestamp":1669390990.888,"category":"fetch","data":{"method":"POST","url":"http://cozy.tools:8080/data/com.grandlyon.ecolyo.exploration/_find","__span":"aef4a2bb72347d79","status_code":200},"type":"http"},{"timestamp":1669390990.89,"category":"console","data":{"arguments":["ecolyo","info","[Initialization] Challenges loaded"],"logger":"console"},"level":"log","message":"ecolyo info [Initialization] Challenges loaded"},{"timestamp":1669390990.89,"category":"redux.action","data":{"type":"SET_USER_CHALLENGE_LIST","payload":[{"id":"CHALLENGE0001","_id":"48cf296dbf1d970a73dcc6d926147e45","_type":"com.grandlyon.ecolyo.userchallenge","_rev":"10-792c4d0f65ad9752967a0aee51117cb3","action":"[Object]","cozyMetadata":"[Object]","description":"foobar","duel":"[Object]","endingDate":null,"exploration":"[Object]","progress":"[Object]","quiz":"[Object]","startDate":"[DateTime]","state":2,"success":0,"target":15,"title":"Simone VEILLE"},{"id":"CHALLENGE0002","title":"Jean-Jacques RUISSEAU","description":"foobar","target":15,"duel":"[Object]","state":0,"progress":"[Object]","success":0,"startDate":null,"endingDate":null,"quiz":"[Object]","exploration":"[Object]","action":"[Object]"},{"id":"CHALLENGE0003","title":"Usain VOLT","description":"foobar","target":15,"duel":"[Object]","state":0,"progress":"[Object]","success":0,"startDate":null,"endingDate":null,"quiz":"[Object]","exploration":"[Object]","action":"[Object]"},{"id":"CHALLENGE0004","title":"Bernard PIV'EAU","description":"foobar","target":15,"duel":"[Object]","state":0,"progress":"[Object]","success":0,"startDate":null,"endingDate":null,"quiz":"[Object]","exploration":"[Object]","action":"[Object]"},{"id":"CHALLENGE0005","title":"Maria SHARAPOWATT","description":"foobar","target":15,"duel":"[Object]","state":0,"progress":"[Object]","success":0,"startDate":null,"endingDate":null,"quiz":"[Object]","exploration":"[Object]","action":"[Object]"}]},"type":"info"},{"timestamp":1669390990.953,"category":"fetch","data":{"method":"POST","url":"http://cozy.tools:8080/data/com.grandlyon.ecolyo.usageevent/","__span":"bb107b34c4fd543b","status_code":201},"type":"http"},{"timestamp":1669390991.209,"category":"fetch","data":{"method":"GET","url":"http://cozy.tools:8080/remote/org.ecolyo.agent.custom.popup.rec","__span":"9baea5e87549fe68","status_code":200},"type":"http"},{"timestamp":1669390991.21,"category":"redux.action","data":{"type":"SET_CUSTOM_POPUP","payload":{"ID":1,"popupEnabled":true,"title":"pwet","description":"pwet pwet","endDate":"2022-10-26T15:50:54.951Z"}},"type":"info"},{"timestamp":1669390991.3,"category":"fetch","data":{"method":"GET","url":"http://cozy.tools:8080/remote/org.ecolyo.agent.partners.info.rec","__span":"b44eb8df741e9a4a","status_code":200},"type":"http"},{"timestamp":1669390991.301,"category":"console","data":{"arguments":["ecolyo","info","Initialization finished successfully !"],"logger":"console"},"level":"log","message":"ecolyo info Initialization finished successfully !"},{"timestamp":1669390991.512,"category":"console","data":{"arguments":["harvest","info","Available konnector policies",["[Object]","[Object]","[Object]"]],"logger":"console"},"level":"log","message":"harvest info Available konnector policies [object Object],[object Object],[object Object]"},{"timestamp":1669390991.849,"category":"fetch","data":{"method":"GET","url":"http://cozy.tools:8080/settings/instance","__span":"a633c7561b91be42","status_code":200},"type":"http"},{"timestamp":1669390991.87,"category":"redux.action","data":{"type":"CHANGE_SCREEN_TYPE","payload":0},"type":"info"},{"timestamp":1669390991.872,"category":"redux.action","data":{"type":"SET_LOADING","payload":true},"type":"info"},{"timestamp":1669390991.909,"category":"redux.action","data":{"type":"SET_CURRENT_DATACHART","payload":{"actualData":[],"comparisonData":null}},"type":"info"},{"timestamp":1669390991.91,"category":"redux.action","data":{"type":"SET_CURRENT_INDEX","payload":7},"type":"info"},{"timestamp":1669390991.919,"category":"redux.action","data":{"type":"SET_CURRENT_DATACHART","payload":{"actualData":[],"comparisonData":null}},"type":"info"},{"timestamp":1669390991.931,"category":"console","data":{"arguments":["cozy-stack-client","warn","Selector fields should be manually indexed to prevent unexpected behaviour"],"logger":"console"},"level":"log","message":"cozy-stack-client warn Selector fields should be manually indexed to prevent unexpected behaviour"},{"timestamp":1669390991.931,"category":"console","data":{"arguments":["cozy-stack-client","warn","Selector fields should be manually indexed to prevent unexpected behaviour"],"logger":"console"},"level":"log","message":"cozy-stack-client warn Selector fields should be manually indexed to prevent unexpected behaviour"},{"timestamp":1669390991.934,"category":"console","data":{"arguments":["cozy-stack-client","warn","Selector fields should be manually indexed to prevent unexpected behaviour"],"logger":"console"},"level":"log","message":"cozy-stack-client warn Selector fields should be manually indexed to prevent unexpected behaviour"},{"timestamp":1669390991.934,"category":"console","data":{"arguments":["cozy-stack-client","warn","Selector fields should be manually indexed to prevent unexpected behaviour"],"logger":"console"},"level":"log","message":"cozy-stack-client warn Selector fields should be manually indexed to prevent unexpected behaviour"},{"timestamp":1669390991.935,"category":"console","data":{"arguments":["cozy-stack-client","warn","Selector fields should be manually indexed to prevent unexpected behaviour"],"logger":"console"},"level":"log","message":"cozy-stack-client warn Selector fields should be manually indexed to prevent unexpected behaviour"},{"timestamp":1669390991.935,"category":"console","data":{"arguments":["cozy-stack-client","warn","Selector fields should be manually indexed to prevent unexpected behaviour"],"logger":"console"},"level":"log","message":"cozy-stack-client warn Selector fields should be manually indexed to prevent unexpected behaviour"},{"timestamp":1669390991.937,"category":"console","data":{"arguments":["cozy-stack-client","warn","Selector fields should be manually indexed to prevent unexpected behaviour"],"logger":"console"},"level":"log","message":"cozy-stack-client warn Selector fields should be manually indexed to prevent unexpected behaviour"},{"timestamp":1669390991.937,"category":"console","data":{"arguments":["cozy-stack-client","warn","Selector fields should be manually indexed to prevent unexpected behaviour"],"logger":"console"},"level":"log","message":"cozy-stack-client warn Selector fields should be manually indexed to prevent unexpected behaviour"},{"timestamp":1669390991.958,"category":"console","data":{"arguments":["cozy-stack-client","warn","Selector fields should be manually indexed to prevent unexpected behaviour"],"logger":"console"},"level":"log","message":"cozy-stack-client warn Selector fields should be manually indexed to prevent unexpected behaviour"},{"timestamp":1669390991.958,"category":"console","data":{"arguments":["cozy-stack-client","warn","Selector fields should be manually indexed to prevent unexpected behaviour"],"logger":"console"},"level":"log","message":"cozy-stack-client warn Selector fields should be manually indexed to prevent unexpected behaviour"},{"timestamp":1669390992.071,"category":"fetch","data":{"method":"POST","url":"http://cozy.tools:8080/data/com.grandlyon.egl.day/_find","__span":"a7d2919b1ad51853","status_code":200},"type":"http"},{"timestamp":1669390992.071,"category":"fetch","data":{"method":"POST","url":"http://cozy.tools:8080/data/com.grandlyon.egl.day/_find","status_code":200},"type":"http"},{"timestamp":1669390992.074,"category":"fetch","data":{"method":"POST","url":"http://cozy.tools:8080/data/com.grandlyon.egl.day/_find","__span":"8c3e54b5e409d4fa","status_code":200},"type":"http"},{"timestamp":1669390992.074,"category":"fetch","data":{"method":"POST","url":"http://cozy.tools:8080/data/com.grandlyon.egl.day/_find","status_code":200},"type":"http"},{"timestamp":1669390992.076,"category":"console","data":{"arguments":["cozy-stack-client","warn","Selector fields should be manually indexed to prevent unexpected behaviour"],"logger":"console"},"level":"log","message":"cozy-stack-client warn Selector fields should be manually indexed to prevent unexpected behaviour"},{"timestamp":1669390992.076,"category":"console","data":{"arguments":["cozy-stack-client","warn","Selector fields should be manually indexed to prevent unexpected behaviour"],"logger":"console"},"level":"log","message":"cozy-stack-client warn Selector fields should be manually indexed to prevent unexpected behaviour"},{"timestamp":1669390992.078,"category":"console","data":{"arguments":["cozy-stack-client","warn","Selector fields should be manually indexed to prevent unexpected behaviour"],"logger":"console"},"level":"log","message":"cozy-stack-client warn Selector fields should be manually indexed to prevent unexpected behaviour"},{"timestamp":1669390992.078,"category":"console","data":{"arguments":["cozy-stack-client","warn","Selector fields should be manually indexed to prevent unexpected behaviour"],"logger":"console"},"level":"log","message":"cozy-stack-client warn Selector fields should be manually indexed to prevent unexpected behaviour"},{"timestamp":1669390992.08,"category":"fetch","data":{"method":"POST","url":"http://cozy.tools:8080/data/com.grandlyon.egl.day/_find","__span":"ba7dd8ee256d5801","status_code":200},"type":"http"},{"timestamp":1669390992.08,"category":"fetch","data":{"method":"POST","url":"http://cozy.tools:8080/data/com.grandlyon.egl.day/_find","status_code":200},"type":"http"},{"timestamp":1669390992.081,"category":"fetch","data":{"method":"POST","url":"http://cozy.tools:8080/data/com.grandlyon.egl.day/_find","__span":"8d5ef7ab8c94bdae","status_code":200},"type":"http"},{"timestamp":1669390992.081,"category":"fetch","data":{"method":"POST","url":"http://cozy.tools:8080/data/com.grandlyon.egl.day/_find","status_code":200},"type":"http"},{"timestamp":1669390992.082,"category":"fetch","data":{"method":"POST","url":"http://cozy.tools:8080/data/com.grandlyon.egl.day/_find","__span":"82773d94f6fb421f","status_code":200},"type":"http"},{"timestamp":1669390992.082,"category":"fetch","data":{"method":"POST","url":"http://cozy.tools:8080/data/com.grandlyon.egl.day/_find","status_code":200},"type":"http"},{"timestamp":1669390992.092,"category":"console","data":{"arguments":["cozy-stack-client","warn","Selector fields should be manually indexed to prevent unexpected behaviour"],"logger":"console"},"level":"log","message":"cozy-stack-client warn Selector fields should be manually indexed to prevent unexpected behaviour"},{"timestamp":1669390992.092,"category":"console","data":{"arguments":["cozy-stack-client","warn","Selector fields should be manually indexed to prevent unexpected behaviour"],"logger":"console"},"level":"log","message":"cozy-stack-client warn Selector fields should be manually indexed to prevent unexpected behaviour"},{"timestamp":1669390992.093,"category":"console","data":{"arguments":["cozy-stack-client","warn","Selector fields should be manually indexed to prevent unexpected behaviour"],"logger":"console"},"level":"log","message":"cozy-stack-client warn Selector fields should be manually indexed to prevent unexpected behaviour"},{"timestamp":1669390992.093,"category":"console","data":{"arguments":["cozy-stack-client","warn","Selector fields should be manually indexed to prevent unexpected behaviour"],"logger":"console"},"level":"log","message":"cozy-stack-client warn Selector fields should be manually indexed to prevent unexpected behaviour"},{"timestamp":1669390992.098,"category":"console","data":{"arguments":["cozy-stack-client","warn","Selector fields should be manually indexed to prevent unexpected behaviour"],"logger":"console"},"level":"log","message":"cozy-stack-client warn Selector fields should be manually indexed to prevent unexpected behaviour"},{"timestamp":1669390992.098,"category":"console","data":{"arguments":["cozy-stack-client","warn","Selector fields should be manually indexed to prevent unexpected behaviour"],"logger":"console"},"level":"log","message":"cozy-stack-client warn Selector fields should be manually indexed to prevent unexpected behaviour"},{"timestamp":1669390992.195,"category":"fetch","data":{"method":"POST","url":"http://cozy.tools:8080/data/com.grandlyon.grdf.day/_find","__span":"bb5c998e24f1ab9e","status_code":200},"type":"http"},{"timestamp":1669390992.195,"category":"fetch","data":{"method":"POST","url":"http://cozy.tools:8080/data/com.grandlyon.grdf.day/_find","status_code":200},"type":"http"},{"timestamp":1669390992.196,"category":"fetch","data":{"method":"POST","url":"http://cozy.tools:8080/data/com.grandlyon.grdf.day/_find","__span":"a6f4cdf60035a2b2","status_code":200},"type":"http"},{"timestamp":1669390992.196,"category":"fetch","data":{"method":"POST","url":"http://cozy.tools:8080/data/com.grandlyon.grdf.day/_find","status_code":200},"type":"http"},{"timestamp":1669390992.199,"category":"fetch","data":{"method":"POST","url":"http://cozy.tools:8080/data/com.grandlyon.grdf.day/_find","__span":"b0e4374559a7b4f1","status_code":200},"type":"http"},{"timestamp":1669390992.199,"category":"fetch","data":{"method":"POST","url":"http://cozy.tools:8080/data/com.grandlyon.grdf.day/_find","status_code":200},"type":"http"},{"timestamp":1669390992.203,"category":"fetch","data":{"method":"POST","url":"http://cozy.tools:8080/data/com.grandlyon.grdf.day/_find","__span":"b506d535a1c46a3f","status_code":200},"type":"http"},{"timestamp":1669390992.203,"category":"fetch","data":{"method":"POST","url":"http://cozy.tools:8080/data/com.grandlyon.grdf.day/_find","status_code":200},"type":"http"},{"timestamp":1669390992.215,"category":"fetch","data":{"method":"POST","url":"http://cozy.tools:8080/data/com.grandlyon.grdf.day/_find","__span":"9ad8d29913d17fad","status_code":200},"type":"http"},{"timestamp":1669390992.215,"category":"fetch","data":{"method":"POST","url":"http://cozy.tools:8080/data/com.grandlyon.grdf.day/_find","status_code":200},"type":"http"},{"timestamp":1669390992.223,"category":"redux.action","data":{"type":"SET_CURRENT_DATACHART","payload":{"actualData":["[Object]","[Object]","[Object]","[Object]","[Object]","[Object]","[Object]"],"comparisonData":["[Object]","[Object]","[Object]","[Object]","[Object]","[Object]","[Object]"]}},"type":"info"},{"timestamp":1669390992.239,"category":"redux.action","data":{"type":"SET_CURRENT_DATACHART_INDEX","payload":6},"type":"info"},{"timestamp":1669390992.255,"category":"redux.action","data":{"type":"SET_LOADING","payload":false},"type":"info"},{"timestamp":1669390992.287,"category":"redux.action","data":{"type":"SET_LOADING","payload":false},"type":"info"},{"timestamp":1669390992.312,"category":"fetch","data":{"method":"POST","url":"http://cozy.tools:8080/data/com.grandlyon.ecolyo.fluidsprices/_find","__span":"b3a1f9472bd365de","status_code":200},"type":"http"},{"timestamp":1669390992.312,"category":"fetch","data":{"method":"POST","url":"http://cozy.tools:8080/data/com.grandlyon.ecolyo.fluidsprices/_find","status_code":200},"type":"http"},{"timestamp":1669390993.329,"category":"sentry.transaction","event_id":"663309d8dbe14c98bb77c23d38ed31af","message":"663309d8dbe14c98bb77c23d38ed31af"},{"timestamp":1669391004.114,"category":"navigation","data":{"from":"/#/options","to":"/#/options"}},{"timestamp":1669391004.114,"category":"navigation","data":{"from":"/#/options","to":"/#/options"}},{"timestamp":1669391004.192,"category":"ui.click","message":"a.MuiTypography-root.MuiLink-root.MuiLink-underlineHover.c-nav-link.MuiTypography-colorPrimary.is-active"},{"timestamp":1669391004.193,"category":"ui.click","message":"a.MuiTypography-root.MuiLink-root.MuiLink-underlineHover.c-nav-link.MuiTypography-colorPrimary.is-active"},{"timestamp":1669391004.424,"category":"fetch","data":{"method":"GET","url":"http://cozy.tools:8080/settings/context","__span":"b55ec8be318aa094","status_code":200},"type":"http"},{"timestamp":1669391004.424,"category":"fetch","data":{"method":"GET","url":"http://cozy.tools:8080/settings/context","status_code":200},"type":"http"},{"timestamp":1669391004.424,"category":"fetch","data":{"method":"GET","url":"http://cozy.tools:8080/settings/instance","__span":"b19394a9a9521e29","status_code":200},"type":"http"},{"timestamp":1669391004.424,"category":"fetch","data":{"method":"GET","url":"http://cozy.tools:8080/settings/instance","status_code":200},"type":"http"},{"timestamp":1669391004.426,"category":"fetch","data":{"method":"GET","url":"http://cozy.tools:8080/settings/disk-usage","__span":"b3b7b09249367271","status_code":200},"type":"http"},{"timestamp":1669391004.426,"category":"fetch","data":{"method":"GET","url":"http://cozy.tools:8080/settings/disk-usage","status_code":200},"type":"http"},{"timestamp":1669391004.426,"category":"fetch","data":{"method":"POST","url":"http://cozy.tools:8080/data/com.grandlyon.ecolyo.usageevent/","__span":"93624145d5596126","status_code":201},"type":"http"},{"timestamp":1669391004.426,"category":"fetch","data":{"method":"POST","url":"http://cozy.tools:8080/data/com.grandlyon.ecolyo.usageevent/","status_code":201},"type":"http"},{"timestamp":1669391004.456,"category":"redux.action","data":{"type":"CHANGE_SCREEN_TYPE","payload":0},"type":"info"},{"timestamp":1669391004.494,"category":"fetch","data":{"method":"POST","url":"http://cozy.tools:8080/data/com.grandlyon.enedis.day/_find","__span":"af5a77a4a0a454a5","status_code":200},"type":"http"},{"timestamp":1669391004.494,"category":"fetch","data":{"method":"POST","url":"http://cozy.tools:8080/data/com.grandlyon.enedis.day/_find","status_code":200},"type":"http"},{"timestamp":1669391004.566,"category":"fetch","data":{"method":"POST","url":"http://cozy.tools:8080/data/com.grandlyon.egl.day/_find","__span":"a03ba0ae03453c16","status_code":200},"type":"http"},{"timestamp":1669391004.566,"category":"fetch","data":{"method":"POST","url":"http://cozy.tools:8080/data/com.grandlyon.egl.day/_find","status_code":200},"type":"http"},{"timestamp":1669391004.59,"category":"fetch","data":{"method":"POST","url":"http://cozy.tools:8080/data/com.grandlyon.grdf.day/_find","__span":"8b7f8ae948990564","status_code":200},"type":"http"},{"timestamp":1669391004.59,"category":"fetch","data":{"method":"POST","url":"http://cozy.tools:8080/data/com.grandlyon.grdf.day/_find","status_code":200},"type":"http"},{"timestamp":1669391004.599,"category":"fetch","data":{"method":"POST","url":"http://cozy.tools:8080/data/com.grandlyon.egl.day/_find","__span":"b2020a416bc3f700","status_code":200},"type":"http"},{"timestamp":1669391004.599,"category":"fetch","data":{"method":"POST","url":"http://cozy.tools:8080/data/com.grandlyon.egl.day/_find","status_code":200},"type":"http"}],"request":{"url":"http://ecolyo.cozy.tools:8080/#/options","headers":{"Referer":"http://ecolyo.cozy.tools:8080/","User-Agent":"Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1"}}} +} \ No newline at end of file diff --git a/src/services/environment.service.ts b/src/services/environment.service.ts index 62768a1b92467b66f0643775fc6fad7ce2c42f90..ab969e750bb0058e5db0e7ed7852414d2b84e3bb 100644 --- a/src/services/environment.service.ts +++ b/src/services/environment.service.ts @@ -2,11 +2,19 @@ declare const __IS_ALPHA__: boolean declare const __DEVELOPMENT__: boolean export default class EnvironmentService { - private isAlpha() { - if (__IS_ALPHA__) { - return __IS_ALPHA__ - } - return false + public isAlpha() { + return __IS_ALPHA__ + } + + public isLocal() { + return __DEVELOPMENT__ + } + + /** + * Returns true for local OR alpha + */ + public isDev() { + return __IS_ALPHA__ || __DEVELOPMENT__ } public isProduction() { @@ -15,6 +23,7 @@ export default class EnvironmentService { } return false } + public getPublicURL() { if (!this.isAlpha()) { return 'https://ecolyo-agent.apps.grandlyon.com' @@ -22,8 +31,4 @@ export default class EnvironmentService { return 'https://ecolyo-agent-rec.grandlyon.com' } } - - public isLocal() { - return __DEVELOPMENT__ - } } diff --git a/src/targets/browser/index.tsx b/src/targets/browser/index.tsx index f20e22305832517ec9b6d47abc6a53929f6096e4..483eff72d046352b09e8943478b335f93d956d76 100644 --- a/src/targets/browser/index.tsx +++ b/src/targets/browser/index.tsx @@ -3,6 +3,7 @@ declare let cozy: any declare let __PIWIK_TRACKER_URL__: string declare let __PIWIK_SITEID__: number +declare let __SENTRY_DSN__: string declare let Piwik: any import '../../styles/index.scss' @@ -22,6 +23,7 @@ import { HashRouter } from 'react-router-dom' import MatomoTracker from 'utils/matomoTracker' import * as Sentry from '@sentry/react' import { BrowserTracing } from '@sentry/tracing' +import EnvironmentService from 'services/environment.service' const setupApp = memoize(() => { const history: History = createBrowserHistory() @@ -48,6 +50,7 @@ const setupApp = memoize(() => { const persistedState: any = {} const store: any = configureStore(client, persistedState) + const development = new EnvironmentService().isDev() cozy.bar.init({ appName: data.app.name, @@ -73,7 +76,7 @@ const setupApp = memoize(() => { } Sentry.init({ - dsn: 'https://c868f6010f3f431d95be8f70d7f37666@grandlyon.errors.cozycloud.cc/6', + dsn: __SENTRY_DSN__, integrations: [new BrowserTracing()], // Set tracesSampleRate to 1.0 to capture 100% // of transactions for performance monitoring. @@ -82,7 +85,7 @@ const setupApp = memoize(() => { // Custom settings below release: client.appMetadata.version, - environment: 'development', // Set to development | alpha | prod + environment: development ? 'development' : 'production', }) return { root, store, client, locale, polyglot, history, tracker }