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
1 change: 1 addition & 0 deletions localtypings/pxtpackage.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ declare namespace pxt {
*/
interface PackageConfig {
name: string;
displayName?: string; // used for the codecard in the extension dialog
version?: string;
// installedVersion?: string; moved to Package class
// url to icon -- support for built-in packages only
Expand Down
11 changes: 6 additions & 5 deletions pxtlib/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1698,11 +1698,12 @@ namespace ts.pxtc.service {
}

export interface ExtensionMeta {
name: string,
fullName?: string,
description?: string,
imageUrl?: string,
type?: ExtensionType
name: string;
displayName?: string;
fullRepo?: string;
description?: string;
imageUrl?: string;
type?: ExtensionType;
learnMoreUrl?: string;

pkgConfig?: pxt.PackageConfig; // Added if the type is Bundled
Expand Down
10 changes: 6 additions & 4 deletions webapp/src/extensionsBrowser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ export const ExtensionsBrowser = (props: ExtensionsProps) => {
imageUrl: pxt.github.repoIconUrl(r),
repo: r,
description: r.description,
fullName: r.fullName
fullRepo: r.fullName
}
}

Expand Down Expand Up @@ -360,6 +360,7 @@ export const ExtensionsBrowser = (props: ExtensionsProps) => {
function packageConfigToExtensionMeta(p: pxt.PackageConfig): ExtensionMeta {
return {
name: p.name,
displayName: p.displayName,
imageUrl: p.icon,
type: ExtensionType.Bundled,
learnMoreUrl: `/reference/${p.name}`,
Expand Down Expand Up @@ -458,22 +459,23 @@ export const ExtensionsBrowser = (props: ExtensionsProps) => {
const { extensionInfo } = props;
const {
description,
fullName,
fullRepo,
imageUrl,
learnMoreUrl,
loading,
name,
displayName,
repo,
type,
} = extensionInfo;

return <ExtensionCard
title={name || fullName}
title={displayName || name || fullRepo}
description={description}
imageUrl={imageUrl}
extension={extensionInfo}
onClick={installExtension}
learnMoreUrl={learnMoreUrl || (fullName ? `/pkg/${fullName}` : undefined)}
learnMoreUrl={learnMoreUrl || (fullRepo ? `/pkg/${fullRepo}` : undefined)}
loading={loading}
label={pxt.isPkgBeta(extensionInfo) ? lf("Beta") : undefined}
showDisclaimer={type != ExtensionType.Bundled && repo?.status != pxt.github.GitRepoStatus.Approved}
Expand Down