这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
d6b77be
fix CLI console subscriptions connect via WS instead of WSS on HTTPS/…
arvi3411301 Jun 13, 2019
41ce10e
Merge branch 'master' of github.com:hasura/graphql-engine into issue-…
arvi3411301 Jun 17, 2019
367f175
fix to create down migration on dropping a column, close #2291
arvi3411301 Jun 17, 2019
a6a7ae7
use column udt_name as column type
arvi3411301 Jun 17, 2019
074c4b6
Merge branch 'master' into issue-2291
rikinsk Jun 18, 2019
0c1487e
Merge branch 'master' into issue-2291
arvi3411301 Jun 19, 2019
c8bdb26
Merge branch 'issue-2291' of github.com:arvi3411301/graphql-engine in…
arvi3411301 Jun 19, 2019
8adc5b9
fix review comments
arvi3411301 Jun 19, 2019
1e6a38a
remove reqBody from showErrorNotification
arvi3411301 Jun 19, 2019
1a77d67
Merge branch 'master' into issue-2291
arvi3411301 Jun 20, 2019
1fae0e3
fix notifications
rikinsk Jun 20, 2019
4c96399
update modify behavipur
rikinsk Jun 25, 2019
28232bb
fix notifications
rikinsk Jun 25, 2019
cfd2c87
Merge branch 'master' into issue-2291
rikinsk Jun 25, 2019
5372d5f
update notifications
rikinsk Jun 25, 2019
2d81779
show comment in col summary
rikinsk Jun 25, 2019
32479b1
fix error handling
rikinsk Jun 26, 2019
3104cb2
add constraints to down migration
arvi3411301 Jun 26, 2019
c9f36e8
Merge branch 'issue-2291' of github.com:arvi3411301/graphql-engine in…
arvi3411301 Jun 26, 2019
b1fff61
add column default to down migration
arvi3411301 Jun 26, 2019
a510ffc
Merge branch 'issue-2291' of github.com:arvi3411301/graphql-engine in…
rikinsk Jun 26, 2019
f9c1023
fix test
rikinsk Jun 26, 2019
956b9d2
add opp_foreign_key_constraints to down migration and cascade to drop…
arvi3411301 Jun 26, 2019
99fa312
Merge branch 'issue-2291' of github.com:arvi3411301/graphql-engine in…
arvi3411301 Jun 26, 2019
3013d8e
Merge branch 'master' into issue-2291
rikinsk Jun 26, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion cli/migrate/api/migrate.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package api

import (
"fmt"
"net/http"
"net/url"
"strings"
Expand Down Expand Up @@ -130,7 +131,7 @@ func MigrateAPI(c *gin.Context) {
c.JSON(http.StatusInternalServerError, &Response{Code: "internal_error", Message: err.Error()})
return
}
c.JSON(http.StatusOK, &Response{Name: request.Name})
c.JSON(http.StatusOK, &Response{Name: fmt.Sprintf("%d_%s", timestamp, request.Name)})
default:
c.JSON(http.StatusMethodNotAllowed, &gin.H{"message": "Method not allowed"})
}
Expand Down
3 changes: 1 addition & 2 deletions console/cypress/integration/data/modify/spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,7 @@ export const passRemoveUniqueKey = () => {
};

