mirror of
				https://github.com/open-metadata/OpenMetadata.git
				synced 2025-10-31 10:39:30 +00:00 
			
		
		
		
	Added icon for external link (#507)
* Added icon for external link * added externallink to need help options
This commit is contained in:
		
							parent
							
								
									3c390ce825
								
							
						
					
					
						commit
						bdcbcc08c8
					
				| @ -0,0 +1 @@ | |||||||
|  | <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1792 1792" fill="#5523E0"><path d="M1408 928v320q0 119-84.5 203.5t-203.5 84.5h-832q-119 0-203.5-84.5t-84.5-203.5v-832q0-119 84.5-203.5t203.5-84.5h704q14 0 23 9t9 23v64q0 14-9 23t-23 9h-704q-66 0-113 47t-47 113v832q0 66 47 113t113 47h832q66 0 113-47t47-113v-320q0-14 9-23t23-9h64q14 0 23 9t9 23zm384-864v512q0 26-19 45t-45 19-45-19l-176-176-652 652q-10 10-23 10t-23-10l-114-114q-10-10-10-23t10-23l652-652-176-176q-19-19-19-45t19-45 45-19h512q26 0 45 19t19 45z"/></svg> | ||||||
| After Width: | Height: | Size: 520 B | 
| @ -106,7 +106,7 @@ const Appbar: React.FC = (): JSX.Element => { | |||||||
|       ), |       ), | ||||||
|     }, |     }, | ||||||
|     { |     { | ||||||
|       name: `Slack Channel`, |       name: `Slack`, | ||||||
|       to: 'https://openmetadata.slack.com/join/shared_invite/zt-udl8ris3-Egq~YtJU_yJgJTtROo00dQ#/shared-invite/email', |       to: 'https://openmetadata.slack.com/join/shared_invite/zt-udl8ris3-Egq~YtJU_yJgJTtROo00dQ#/shared-invite/email', | ||||||
|       disabled: false, |       disabled: false, | ||||||
|       isOpenNewTab: true, |       isOpenNewTab: true, | ||||||
| @ -252,8 +252,8 @@ const Appbar: React.FC = (): JSX.Element => { | |||||||
|                       <IconDefaultUserProfile |                       <IconDefaultUserProfile | ||||||
|                         className="" |                         className="" | ||||||
|                         style={{ |                         style={{ | ||||||
|                           height: '24px', |                           height: '22px', | ||||||
|                           width: '24px', |                           width: '22px', | ||||||
|                           borderRadius: '50%', |                           borderRadius: '50%', | ||||||
|                         }} |                         }} | ||||||
|                       /> |                       /> | ||||||
|  | |||||||
| @ -18,6 +18,7 @@ | |||||||
| import classNames from 'classnames'; | import classNames from 'classnames'; | ||||||
| import React from 'react'; | import React from 'react'; | ||||||
| import { Link } from 'react-router-dom'; | import { Link } from 'react-router-dom'; | ||||||
|  | import SVGIcons from '../../utils/SvgUtils'; | ||||||
| import { DropDownListItem, DropDownListProp } from './types'; | import { DropDownListItem, DropDownListProp } from './types'; | ||||||
| 
 | 
 | ||||||
| const AnchorDropDownList = ({ dropDownList, setIsOpen }: DropDownListProp) => { | const AnchorDropDownList = ({ dropDownList, setIsOpen }: DropDownListProp) => { | ||||||
| @ -54,9 +55,37 @@ const AnchorDropDownList = ({ dropDownList, setIsOpen }: DropDownListProp) => { | |||||||
|                   setIsOpen && setIsOpen(false); |                   setIsOpen && setIsOpen(false); | ||||||
|                 }}> |                 }}> | ||||||
|                 {item.icon ? ( |                 {item.icon ? ( | ||||||
|                   <button className="tw-text-grey-body">{item.name}</button> |                   <button className="tw-text-grey-body"> | ||||||
|  |                     {item.isOpenNewTab ? ( | ||||||
|  |                       <span className="tw-flex"> | ||||||
|  |                         <span className="tw-mr-1">{item.name}</span> | ||||||
|  |                         <SVGIcons | ||||||
|  |                           alt="external-link" | ||||||
|  |                           className="tw-align-middle" | ||||||
|  |                           icon="external-link" | ||||||
|  |                           width="12px" | ||||||
|  |                         /> | ||||||
|  |                       </span> | ||||||
|                     ) : ( |                     ) : ( | ||||||
|                       item.name |                       item.name | ||||||
|  |                     )}{' '} | ||||||
|  |                   </button> | ||||||
|  |                 ) : ( | ||||||
|  |                   <> | ||||||
|  |                     {item.isOpenNewTab ? ( | ||||||
|  |                       <span className="tw-flex"> | ||||||
|  |                         <span className="tw-mr-1">{item.name}</span> | ||||||
|  |                         <SVGIcons | ||||||
|  |                           alt="external-link" | ||||||
|  |                           className="tw-align-middle" | ||||||
|  |                           icon="external-link" | ||||||
|  |                           width="12px" | ||||||
|  |                         /> | ||||||
|  |                       </span> | ||||||
|  |                     ) : ( | ||||||
|  |                       item.name | ||||||
|  |                     )} | ||||||
|  |                   </> | ||||||
|                 )} |                 )} | ||||||
|               </Link> |               </Link> | ||||||
|             </div> |             </div> | ||||||
|  | |||||||
| @ -1,7 +1,6 @@ | |||||||
| import { AxiosPromise, AxiosResponse } from 'axios'; | import { AxiosPromise, AxiosResponse } from 'axios'; | ||||||
| import classNames from 'classnames'; | import classNames from 'classnames'; | ||||||
| import { compare } from 'fast-json-patch'; | import { compare } from 'fast-json-patch'; | ||||||
| import { isNil } from 'lodash'; |  | ||||||
| import { ColumnTags, TableDetail, User } from 'Models'; | import { ColumnTags, TableDetail, User } from 'Models'; | ||||||
| import React, { useEffect, useState } from 'react'; | import React, { useEffect, useState } from 'react'; | ||||||
| import { Link, useParams } from 'react-router-dom'; | import { Link, useParams } from 'react-router-dom'; | ||||||
| @ -42,7 +41,6 @@ import { | |||||||
|   getOwnerFromId, |   getOwnerFromId, | ||||||
|   getTagsWithoutTier, |   getTagsWithoutTier, | ||||||
|   getTierFromTableTags, |   getTierFromTableTags, | ||||||
|   getUsagePercentile, |  | ||||||
| } from '../../utils/TableUtils'; | } from '../../utils/TableUtils'; | ||||||
| import { getTagCategories, getTaglist } from '../../utils/TagsUtils'; | import { getTagCategories, getTaglist } from '../../utils/TagsUtils'; | ||||||
| type ChartType = { | type ChartType = { | ||||||
| @ -70,8 +68,8 @@ const MyDashBoardPage = () => { | |||||||
|   const [activeTab, setActiveTab] = useState<number>(1); |   const [activeTab, setActiveTab] = useState<number>(1); | ||||||
|   const [isEdit, setIsEdit] = useState<boolean>(false); |   const [isEdit, setIsEdit] = useState<boolean>(false); | ||||||
|   const [charts, setCharts] = useState<ChartType[]>([]); |   const [charts, setCharts] = useState<ChartType[]>([]); | ||||||
|   const [usage, setUsage] = useState(''); |   // const [usage, setUsage] = useState('');
 | ||||||
|   const [weeklyUsageCount, setWeeklyUsageCount] = useState(''); |   // const [weeklyUsageCount, setWeeklyUsageCount] = useState('');
 | ||||||
|   const [slashedDashboardName, setSlashedDashboardName] = useState< |   const [slashedDashboardName, setSlashedDashboardName] = useState< | ||||||
|     TitleBreadcrumbProps['titleLinks'] |     TitleBreadcrumbProps['titleLinks'] | ||||||
|   >([]); |   >([]); | ||||||
| @ -119,8 +117,8 @@ const MyDashBoardPage = () => { | |||||||
|   const extraInfo = [ |   const extraInfo = [ | ||||||
|     { key: 'Owner', value: owner?.name || '' }, |     { key: 'Owner', value: owner?.name || '' }, | ||||||
|     { key: 'Tier', value: tier ? tier.split('.')[1] : '' }, |     { key: 'Tier', value: tier ? tier.split('.')[1] : '' }, | ||||||
|     { key: 'Usage', value: usage }, |     // { key: 'Usage', value: usage },
 | ||||||
|     { key: 'Queries', value: `${weeklyUsageCount} past week` }, |     // { key: 'Queries', value: `${weeklyUsageCount} past week` },
 | ||||||
|   ]; |   ]; | ||||||
|   const fetchTags = () => { |   const fetchTags = () => { | ||||||
|     getTagCategories().then((res) => { |     getTagCategories().then((res) => { | ||||||
| @ -180,7 +178,7 @@ const MyDashBoardPage = () => { | |||||||
|         owner, |         owner, | ||||||
|         displayName, |         displayName, | ||||||
|         charts, |         charts, | ||||||
|         usageSummary, |         // usageSummary,
 | ||||||
|       } = res.data; |       } = res.data; | ||||||
|       setDashboardDetails(res.data); |       setDashboardDetails(res.data); | ||||||
|       setDashboardId(id); |       setDashboardId(id); | ||||||
| @ -221,17 +219,17 @@ const MyDashBoardPage = () => { | |||||||
|         } |         } | ||||||
|       ); |       ); | ||||||
|       fetchCharts(charts).then((charts) => setCharts(charts)); |       fetchCharts(charts).then((charts) => setCharts(charts)); | ||||||
|       if (!isNil(usageSummary?.weeklyStats.percentileRank)) { |       // if (!isNil(usageSummary?.weeklyStats.percentileRank)) {
 | ||||||
|         const percentile = getUsagePercentile( |       //   const percentile = getUsagePercentile(
 | ||||||
|           usageSummary.weeklyStats.percentileRank |       //     usageSummary.weeklyStats.percentileRank
 | ||||||
|         ); |       //   );
 | ||||||
|         setUsage(percentile); |       //   setUsage(percentile);
 | ||||||
|       } else { |       // } else {
 | ||||||
|         setUsage('--'); |       //   setUsage('--');
 | ||||||
|       } |       // }
 | ||||||
|       setWeeklyUsageCount( |       // setWeeklyUsageCount(
 | ||||||
|         usageSummary?.weeklyStats.count.toLocaleString() || '--' |       //   usageSummary?.weeklyStats.count.toLocaleString() || '--'
 | ||||||
|       ); |       // );
 | ||||||
| 
 | 
 | ||||||
|       setLoading(false); |       setLoading(false); | ||||||
|     }); |     }); | ||||||
| @ -480,7 +478,17 @@ const MyDashBoardPage = () => { | |||||||
|                               <Link |                               <Link | ||||||
|                                 target="_blank" |                                 target="_blank" | ||||||
|                                 to={{ pathname: chart.chartUrl }}> |                                 to={{ pathname: chart.chartUrl }}> | ||||||
|  |                                 <span className="tw-flex"> | ||||||
|  |                                   <span className="tw-mr-1"> | ||||||
|                                     {chart.displayName} |                                     {chart.displayName} | ||||||
|  |                                   </span> | ||||||
|  |                                   <SVGIcons | ||||||
|  |                                     alt="external-link" | ||||||
|  |                                     className="tw-align-middle" | ||||||
|  |                                     icon="external-link" | ||||||
|  |                                     width="12px" | ||||||
|  |                                   /> | ||||||
|  |                                 </span> | ||||||
|                               </Link> |                               </Link> | ||||||
|                             </td> |                             </td> | ||||||
|                             <td className="tableBody-cell"> |                             <td className="tableBody-cell"> | ||||||
|  | |||||||
| @ -235,7 +235,17 @@ const ServicePage: FunctionComponent = () => { | |||||||
|                     href={serviceDetails.schemaRegistry} |                     href={serviceDetails.schemaRegistry} | ||||||
|                     rel="noopener noreferrer" |                     rel="noopener noreferrer" | ||||||
|                     target="_blank"> |                     target="_blank"> | ||||||
|  |                     <> | ||||||
|  |                       <span className="tw-mr-1"> | ||||||
|                         {serviceDetails.schemaRegistry} |                         {serviceDetails.schemaRegistry} | ||||||
|  |                       </span> | ||||||
|  |                       <SVGIcons | ||||||
|  |                         alt="external-link" | ||||||
|  |                         className="tw-align-middle" | ||||||
|  |                         icon="external-link" | ||||||
|  |                         width="12px" | ||||||
|  |                       /> | ||||||
|  |                     </> | ||||||
|                   </a> |                   </a> | ||||||
|                 ) : ( |                 ) : ( | ||||||
|                   '--' |                   '--' | ||||||
| @ -270,7 +280,17 @@ const ServicePage: FunctionComponent = () => { | |||||||
|                           href={serviceDetails.dashboardUrl} |                           href={serviceDetails.dashboardUrl} | ||||||
|                           rel="noopener noreferrer" |                           rel="noopener noreferrer" | ||||||
|                           target="_blank"> |                           target="_blank"> | ||||||
|  |                           <> | ||||||
|  |                             <span className="tw-mr-1"> | ||||||
|                               {serviceDetails.dashboardUrl} |                               {serviceDetails.dashboardUrl} | ||||||
|  |                             </span> | ||||||
|  |                             <SVGIcons | ||||||
|  |                               alt="external-link" | ||||||
|  |                               className="tw-align-middle" | ||||||
|  |                               icon="external-link" | ||||||
|  |                               width="12px" | ||||||
|  |                             /> | ||||||
|  |                           </> | ||||||
|                         </a> |                         </a> | ||||||
|                       ) : ( |                       ) : ( | ||||||
|                         '--' |                         '--' | ||||||
| @ -296,7 +316,17 @@ const ServicePage: FunctionComponent = () => { | |||||||
|                       href={serviceDetails.dashboardUrl} |                       href={serviceDetails.dashboardUrl} | ||||||
|                       rel="noopener noreferrer" |                       rel="noopener noreferrer" | ||||||
|                       target="_blank"> |                       target="_blank"> | ||||||
|  |                       <> | ||||||
|  |                         <span className="tw-mr-1"> | ||||||
|                           {serviceDetails.dashboardUrl} |                           {serviceDetails.dashboardUrl} | ||||||
|  |                         </span> | ||||||
|  |                         <SVGIcons | ||||||
|  |                           alt="external-link" | ||||||
|  |                           className="tw-align-middle" | ||||||
|  |                           icon="external-link" | ||||||
|  |                           width="12px" | ||||||
|  |                         /> | ||||||
|  |                       </> | ||||||
|                     </a> |                     </a> | ||||||
|                   ) : ( |                   ) : ( | ||||||
|                     '--' |                     '--' | ||||||
|  | |||||||
| @ -12,6 +12,7 @@ import IconDashboard from '../assets/svg/dashboard.svg'; | |||||||
| import IconAsstest from '../assets/svg/data-assets.svg'; | import IconAsstest from '../assets/svg/data-assets.svg'; | ||||||
| import IconDoc from '../assets/svg/doc.svg'; | import IconDoc from '../assets/svg/doc.svg'; | ||||||
| import IconError from '../assets/svg/error.svg'; | import IconError from '../assets/svg/error.svg'; | ||||||
|  | import IconExternalLink from '../assets/svg/external-link.svg'; | ||||||
| import IconCheckCircle from '../assets/svg/ic-check-circle.svg'; | import IconCheckCircle from '../assets/svg/ic-check-circle.svg'; | ||||||
| import IconDelete from '../assets/svg/ic-delete.svg'; | import IconDelete from '../assets/svg/ic-delete.svg'; | ||||||
| import IconDownArrow from '../assets/svg/ic-down-arrow.svg'; | import IconDownArrow from '../assets/svg/ic-down-arrow.svg'; | ||||||
| @ -132,6 +133,7 @@ export const Icons = { | |||||||
|   DASHBOARD_GREY: 'dashboard-grey', |   DASHBOARD_GREY: 'dashboard-grey', | ||||||
|   CONFIG: 'icon-config', |   CONFIG: 'icon-config', | ||||||
|   SLACK: 'slack', |   SLACK: 'slack', | ||||||
|  |   EXTERNAL_LINK: 'external-link', | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| const SVGIcons: FunctionComponent<Props> = ({ | const SVGIcons: FunctionComponent<Props> = ({ | ||||||
| @ -393,6 +395,10 @@ const SVGIcons: FunctionComponent<Props> = ({ | |||||||
|     case Icons.SLACK: |     case Icons.SLACK: | ||||||
|       IconComponent = IconSlack; |       IconComponent = IconSlack; | ||||||
| 
 | 
 | ||||||
|  |       break; | ||||||
|  |     case Icons.EXTERNAL_LINK: | ||||||
|  |       IconComponent = IconExternalLink; | ||||||
|  | 
 | ||||||
|       break; |       break; | ||||||
| 
 | 
 | ||||||
|     default: |     default: | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Sachin Chaurasiya
						Sachin Chaurasiya