@@ -3,7 +3,7 @@ import { PLAYGROUND_MODES } from '../../constants/constants';
33import { ChainIcon , CopyIcon , KanvasIcon , PublishIcon } from '../../icons' ;
44import Download from '../../icons/Download/Download' ;
55import { CHARCOAL } from '../../theme' ;
6- import { downloadYaml , slugify } from '../CatalogDetail/helper' ;
6+ import { downloadPattern , slugify } from '../CatalogDetail/helper' ;
77import { RESOURCE_TYPES } from '../CatalogDetail/types' ;
88import { Pattern } from '../CustomCatalog/CustomCard' ;
99import { ConditionalTooltip } from '../Helpers/CondtionalTooltip' ;
@@ -25,6 +25,7 @@ interface ColumnConfigProps {
2525 handleCopyUrl : ( type : string , name : string , id : string ) => void ;
2626 handleClone : ( name : string , id : string ) => void ;
2727 handleShowDetails : ( designId : string , designName : string ) => void ;
28+ getDownloadUrl : ( id : string ) => string ;
2829 isDownloadAllowed : boolean ;
2930 isCopyLinkAllowed : boolean ;
3031 isDeleteAllowed : boolean ;
@@ -53,6 +54,7 @@ export const createDesignsColumnsConfig = ({
5354 handleCopyUrl,
5455 handleClone,
5556 handleShowDetails,
57+ getDownloadUrl,
5658 isUnpublishAllowed,
5759 isCopyLinkAllowed,
5860 isDeleteAllowed,
@@ -167,15 +169,15 @@ export const createDesignsColumnsConfig = ({
167169 const actionsList = [
168170 {
169171 title : 'Download' ,
170- onClick : ( ) => downloadYaml ( rowData ?. pattern_file , rowData ? .name ) ,
172+ onClick : ( ) => downloadPattern ( rowData . id , rowData . name , getDownloadUrl ) ,
171173 disabled : ! isDownloadAllowed ,
172174 icon : < Download width = { 24 } height = { 24 } fill = { CHARCOAL } />
173175 } ,
174176 {
175177 title : 'Copy Link' ,
176178 disabled : rowData . visibility === 'private' || ! isCopyLinkAllowed ,
177179 onClick : ( ) => {
178- handleCopyUrl ( RESOURCE_TYPES . DESIGNS , rowData ?. name , rowData ?. id ) ;
180+ handleCopyUrl ( RESOURCE_TYPES . DESIGN , rowData ?. name , rowData ?. id ) ;
179181 } ,
180182 icon : < ChainIcon width = { '24' } height = { '24' } fill = { CHARCOAL } />
181183 } ,
@@ -185,9 +187,7 @@ export const createDesignsColumnsConfig = ({
185187 window . open (
186188 `https://playground.meshery.io/extension/meshmap?mode=${
187189 PLAYGROUND_MODES . DESIGNER
188- } &type=${ RESOURCE_TYPES . DESIGNS } &id=${ rowData ?. id } &name=${ slugify (
189- rowData ?. name
190- ) } `,
190+ } &type=${ RESOURCE_TYPES . DESIGN } &id=${ rowData ?. id } &name=${ slugify ( rowData ?. name ) } `,
191191 '_blank'
192192 ) ;
193193 } ,
0 commit comments