这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import Helmet from 'react-helmet';
import globals from '../../../../Globals';
import { changeTableOrViewName } from '../TableModify/ModifyActions';
import EditableHeading from '../../../Common/EditableHeading/EditableHeading';
import BreadCrumb from '../../../Common/Layout/BreadCrumb/BreadCrumb';
import { tabNameMap } from '../utils';

const ViewHeader = ({
Expand Down Expand Up @@ -38,28 +39,38 @@ const ViewHeader = ({
)
);
};

const getBreadCrumbs = () => {
return [
{
title: 'Data',
url: '/data',
},
{
title: 'Schema',
url: '/data/schema/',
},
{
title: currentSchema,
url: '/data/schema/' + currentSchema,
},
{
title: tableName,
url:
'/data/schema/' + currentSchema + '/views/' + tableName + '/browse',
},
{
title: activeTab,
url: null,
},
];
};

return (
<div>
<Helmet title={capitalised + ' - ' + tableName + ' - Data | Hasura'} />
<div className={styles.subHeader}>
<div className={styles.dataBreadCrumb}>
You are here: <Link to={'/data/schema/' + currentSchema}>Data</Link>{' '}
<i className="fa fa-angle-right" aria-hidden="true" />{' '}
<Link to={'/data/schema/' + currentSchema}>Schema</Link>{' '}
<i className="fa fa-angle-right" aria-hidden="true" />{' '}
<Link
to={
'/data/schema/' +
currentSchema +
'/views/' +
tableName +
'/browse'
}
>
{tableName}
</Link>{' '}
<i className="fa fa-angle-right" aria-hidden="true" /> {activeTab}
</div>
<BreadCrumb breadCrumbs={getBreadCrumbs()} />
<EditableHeading
currentValue={tableName}
save={saveViewNameChange}
Expand Down
48 changes: 28 additions & 20 deletions console/src/components/Services/Data/TableCommon/TableHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { Link } from 'react-router';
import Helmet from 'react-helmet';
import { changeTableOrViewName } from '../TableModify/ModifyActions';
import EditableHeading from '../../../Common/EditableHeading/EditableHeading';
import BreadCrumb from '../../../Common/Layout/BreadCrumb/BreadCrumb';
import { tabNameMap } from '../utils';

const TableHeader = ({
Expand Down Expand Up @@ -45,30 +46,37 @@ const TableHeader = ({
);
};

const getBreadCrumbs = () => {
return [
{
title: 'Data',
url: '/data',
},
{
title: 'Schema',
url: '/data/schema/',
},
{
title: currentSchema,
url: '/data/schema/' + currentSchema,
},
{
title: tableName,
url:
'/data/schema/' + currentSchema + '/tables/' + tableName + '/browse',
},
{
title: activeTab,
url: null,
},
];
};

return (
<div>
<Helmet title={capitalised + ' - ' + tableName + ' - Data | Hasura'} />
<div className={styles.subHeader}>
<div className={styles.dataBreadCrumb}>
You are here: <Link to={'/data/schema/' + currentSchema}>Data</Link>{' '}
<i className="fa fa-angle-right" aria-hidden="true" />{' '}
<Link to={'/data/schema/' + currentSchema}>Schema</Link>{' '}
<i className="fa fa-angle-right" aria-hidden="true" />{' '}
<Link to={'/data/schema/' + currentSchema}>{currentSchema}</Link>{' '}
<i className="fa fa-angle-right" aria-hidden="true" />{' '}
<Link
to={
'/data/schema/' +
currentSchema +
'/tables/' +
tableName +
'/browse'
}
>
{tableName}
</Link>{' '}
<i className="fa fa-angle-right" aria-hidden="true" /> {activeTab}
</div>
<BreadCrumb breadCrumbs={getBreadCrumbs()} />
<EditableHeading
currentValue={tableName}
save={saveTableNameChange}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,11 @@ const ColumnEditorList = ({
}) => {
const tableName = tableSchema.table_name;

let pkLength = 0;
const columnPKConstraints = {};
if (tableSchema.primary_key) {
pkLength = tableSchema.primary_key.columns.length;

tableSchema.primary_key.columns.forEach(col => {
columnPKConstraints[col] = tableSchema.primary_key.constraint_name;
});
Expand Down Expand Up @@ -55,7 +58,11 @@ const ColumnEditorList = ({
type: col.udt_name,
isNullable: col.is_nullable === 'YES',
pkConstraint: columnPKConstraints[colName],
isUnique: columnUniqueConstraints[colName] ? true : false,
isUnique:
(columnPKConstraints[colName] && pkLength === 1) ||
columnUniqueConstraints[colName]
? true
: false,
// uniqueConstraint: columnUniqueConstraints[colName],
default: col.column_default || '',
};
Expand Down
2 changes: 1 addition & 1 deletion console/src/components/Services/Data/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export const getPlaceholder = type => {
};

export const tabNameMap = {
view: 'Browse Rows',
browse: 'Browse Rows',
insert: 'Insert Row',
modify: 'Modify',
relationships: 'Relationships',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from 'react';
import { Link } from 'react-router';
import Helmet from 'react-helmet';
import BreadCrumb from '../../../Common/Layout/BreadCrumb/BreadCrumb';

const TableHeader = ({ triggerName, tabName, count }) => {
const styles = require('./EventTable.scss');
Expand All @@ -20,24 +21,39 @@ const TableHeader = ({ triggerName, tabName, count }) => {
} else if (tabName === 'logs') {
activeTab = 'Logs';
}

const getBreadCrumbs = () => {
return [
{
title: 'Events',
url: '/events',
},
{
title: 'Manage',
url: '/events/manage',
},
{
title: 'Triggers',
url: '/events/manage/triggers/',
},
{
title: triggerName,
url: '/events/manage/triggers/' + triggerName + '/processed',
},
{
title: activeTab,
url: null,
},
];
};

return (
<div>
<Helmet
title={capitalised + ' - ' + triggerName + ' - Event Triggers | Hasura'}
/>
<div className={styles.subHeader}>
<div className={styles.dataBreadCrumb}>
You are here: <Link to={'/events'}>Events</Link>{' '}
<i className="fa fa-angle-right" aria-hidden="true" />{' '}
<Link to={'/events/manage'}>Manage</Link>{' '}
<i className="fa fa-angle-right" aria-hidden="true" />{' '}
<Link to={'/events/manage/triggers'}>Triggers</Link>{' '}
<i className="fa fa-angle-right" aria-hidden="true" />{' '}
<Link to={'/events/manage/triggers/' + triggerName + '/processed'}>
{triggerName}
</Link>{' '}
<i className="fa fa-angle-right" aria-hidden="true" /> {activeTab}
</div>
<BreadCrumb breadCrumbs={getBreadCrumbs()} />
<h2 className={styles.heading_text}>{triggerName}</h2>
<div className={styles.nav}>
<ul className="nav nav-pills">
Expand Down