Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ODC-7399: Create getting started content in functions list page #13289

Merged

Conversation

lokanandaprabhu
Copy link
Contributor

@lokanandaprabhu lokanandaprabhu commented Oct 27, 2023

Story:
https://issues.redhat.com/browse/ODC-7399

Description:

  1. Added getting started with functions section in functions list page
  2. First section will have the samples to create serverless functions
  3. Second section will have quick starts , if quick starts not provided then user will be show external link
  4. Third section will have external link documentation
  5. Create dropdown will have 2 options, import from git and samples
  6. Add page will have 2 CTA to create serverless function
  7. Topology add action will have 2 CTA to create serverless function

Demo:

Screen.Recording.2023-10-27.at.10.37.42.AM.mov
Screen.Recording.2023-10-27.at.10.42.50.AM.mov
Screen.Recording.2023-10-31.at.10.13.03.AM.mov

@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Oct 27, 2023

@lokanandaprabhu: This pull request references ODC-7399 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.15.0" version, but no target version was set.

In response to this:

Story:
https://issues.redhat.com/browse/ODC-7399

Description:

  1. Added getting started with functions section in functions list page
  2. First section will have the samples to create serverless functions
  3. Second section will have quick starts , if quick starts not provided then user will be show external link
  4. Third section will have external link documentation
  5. Create dropdown will have 2 options, import from git and samples
  6. Add page will have 2 CTA to create serverless function
  7. Topology add action will have 2 CTA to create serverless function

Demo:

Screen.Recording.2023-10-27.at.10.37.42.AM.mov
Screen.Recording.2023-10-27.at.10.42.50.AM.mov

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Oct 27, 2023
@openshift-ci openshift-ci bot added component/dev-console Related to dev-console component/knative Related to knative-plugin component/shared Related to console-shared kind/i18n Indicates issue or PR relates to internationalization or has content that needs to be translated labels Oct 27, 2023
@lokanandaprabhu
Copy link
Contributor Author

/retest

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 27, 2023
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 27, 2023
@lokanandaprabhu
Copy link
Contributor Author

/retest

Copy link
Member

@jerolimov jerolimov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general, fine! 👍

Some small code change requests.

Some UX topics that we should check in a call:

@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Oct 31, 2023

@lokanandaprabhu: This pull request references ODC-7399 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.15.0" version, but no target version was set.

In response to this:

Story:
https://issues.redhat.com/browse/ODC-7399

Description:

  1. Added getting started with functions section in functions list page
  2. First section will have the samples to create serverless functions
  3. Second section will have quick starts , if quick starts not provided then user will be show external link
  4. Third section will have external link documentation
  5. Create dropdown will have 2 options, import from git and samples
  6. Add page will have 2 CTA to create serverless function
  7. Topology add action will have 2 CTA to create serverless function

Demo:

Screen.Recording.2023-10-27.at.10.37.42.AM.mov
Screen.Recording.2023-10-27.at.10.42.50.AM.mov
Screen.Recording.2023-10-31.at.10.13.03.AM.mov

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@lokanandaprabhu lokanandaprabhu force-pushed the feature/ODC-7399 branch 2 times, most recently from 7e7a224 to 1c48434 Compare October 31, 2023 06:56
@lokanandaprabhu
Copy link
Contributor Author

Hi @jerolimov ,

I have resolved the feedback comments. PTAL.

@lokanandaprabhu
Copy link
Contributor Author

/retest

@lokanandaprabhu lokanandaprabhu force-pushed the feature/ODC-7399 branch 3 times, most recently from f891c64 to af8d987 Compare November 2, 2023 05:24
@lokanandaprabhu
Copy link
Contributor Author

Propage labels from the epic:

/label docs-approved
/label px-approved

@openshift-ci openshift-ci bot added docs-approved Signifies that Docs has signed off on this PR px-approved Signifies that Product Support has signed off on this PR labels Nov 2, 2023
@sanketpathak
Copy link
Contributor

Verified UI with admin and non-admin user
Screenshot 2023-11-03 at 4 33 48 PM
Screenshot 2023-11-03 at 5 07 34 PM

/label qe-approved

@openshift-ci openshift-ci bot added the qe-approved Signifies that QE has signed off on this PR label Nov 3, 2023
@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Nov 3, 2023

@lokanandaprabhu: This pull request references ODC-7399 which is a valid jira issue.

In response to this:

Story:
https://issues.redhat.com/browse/ODC-7399

Description:

  1. Added getting started with functions section in functions list page
  2. First section will have the samples to create serverless functions
  3. Second section will have quick starts , if quick starts not provided then user will be show external link
  4. Third section will have external link documentation
  5. Create dropdown will have 2 options, import from git and samples
  6. Add page will have 2 CTA to create serverless function
  7. Topology add action will have 2 CTA to create serverless function

Demo:

Screen.Recording.2023-10-27.at.10.37.42.AM.mov
Screen.Recording.2023-10-27.at.10.42.50.AM.mov
Screen.Recording.2023-10-31.at.10.13.03.AM.mov

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@Lucifergene
Copy link
Contributor

/assign @Lucifergene

Copy link
Contributor

@Lucifergene Lucifergene left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The header of the Expandable menu looks bold :

image

Copy link
Member

@jerolimov jerolimov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small recommendations. Let me know if you have any question. Thanks for the great work 👍

Comment on lines +16 to +20
const sampleType = params.get('sampleType');
const labelFilter: Record<string, string> = {
label: 'sample-type',
value: sampleType,
};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my previous comment, I mixed two options, a sampleType query parameter is one option. The Record is an option for a more generic solution where the filter is something like ?labelFilter=serverless=true

