Fix #5857 Add icon for foreign key constraint (#5904)

* Fix #5857 Add icon for foreign key constraint

* Change icon to line icon
This commit is contained in:
Sachin Chaurasiya 2022-07-07 12:48:20 +05:30 committed by GitHub
parent e6bb85fae8
commit c07a155614
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 39 additions and 4 deletions

View File

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 250 250" style="enable-background:new 0 0 250 250;" xml:space="preserve">
<g>
<path d="M198.1,173.7c-13.5,0-24.4,11-24.4,24.4s11,24.4,24.4,24.4c13.5,0,24.4-11,24.4-24.4S211.6,173.7,198.1,173.7z
M198.1,210.3c-6.7,0-12.1-5.4-12.1-12.1c0-6.7,5.4-12.1,12.1-12.1s12.1,5.4,12.1,12.1C210.3,204.8,204.8,210.3,198.1,210.3z"/>
<path d="M198.1,146.3c-17.4,0-33.5,8.8-43.2,23.5l-5.5,8.4v-10V97.6v-3h3h9.1h3v3v18.3c0,3.4,2.8,6.1,6.2,6.1h1.2l0,0h71.9
c3.4,0,6.1-2.8,6.1-6.1l0-109.7c0-3.4-2.8-6.1-6.1-6.1h-73.1c-3.4,0-6.1,2.8-6.1,6.1v73.1v3h-3h-18.3c-3.4,0-6.1,2.8-6.1,6.1v82.3
v3h-3h-18.3h-3v-3l0-118.9c0-3.4-2.8-6.1-6.1-6.1H88.4h-3v-3V6.1c0-3.4-2.8-6.1-6.1-6.1H6.1C2.8,0,0,2.8,0,6.1v109.7
c0,3.4,2.8,6.1,6.1,6.1h73.1c3.4,0,6.1-2.8,6.1-6.1V61v-3h3h9.1h3v3v109.7v3h-3h-64c-1.2,0-2.4,0.4-3.4,1L2.7,193
C1,194.2,0,196.1,0,198.1c0,2.1,1,4,2.7,5.1l27.4,18.3c1,0.7,2.2,1,3.4,1h25.3h0.7l0.6,0.3l16.4,8.2c0.8,0.4,1.8,0.6,2.7,0.6
c1,0,1.9-0.2,2.8-0.7l14.2-7.1l1.3-0.7l1.3,0.7l14.2,7.1c0.8,0.4,1.8,0.7,2.7,0.7c1,0,1.9-0.2,2.8-0.7l16.3-8.2l0.6-0.3h0.7h14.4
h1.7l0.9,1.5c9.2,16,26.4,25.9,44.9,25.9c28.6,0,51.9-23.3,51.9-51.9C250,169.5,226.7,146.3,198.1,146.3z M176.9,24.4v-9.1v-3h3
h54.9h3v3v9.1v3h-3h-54.9h-3V24.4z M176.9,106.7v-64v-3h3h54.9h3v3v64v3h-3h-54.9h-3V106.7z M12.3,24.4v-9.1v-3h3h54.9h3v3v9.1v3
l-3,0l-54.9,0l-3,0V24.4z M73.1,42.7l0,64l0,3h-3H15.3h-3v-3v-64v-3h3h54.9h3L73.1,42.7z M198.1,237.7c-15.7,0-29.9-9.3-36.2-23.7
c-1-2.2-3.2-3.7-5.6-3.7h-22.1c-1,0-1.9,0.2-2.7,0.6l-14.2,7.1l-1.3,0.7l-1.3-0.7l-14.2-7.1c-0.8-0.4-1.8-0.6-2.7-0.6
c-1,0-1.9,0.2-2.8,0.7L80.6,218l-1.3,0.7l-1.3-0.7l-14.2-7.1c-0.8-0.4-1.8-0.7-2.7-0.7H36.3h-0.9l-0.8-0.5L21,200.6l-3.7-2.5
l3.7-2.5l13.7-9.1l0.8-0.5h0.9h119.9c2.4,0,4.7-1.4,5.6-3.7c6.3-14.4,20.5-23.7,36.2-23.7c21.8,0,39.6,17.8,39.6,39.6
S220,237.7,198.1,237.7z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@ -16,6 +16,7 @@ export enum ConstraintTypes {
NULL = 'NULL',
NOT_NULL = 'NOT_NULL',
UNIQUE = 'UNIQUE',
FOREIGN_KEY = 'FOREIGN_KEY',
}
export enum PrimaryTableDataTypes {

View File

@ -61,6 +61,7 @@ import IconExternalLinkWhite from '../assets/svg/external-link-white.svg';
import IconExternalLink from '../assets/svg/external-link.svg';
import IconFailBadge from '../assets/svg/fail-badge.svg';
import IconFitView from '../assets/svg/fitview.svg';
import IconForeignKey from '../assets/svg/foriegnKey.svg';
import IconGithubStar from '../assets/svg/github-star.svg';
import IconAllApplication from '../assets/svg/ic-all-application.svg';
import IconCheckCircle from '../assets/svg/ic-check-circle.svg';
@ -319,6 +320,7 @@ export const Icons = {
TASK_ICON: 'task-icon',
TASK_CLOSED: 'task-closed',
TASK_OPEN: 'task-open',
FOREGIN_KEY: 'foreign-key',
};
const SVGIcons: FunctionComponent<Props> = ({
@ -933,6 +935,10 @@ const SVGIcons: FunctionComponent<Props> = ({
case Icons.TASK_OPEN:
IconComponent = IconTaskOpen;
break;
case Icons.FOREGIN_KEY:
IconComponent = IconForeignKey;
break;
default:

View File

@ -39,7 +39,7 @@ import { TagLabel } from '../generated/type/tagLabel';
import { ModifiedTableColumn } from '../interface/dataQuality.interface';
import { getGlossaryPath } from './RouterUtils';
import { ordinalize } from './StringsUtils';
import SVGIcons from './SvgUtils';
import SVGIcons, { Icons } from './SvgUtils';
export const getBadgeName = (tableType?: string) => {
switch (tableType) {
@ -130,21 +130,28 @@ export const getConstraintIcon = (constraint = '', className = '') => {
case ConstraintTypes.PRIMARY_KEY:
{
title = 'Primary key';
icon = 'key';
icon = Icons.KEY;
}
break;
case ConstraintTypes.UNIQUE:
{
title = 'Unique';
icon = 'unique';
icon = Icons.UNIQUE;
}
break;
case ConstraintTypes.NOT_NULL:
{
title = 'Not null';
icon = 'not-null';
icon = Icons.NOT_NULL;
}
break;
case ConstraintTypes.FOREIGN_KEY:
{
title = 'Foreign key';
icon = Icons.FOREGIN_KEY;
}
break;