export const passMTDeleteCol = () => {
// cy.get(getElementFromAlias(`edit-${getColName(0)}`)).click();
// cy.wait(500);
cy.get(getElementFromAlias('modify-table-edit-column-1')).click();
cy.get(getElementFromAlias('modify-table-column-1-remove')).click();
cy.on('window:alert', str => {
expect(str === 'Are you sure you want to delete?').to.be.true;
Expand Down
28 changes: 2 additions & 26 deletions console/src/components/App/Actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,31 +40,8 @@ const showNotification = ({
Notifications.show(
{
position,
autoDismiss: level === 'error' ? 0 : 5,
dismissible: level === 'error' ? 'click' : 'both',
children: json ? jsonFormat(json) : null,
...options,
},
level
)
);
};
};

const showTempNotification = ({
level = 'info',
position = 'tr',
json,
...options
} = {}) => {
return dispatch => {
dispatch(Notifications.removeAll());
dispatch(
Notifications.show(
{
position,
autoDismiss: 2,
dismissible: 'both',
autoDismiss: ['error', 'warning'].includes(level) ? 0 : 5,
dismissible: ['error', 'warning'].includes(level) ? 'button' : 'both',
children: json ? jsonFormat(json) : null,
...options,
},
Expand Down Expand Up @@ -161,5 +138,4 @@ export {
notifExpand,
notifMsg,
showNotification,
showTempNotification,
};
4 changes: 4 additions & 0 deletions console/src/components/Common/Common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -853,6 +853,10 @@ code {
background: #f2f2f2 !important;
}

.text_gray {
color: #767E96
}

.docsButton {
background-color: #fff;
border-radius: 5px;
Expand Down
42 changes: 31 additions & 11 deletions console/src/components/Services/Common/Notification.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import React from 'react';
import AceEditor from 'react-ace';
import { showNotification, showTempNotification } from '../../App/Actions';
import { showNotification } from '../../App/Actions';
import { notifExpand, notifMsg } from '../../App/Actions';
import Button from '../../Common/Button/Button';

const styles = require('../../Common/TableCommon/Table.scss');

const showErrorNotification = (title, message, reqBody, error) => {
const showErrorNotification = (title, message, error) => {
let modMessage;
let refreshBtn;

Expand Down Expand Up @@ -36,7 +36,7 @@ const showErrorNotification = (title, message, reqBody, error) => {
} else {
modMessage = error.code;
}
} else if (error && 'internal' in error) {
} else if (error && 'internal' in error && 'error' in error.internal) {
modMessage = error.code + ' : ' + error.internal.error.message;
} else if (error && 'custom' in error) {
modMessage = error.custom;
Expand Down Expand Up @@ -146,25 +146,45 @@ const showSuccessNotification = (title, message) => {
};
};

const showTempErrorNotification = (title, message) => {
const showInfoNotification = title => {
return dispatch => {
dispatch(
showTempNotification({
level: 'error',
showNotification({
title,
message: message ? message : null,
autoDismiss: 3,
autoDismiss: 0,
})
);
};
};

const showInfoNotification = title => {
const showWarningNotification = (title, message, dataObj) => {
const children = [];
if (dataObj) {
children.push(
<div className={styles.aceBlock}>
<AceEditor
readOnly
showPrintMargin={false}
mode="json"
showGutter={false}
theme="github"
name="notification-response"
value={JSON.stringify(dataObj, null, 4)}
minLines={1}
maxLines={15}
width="100%"
/>
</div>
);
}

return dispatch => {
dispatch(
showNotification({
level: 'warning',
title,
autoDismiss: 0,
message,
children,
})
);
};
Expand All @@ -174,5 +194,5 @@ export {
showErrorNotification,
showSuccessNotification,
showInfoNotification,
showTempErrorNotification,
showWarningNotification,
};
7 changes: 0 additions & 7 deletions console/src/components/Services/Data/Add/AddTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ class AddTable extends Component {
showErrorNotification(
'Error creating table!',
'Minimum one column required',
'',
{
custom: ATLEAST_ONE_COLUMN_MSG,
}
Expand All @@ -155,7 +154,6 @@ class AddTable extends Component {
showErrorNotification(
'Error creating table!',
'Column name cannot be empty',
'',
{
custom: 'Column name cannot be empty',
}
Expand All @@ -167,7 +165,6 @@ class AddTable extends Component {
showErrorNotification(
gqlColumnErrorNotif[0],
gqlColumnErrorNotif[1],
gqlColumnErrorNotif[2],
gqlColumnErrorNotif[3]
)
);
Expand All @@ -192,7 +189,6 @@ class AddTable extends Component {
showErrorNotification(
gqlColumnErrorNotif[0],
gqlColumnErrorNotif[1],
gqlColumnErrorNotif[2],
gqlColumnErrorNotif[3]
)
);
Expand All @@ -214,7 +210,6 @@ class AddTable extends Component {
showErrorNotification(
'Error creating table!',
'Select atleast one primary key',
'',
{
custom: ATLEAST_ONE_PRIMARY_KEY_MSG,
}
Expand All @@ -233,7 +228,6 @@ class AddTable extends Component {
showErrorNotification(
'Error creating table!',
'Table name cannot be empty',
'',
{
custom: 'Table name cannot be empty. Please add a name',
}
Expand All @@ -245,7 +239,6 @@ class AddTable extends Component {
showErrorNotification(
gqlTableErrorNotif[0],
gqlTableErrorNotif[1],
gqlTableErrorNotif[2],
gqlTableErrorNotif[3]
)
);
Expand Down
24 changes: 6 additions & 18 deletions console/src/components/Services/Data/DataActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -435,34 +435,23 @@ const setTable = tableName => ({ type: SET_TABLE, tableName });
/* **********Shared functions between table actions********* */

const handleMigrationErrors = (title, errorMsg) => dispatch => {
const requestMsg = title;
if (globals.consoleMode === SERVER_CONSOLE_MODE) {
// handle errors for run_sql based workflow
dispatch(showErrorNotification(title, errorMsg.code, requestMsg, errorMsg));
dispatch(showErrorNotification(title, errorMsg.code, errorMsg));
} else if (errorMsg.code === 'migration_failed') {
dispatch(
showErrorNotification(title, 'Migration Failed', requestMsg, errorMsg)
);
dispatch(showErrorNotification(title, 'Migration Failed', errorMsg));
} else if (errorMsg.code === 'data_api_error') {
const parsedErrorMsg = errorMsg;
parsedErrorMsg.message = JSON.parse(errorMsg.message);
dispatch(
showErrorNotification(
title,
parsedErrorMsg.message.error,
requestMsg,
parsedErrorMsg
)
showErrorNotification(title, parsedErrorMsg.message.error, parsedErrorMsg)
);
} else {
// any other unhandled codes
const parsedErrorMsg = errorMsg;
parsedErrorMsg.message = JSON.parse(errorMsg.message);
dispatch(
showErrorNotification(title, errorMsg.code, requestMsg, parsedErrorMsg)
);
dispatch(showErrorNotification(title, errorMsg.code, parsedErrorMsg));
}
// dispatch(showErrorNotification(msg, firstDisplay, request, response));
};

const makeMigrationCall = (
Expand Down Expand Up @@ -512,7 +501,7 @@ const makeMigrationCall = (
body: JSON.stringify(finalReqBody),
};

const onSuccess = () => {
const onSuccess = data => {
if (!shouldSkipSchemaReload) {
if (globals.consoleMode === 'cli') {
dispatch(loadMigrationStatus()); // don't call for server mode
Expand All @@ -522,7 +511,7 @@ const makeMigrationCall = (
if (successMsg) {
dispatch(showSuccessNotification(successMsg));
}
customOnSuccess();
customOnSuccess(data, globals.consoleMode, currMigrationMode);
};

const onError = err => {
Expand Down Expand Up @@ -600,7 +589,6 @@ const fetchColumnTypeInfo = () => {
showErrorNotification(
'Error fetching column types',
'Kindly reach out to us in case you face this issue again',
error,
error
)
);
Expand Down
1 change: 0 additions & 1 deletion console/src/components/Services/Data/RawSQL/Actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ const executeSQL = (isMigration, migrationName) => (dispatch, getState) => {
showErrorNotification(
'SQL execution failed!',
'Something is wrong. Data sent back an invalid response json.',
requestBody,
parsedErrorMsg
)
);
Expand Down
1 change: 0 additions & 1 deletion console/src/components/Services/Data/Schema/Actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ export const createNewSchema = (schemaName, successCb, errorCb) => {
showErrorNotification(
gqlSchemaErrorNotif[0],
gqlSchemaErrorNotif[1],
gqlSchemaErrorNotif[2],
gqlSchemaErrorNotif[3]
)
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,7 @@ const editItem = (tableName, colValues) => {
);
},
err => {
dispatch(
showErrorNotification('Edit failed!', err.error, reqBody, err)
);
dispatch(showErrorNotification('Edit failed!', err.error, err));
}
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,7 @@ const deleteItem = pkClause => {
);
},
err => {
dispatch(
showErrorNotification('Deleting row failed!', err.error, reqBody, err)
);
dispatch(showErrorNotification('Deleting row failed!', err.error, err));
}
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,7 @@ const insertItem = (tableName, colValues) => {
);
},
err => {
dispatch(
showErrorNotification('Insert failed!', err.error, reqBody, err)
);
dispatch(showErrorNotification('Insert failed!', err.error, err));
}
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ const useColumnEditor = (dispatch, tableName) => {
showErrorNotification(
gqlColumnErrorNotif[0],
gqlColumnErrorNotif[1],
gqlColumnErrorNotif[2],
gqlColumnErrorNotif[3]
)
);
Expand All @@ -47,7 +46,6 @@ const useColumnEditor = (dispatch, tableName) => {
showErrorNotification(
'Error creating column!',
'Column name/type cannot be empty',
'',
{
custom: 'Column name/type cannot be empty',
}
Expand Down
Loading