[GitHub] [incubator-apisix-dashboard] juzhiyuan commented on a change in pull request #208: feature: change request prefix

2020-05-21 Thread GitBox


juzhiyuan commented on a change in pull request #208:
URL: 
https://github.com/apache/incubator-apisix-dashboard/pull/208#discussion_r428632233



##
File path: src/app.tsx
##
@@ -31,14 +31,14 @@ export async function getInitialState(): Promise<{
 }
 
 export const layout = ({
-  initialState,
-}: {
+ initialState,
+   }: {
   initialState: { settings?: LayoutSettings };
 }): BasicLayoutProps => {
   return {
-rightContentRender: () => ,
+rightContentRender: () => ,
 disableContentMargin: false,
-footerRender: () => ,
+footerRender: () => ,

Review comment:
   lint codes too

##
File path: src/app.tsx
##
@@ -85,12 +85,10 @@ const errorHandler = (error: { response: Response; data: 
any }): Promise

[GitHub] [incubator-apisix-dashboard] juzhiyuan commented on a change in pull request #208: feature: change request prefix

2020-05-21 Thread GitBox


juzhiyuan commented on a change in pull request #208:
URL: 
https://github.com/apache/incubator-apisix-dashboard/pull/208#discussion_r428633572



##
File path: config/config.ts
##
@@ -2,7 +2,13 @@ import { defineConfig } from 'umi';
 import defaultSettings from './defaultSettings';
 import proxy from './proxy';
 
-const { REACT_APP_ENV } = process.env;
+const { REACT_APP_ENV, NETLIFY_DEMO, NODE_ENV } = process.env;
+
+const getRequestPrefix = () => {
+  if (NETLIFY_DEMO) return '/api';

Review comment:
   
https://deploy-preview-208--apisix-dashboard.netlify.app/dashboard/settings





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [incubator-apisix-dashboard] juzhiyuan commented on a change in pull request #208: feature: change request prefix

2020-05-21 Thread GitBox


juzhiyuan commented on a change in pull request #208:
URL: 
https://github.com/apache/incubator-apisix-dashboard/pull/208#discussion_r428631987



##
File path: config/config.ts
##
@@ -2,7 +2,13 @@ import { defineConfig } from 'umi';
 import defaultSettings from './defaultSettings';
 import proxy from './proxy';
 
-const { REACT_APP_ENV } = process.env;
+const { REACT_APP_ENV, NETLIFY_DEMO, NODE_ENV } = process.env;
+
+const getRequestPrefix = () => {
+  if (NETLIFY_DEMO) return '/api';

Review comment:
   
![image](https://user-images.githubusercontent.com/2106987/82560915-eeb4f580-9ba4-11ea-8fc5-26a8e619fffb.png)
   





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [incubator-apisix-dashboard] juzhiyuan commented on a change in pull request #208: feature: change request prefix

2020-05-21 Thread GitBox


juzhiyuan commented on a change in pull request #208:
URL: 
https://github.com/apache/incubator-apisix-dashboard/pull/208#discussion_r428631855



##
File path: config/config.ts
##
@@ -2,7 +2,13 @@ import { defineConfig } from 'umi';
 import defaultSettings from './defaultSettings';
 import proxy from './proxy';
 
-const { REACT_APP_ENV } = process.env;
+const { REACT_APP_ENV, NETLIFY_DEMO, NODE_ENV } = process.env;
+
+const getRequestPrefix = () => {
+  if (NETLIFY_DEMO) return '/api';

Review comment:
   it seems not to work on Netlify...
   
   
![image](https://user-images.githubusercontent.com/2106987/82560893-e1980680-9ba4-11ea-92c0-aef296f0886e.png)
   





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [incubator-apisix-dashboard] juzhiyuan commented on a change in pull request #208: feature: change request prefix

2020-05-21 Thread GitBox


juzhiyuan commented on a change in pull request #208:
URL: 
https://github.com/apache/incubator-apisix-dashboard/pull/208#discussion_r428628345



##
File path: src/app.tsx
##
@@ -31,14 +31,14 @@ export async function getInitialState(): Promise<{
 }
 
 export const layout = ({
-  initialState,
-}: {
+ initialState,

Review comment:
   codes clean





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org