Skip to content

Commit

Permalink
backport the change to 4.9
Browse files Browse the repository at this point in the history
Signed-off-by: Stephanie <[email protected]>
  • Loading branch information
yangcao77 committed Dec 6, 2021
1 parent eaa4be1 commit 2792689
Show file tree
Hide file tree
Showing 497 changed files with 32,216 additions and 20,375 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Feature: Create Application from Devfile
And user is at the Topology page
When user right clicks on topology empty graph
And user selects "Import from Git" option from Add to Project context menu
And user enters Git Repo URL as "https://github.com/redhat-developer/devfile-sample" in Import from Git form
And user enters Git Repo URL as "https://github.com/nodeshift-starters/devfile-sample" in Import from Git form
And user enters workload name as "node-bulletin-board-1" in Name
And user clicks Create button
Then user will be redirected to Topology page
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,16 +179,16 @@ export const loadedCatalogService: CatalogService = {
{
uid: 'nodejs-basic',
type: 'Sample',
name: 'Basic NodeJS',
description: 'A simple Hello world NodeJS application',
name: 'Basic Node.js',
description: 'A simple Hello World Node.js application',
tags: ['NodeJS', 'Express'],
cta: {
label: 'Create Devfile Sample',
href:
'/import?importType=devfile&formType=sample&devfileName=nodejs-basic&gitRepo=https://github.com/redhat-developer/devfile-sample.git',
'/import?importType=devfile&formType=sample&devfileName=nodejs-basic&gitRepo=https://github.com/nodeshift-starters/devfile-sample.git',
},
icon: {
url: 'data:image/png;base64,.....',
url: 'https://nodejs.org/static/images/logos/nodejs-new-pantone-black.svg',
},
},
{
Expand All @@ -200,10 +200,10 @@ export const loadedCatalogService: CatalogService = {
cta: {
label: 'Create Devfile Sample',
href:
'/import?importType=devfile&formType=sample&devfileName=python-basic&gitRepo=https://github.com/elsony/devfile-sample-python-basic.git',
'/import?importType=devfile&formType=sample&devfileName=python-basic&gitRepo=https://github.com/devfile-samples/devfile-sample-python-basic.git',
},
icon: {
url: 'data:image/png;base64,.....',
url: 'https://www.python.org/static/community_logos/python-logo-generic.svg',
},
},
{
Expand All @@ -215,10 +215,10 @@ export const loadedCatalogService: CatalogService = {
cta: {
label: 'Create Devfile Sample',
href:
'/import?importType=devfile&formType=sample&devfileName=code-with-quarkus&gitRepo=https://github.com/elsony/devfile-sample-code-with-quarkus.git',
'/import?importType=devfile&formType=sample&devfileName=code-with-quarkus&gitRepo=https://github.com/devfile-samples/devfile-sample-code-with-quarkus.git',
},
icon: {
url: 'data:image/png;base64,.....',
url: 'https://design.jboss.org/quarkus/logo/final/SVG/quarkus_icon_rgb_default.svg',
},
},
{
Expand All @@ -230,10 +230,10 @@ export const loadedCatalogService: CatalogService = {
cta: {
label: 'Create Devfile Sample',
href:
'/import?importType=devfile&formType=sample&devfileName=java-springboot-basic&gitRepo=https://github.com/elsony/devfile-sample-java-springboot-basic.git',
'/import?importType=devfile&formType=sample&devfileName=java-springboot-basic&gitRepo=https://github.com/devfile-samples/devfile-sample-java-springboot-basic.git',
},
icon: {
url: 'data:image/png;base64,.....',
url: 'https://spring.io/images/projects/spring-edf462fec682b9d48cf628eaf9e19521.svg',
},
},
{
Expand Down Expand Up @@ -411,16 +411,16 @@ export const loadedCatalogService: CatalogService = {
{
uid: 'nodejs-basic',
type: 'Sample',
name: 'Basic NodeJS',
description: 'A simple Hello world NodeJS application',
name: 'Basic Node.js',
description: 'A simple Hello World Node.js application',
tags: ['NodeJS', 'Express'],
cta: {
label: 'Create Devfile Sample',
href:
'/import?importType=devfile&formType=sample&devfileName=nodejs-basic&gitRepo=https://github.com/redhat-developer/devfile-sample.git',
'/import?importType=devfile&formType=sample&devfileName=nodejs-basic&gitRepo=https://github.com/nodeshift-starters/devfile-sample.git',
},
icon: {
url: 'data:image/png;base64,.....',
url: 'https://nodejs.org/static/images/logos/nodejs-new-pantone-black.svg',
},
},
{
Expand All @@ -432,10 +432,10 @@ export const loadedCatalogService: CatalogService = {
cta: {
label: 'Create Devfile Sample',
href:
'/import?importType=devfile&formType=sample&devfileName=python-basic&gitRepo=https://github.com/elsony/devfile-sample-python-basic.git',
'/import?importType=devfile&formType=sample&devfileName=python-basic&gitRepo=https://github.com/devfile-samples/devfile-sample-python-basic.git',
},
icon: {
url: 'data:image/png;base64,.....',
url: 'https://www.python.org/static/community_logos/python-logo-generic.svg',
},
},
{
Expand All @@ -447,10 +447,10 @@ export const loadedCatalogService: CatalogService = {
cta: {
label: 'Create Devfile Sample',
href:
'/import?importType=devfile&formType=sample&devfileName=code-with-quarkus&gitRepo=https://github.com/elsony/devfile-sample-code-with-quarkus.git',
'/import?importType=devfile&formType=sample&devfileName=code-with-quarkus&gitRepo=https://github.com/devfile-samples/devfile-sample-code-with-quarkus.git',
},
icon: {
url: 'data:image/png;base64,.....',
url: 'https://design.jboss.org/quarkus/logo/final/SVG/quarkus_icon_rgb_default.svg',
},
},
{
Expand All @@ -462,10 +462,10 @@ export const loadedCatalogService: CatalogService = {
cta: {
label: 'Create Devfile Sample',
href:
'/import?importType=devfile&formType=sample&devfileName=java-springboot-basic&gitRepo=https://github.com/elsony/devfile-sample-java-springboot-basic.git',
'/import?importType=devfile&formType=sample&devfileName=java-springboot-basic&gitRepo=https://github.com/devfile-samples/devfile-sample-java-springboot-basic.git',
},
icon: {
url: 'data:image/png;base64,.....',
url: 'https://spring.io/images/projects/spring-edf462fec682b9d48cf628eaf9e19521.svg',
},
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,13 @@ describe('SampleGettingStartedCard', () => {
id: 'code-with-quarkus',
title: 'Basic Quarkus',
href:
'/import?importType=devfile&formType=sample&devfileName=code-with-quarkus&gitRepo=https://github.com/elsony/devfile-sample-code-with-quarkus.git',
'/import?importType=devfile&formType=sample&devfileName=code-with-quarkus&gitRepo=https://github.com/devfile-samples/devfile-sample-code-with-quarkus.git',
},
{
id: 'java-springboot-basic',
title: 'Basic Spring Boot',
href:
'/import?importType=devfile&formType=sample&devfileName=java-springboot-basic&gitRepo=https://github.com/elsony/devfile-sample-java-springboot-basic.git',
'/import?importType=devfile&formType=sample&devfileName=java-springboot-basic&gitRepo=https://github.com/devfile-samples/devfile-sample-java-springboot-basic.git',
},
]);
expect(wrapper.find(GettingStartedCard).props().moreLink).toEqual({
Expand All @@ -118,9 +118,9 @@ describe('SampleGettingStartedCard', () => {
},
{
id: 'nodejs-basic',
title: 'Basic NodeJS',
title: 'Basic Node.js',
href:
'/import?importType=devfile&formType=sample&devfileName=nodejs-basic&gitRepo=https://github.com/redhat-developer/devfile-sample.git',
'/import?importType=devfile&formType=sample&devfileName=nodejs-basic&gitRepo=https://github.com/nodeshift-starters/devfile-sample.git',
},
]);
expect(wrapper.find(GettingStartedCard).props().moreLink).toEqual({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ import { DevfileSample } from '../../../import/devfile/devfile-types';
export const devfileSamples: DevfileSample[] = [
{
name: 'nodejs-basic',
displayName: 'Basic NodeJS',
description: 'A simple Hello world NodeJS application',
displayName: 'Basic Node.js',
description: 'A simple Hello World Node.js application',
icon: 'trimmed',
tags: ['NodeJS', 'Express'],
projectType: 'nodejs',
language: 'nodejs',
git: {
remotes: {
origin: 'https://github.com/redhat-developer/devfile-sample.git',
origin: 'https://github.com/nodeshift-starters/devfile-sample.git',
},
},
},
Expand All @@ -26,7 +26,7 @@ export const devfileSamples: DevfileSample[] = [
language: 'java',
git: {
remotes: {
origin: 'https://github.com/elsony/devfile-sample-code-with-quarkus.git',
origin: 'https://github.com/devfile-samples/devfile-sample-code-with-quarkus.git',
},
},
},
Expand All @@ -40,7 +40,7 @@ export const devfileSamples: DevfileSample[] = [
language: 'java',
git: {
remotes: {
origin: 'https://github.com/elsony/devfile-sample-java-springboot-basic.git',
origin: 'https://github.com/devfile-samples/devfile-sample-java-springboot-basic.git',
},
},
},
Expand All @@ -54,7 +54,7 @@ export const devfileSamples: DevfileSample[] = [
language: 'python',
git: {
remotes: {
origin: 'https://github.com/elsony/devfile-sample-python-basic.git',
origin: 'https://github.com/devfile-samples/devfile-sample-python-basic.git',
},
},
},
Expand All @@ -64,15 +64,15 @@ export const expectedCatalogItems: CatalogItem[] = [
{
uid: 'nodejs-basic',
type: 'Sample',
name: 'Basic NodeJS',
description: 'A simple Hello world NodeJS application',
name: 'Basic Node.js',
description: 'A simple Hello World Node.js application',
tags: ['NodeJS', 'Express'],
cta: {
label: 'Create Devfile Sample',
href:
'/import?importType=devfile&formType=sample&devfileName=nodejs-basic&gitRepo=https://github.com/redhat-developer/devfile-sample.git',
'/import?importType=devfile&formType=sample&devfileName=nodejs-basic&gitRepo=https://github.com/nodeshift-starters/devfile-sample.git',
},
icon: { url: 'data:image/png;base64,trimmed' },
icon: { url: 'trimmed' },
},
{
uid: 'code-with-quarkus',
Expand All @@ -83,9 +83,9 @@ export const expectedCatalogItems: CatalogItem[] = [
cta: {
label: 'Create Devfile Sample',
href:
'/import?importType=devfile&formType=sample&devfileName=code-with-quarkus&gitRepo=https://github.com/elsony/devfile-sample-code-with-quarkus.git',
'/import?importType=devfile&formType=sample&devfileName=code-with-quarkus&gitRepo=https://github.com/devfile-samples/devfile-sample-code-with-quarkus.git',
},
icon: { url: 'data:image/png;base64,trimmed' },
icon: { url: 'trimmed' },
},
{
uid: 'java-springboot-basic',
Expand All @@ -96,9 +96,9 @@ export const expectedCatalogItems: CatalogItem[] = [
cta: {
label: 'Create Devfile Sample',
href:
'/import?importType=devfile&formType=sample&devfileName=java-springboot-basic&gitRepo=https://github.com/elsony/devfile-sample-java-springboot-basic.git',
'/import?importType=devfile&formType=sample&devfileName=java-springboot-basic&gitRepo=https://github.com/devfile-samples/devfile-sample-java-springboot-basic.git',
},
icon: { url: 'data:image/png;base64,trimmed' },
icon: { url: 'trimmed' },
},
{
uid: 'python-basic',
Expand All @@ -109,8 +109,8 @@ export const expectedCatalogItems: CatalogItem[] = [
cta: {
label: 'Create Devfile Sample',
href:
'/import?importType=devfile&formType=sample&devfileName=python-basic&gitRepo=https://github.com/elsony/devfile-sample-python-basic.git',
'/import?importType=devfile&formType=sample&devfileName=python-basic&gitRepo=https://github.com/devfile-samples/devfile-sample-python-basic.git',
},
icon: { url: 'data:image/png;base64,trimmed' },
icon: { url: 'trimmed' },
},
];
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ describe('useDevfileSamples:', () => {

expect(putMock).toHaveBeenCalledTimes(1);
expect(putMock).toHaveBeenLastCalledWith('/api/devfile/samples', {
registry: 'sample-placeholder',
registry: 'https://registry.devfile.io',
});

expect(result.current).toEqual([[], false, undefined]);
Expand All @@ -44,7 +44,7 @@ describe('useDevfileSamples:', () => {

expect(putMock).toHaveBeenCalledTimes(1);
expect(putMock).toHaveBeenLastCalledWith('/api/devfile/samples', {
registry: 'sample-placeholder',
registry: 'https://registry.devfile.io',
});

expect(result.current).toEqual([[], false, undefined]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ const normalizeDevfile = (devfileSamples: DevfileSample[], t: TFunction): Catalo
const normalizedDevfileSamples = devfileSamples?.map((sample) => {
const { name: uid, displayName, description, tags, git, icon } = sample;
const gitRepoUrl = Object.values(git.remotes)[0];
const iconUrl = icon ? `data:image/png;base64,${icon}` : '';
const href = `/import?importType=devfile&devfileName=${uid}&gitRepo=${gitRepoUrl}`;
const createLabel = t('devconsole~Create Application');
const type = 'Devfile';
Expand Down Expand Up @@ -41,7 +40,7 @@ const normalizeDevfile = (devfileSamples: DevfileSample[], t: TFunction): Catalo
label: createLabel,
href,
},
icon: { url: iconUrl },
icon: { url: icon },
details: {
properties: detailsProperties,
descriptions: detailsDescriptions,
Expand All @@ -62,7 +61,7 @@ const useDevfile: ExtensionHook<CatalogItem[]> = (): [CatalogItem[], boolean, an
React.useEffect(() => {
let mounted = true;
const payload = {
registry: 'sample-placeholder',
registry: 'https://registry.devfile.io',
};
coFetchJSON
.put('/api/devfile/samples', payload)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ const normalizeDevfileSamples = (devfileSamples: DevfileSample[], t: TFunction):
const gitRepoUrl = Object.values(git.remotes)[0];
const label = t('devconsole~Create Devfile Sample');
const href = `/import?importType=devfile&formType=sample&devfileName=${uid}&gitRepo=${gitRepoUrl}`;
const iconUrl = icon ? `data:image/png;base64,${icon}` : '';

const item: CatalogItem = {
uid,
Expand All @@ -24,7 +23,7 @@ const normalizeDevfileSamples = (devfileSamples: DevfileSample[], t: TFunction):
label,
href,
},
icon: { url: iconUrl },
icon: { url: icon },
};

return item;
Expand All @@ -41,7 +40,7 @@ const useDevfileSamples: ExtensionHook<CatalogItem[]> = (): [CatalogItem[], bool
React.useEffect(() => {
let mounted = true;
const payload = {
registry: 'sample-placeholder',
registry: 'https://registry.devfile.io',
};
coFetchJSON
.put('/api/devfile/samples', payload)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,7 @@ export type DevfileInfoProps = {
const DevfileInfo: React.FC<DevfileInfoProps> = ({ devfileSample }) => {
const { t } = useTranslation();
const { icon, iconClass, displayName, description, git, tags } = devfileSample;
const iconUrl = iconClass
? getImageForIconClass(iconClass)
: icon
? `data:image/png;base64,${icon}`
: '';
const iconUrl = iconClass ? getImageForIconClass(iconClass) : icon || '';
const sampleRepo = git?.remotes ? Object.values(git.remotes)[0] : '';

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ export const useSelectedDevfileSample = () => {
React.useEffect(() => {
let mounted = true;
const payload = {
registry: 'sample-placeholder',
registry: 'https://registry.devfile.io',
};
coFetchJSON
.put('/api/devfile/samples', payload)
Expand Down
20 changes: 11 additions & 9 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,30 @@ go 1.13
require (
github.com/coreos/go-oidc v2.1.0+incompatible
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f
github.com/devfile/api/v2 v2.0.0-20210211160219-33a78aec06af
github.com/devfile/library v1.0.0-alpha.2
github.com/devfile/registry-support/index/generator v0.0.0-20210505173027-d06fe2bb3ee8
github.com/devfile/api/v2 v2.0.0-20211021164004-dabee4e633ed
github.com/devfile/library v1.2.1-0.20211104222135-49d635cb492f
github.com/devfile/registry-support/index/generator v0.0.0-20211012185733-0a73f866043f
github.com/devfile/registry-support/registry-library v0.0.0-20211026200306-cab748834109
github.com/ghodss/yaml v1.0.1-0.20190212211648-25d852aebe32 // indirect
github.com/gorilla/websocket v1.4.2
github.com/graph-gophers/graphql-go v0.0.0-20200309224638-dae41bde9ef9
github.com/openshift/api v0.0.0-20210105115604-44119421ec6b
github.com/openshift/library-go v0.0.0-20200424095618-2aeb4725dadf
github.com/operator-framework/kubectl-operator v0.3.0
github.com/pquerna/cachecontrol v0.0.0-20180517163645-1555304b9b35 // indirect
github.com/rawagner/graphql-transport-ws v0.0.0-20200817140314-dcfbf0388067
golang.org/x/net v0.0.0-20210224082022-3d97a244fca7
golang.org/x/net v0.0.0-20210428140749-89ef3d95e781
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d
gopkg.in/square/go-jose.v2 v2.4.1 // indirect
gopkg.in/yaml.v2 v2.4.0
helm.sh/helm/v3 v3.6.2
k8s.io/api v0.21.0
k8s.io/apiextensions-apiserver v0.21.0
k8s.io/apimachinery v0.21.0
k8s.io/api v0.21.3
k8s.io/apiextensions-apiserver v0.21.3
k8s.io/apimachinery v0.21.3
k8s.io/cli-runtime v0.21.0
k8s.io/client-go v0.21.0
k8s.io/client-go v0.21.3
k8s.io/klog v1.0.0
sigs.k8s.io/controller-runtime v0.8.2
sigs.k8s.io/controller-runtime v0.9.5
sigs.k8s.io/yaml v1.2.0
)

Expand Down
Loading

0 comments on commit 2792689

Please sign in to comment.