So this code currently mixes both, let us focus on one solution or the other. At the moment a sampleType is fine.

Suggested change
const sampleType = params.get('sampleType');
const labelFilter: Record<string, string> = {
label: 'sample-type',
value: sampleType,
};
const sampleType = params.get('sampleType');

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need both since typeLabel is translated string in other samples

Comment on lines +30 to +41
let filteredLists: CatalogItem[];
if (sampleType) {
filteredLists = service.items.filter((item) => {
return (
item?.typeLabel === labelFilter?.value ||
item?.data?.metadata?.labels[labelFilter?.label] === labelFilter?.value
);
});
} else {
filteredLists = service.items;
}
const catalogItems = { ...service, items: filteredLists };
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can talk about the alternative here, but for now I would recommend to focus on sampleType filter. A labelFilter might have more powers, but we shouldn't mix both.

Suggested change
let filteredLists: CatalogItem[];
if (sampleType) {
filteredLists = service.items.filter((item) => {
return (
item?.typeLabel === labelFilter?.value ||
item?.data?.metadata?.labels[labelFilter?.label] === labelFilter?.value
);
});
} else {
filteredLists = service.items;
}
const catalogItems = { ...service, items: filteredLists };
let filteredItems = service.items;
if (sampleType) {
filteredItems = filteredItems.filter((item) => item.typeLabel === sampleType);
}
const catalogItems = { ...service, items: filteredItems };

Maybe I miss something, but as long as the "all samples' link uses ...?sampleType=Serverless%20function we don't need more here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes value is the value from the URL only, but typeLabel is the translated string in other samples. If we change the language, the type label will show in the respective language.

So if I look only for typeLabel, then if it is translated string, later we have to ask serverless team to add one metadata.label to indicate this is the sample wrt serverless functions

Now while creating the sample, if they add new label as sample-type : 'Serverless Function' then if typeLabel is translated string also we will not be having any issue.

Comment on lines 21 to 32
const items = menuActions
? Object.keys(menuActions).reduce<Record<string, string>>((acc, key) => {
const menuAction: MenuAction = menuActions[key];
const label =
menuAction.label ||
(menuAction.model?.labelKey ? t(menuAction.model.labelKey) : menuAction.model?.label);
if (!label) return acc;

return {
...acc,
[key]: label,
};
}, {})
: undefined;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The object above have well known actions with translated label and onSelection callbacks. So the code to use labelKey never runs. Also the if (!label) statement should never be true. It looks to me that the items object will be the same as menuActions, or?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

menuActions is object with Key and Menu actions and the key is used while selecting the option from the dropdown. While opening the dropdown component also the shared component expecting key and label. I have removed code wrt labelKey.

Comment on lines +80 to +96
if (loaded && slicedQuickStarts.length === 0) {
links.push(
{
id: 'ide-extensions',
href:
'https://marketplace.visualstudio.com/items?itemName=redhat.vscode-openshift-connector',
title: t('knative-plugin~Create using IDE extension'),
external: true,
},
{
id: 'functions-tekton-pipelines',
title: t('knative-plugin~Building Functions on Cluster with Tekton Pipelines'),
href:
'https://github.com/knative/func/blob/main/docs/building-functions/on_cluster_build.md',
external: true,
},
);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add one link if we found just QS, and both if there are 0?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is discussed as either QS will be there or external links. One QS is there also, external link will be added to the 3rd section, which is documentation section.

@lokanandaprabhu lokanandaprabhu force-pushed the feature/ODC-7399 branch 2 times, most recently from bee7efd to 3626392 Compare November 6, 2023 15:39
@lokanandaprabhu
Copy link
Contributor Author

/retest

1 similar comment
@lokanandaprabhu
Copy link
Contributor Author

/retest

@lokanandaprabhu
Copy link
Contributor Author

/retest

@Lucifergene
Copy link
Contributor

Looks good to me :)

@lokanandaprabhu
Copy link
Contributor Author

/retest

@lokanandaprabhu
Copy link
Contributor Author

/test e2e-gcp-console

@Lucifergene
Copy link
Contributor

/retest

@Lucifergene
Copy link
Contributor

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Nov 10, 2023
@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 10, 2023
Copy link
Member

@jerolimov jerolimov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve

Copy link
Contributor

openshift-ci bot commented Nov 10, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jerolimov, lokanandaprabhu, Lucifergene

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot
Copy link
Contributor

/retest-required

Remaining retests: 0 against base HEAD 0a80f8f and 2 for PR HEAD 876798f in total

@jerolimov
Copy link
Member

/retest

@openshift-ci-robot
Copy link
Contributor

/retest-required

Remaining retests: 0 against base HEAD ccebf14 and 1 for PR HEAD 876798f in total

@jerolimov
Copy link
Member

/retest

1 similar comment
@jerolimov
Copy link
Member

/retest

Copy link
Contributor

openshift-ci bot commented Nov 12, 2023

@lokanandaprabhu: all tests passed!

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@openshift-merge-bot openshift-merge-bot bot merged commit 65cdd68 into openshift:master Nov 12, 2023
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. component/dev-console Related to dev-console component/knative Related to knative-plugin component/shared Related to console-shared docs-approved Signifies that Docs has signed off on this PR jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. kind/i18n Indicates issue or PR relates to internationalization or has content that needs to be translated lgtm Indicates that a PR is ready to be merged. px-approved Signifies that Product Support has signed off on this PR qe-approved Signifies that QE has signed off on this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants