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

fix: some bug fix about publish page #5012

Merged
merged 4 commits into from
Dec 3, 2020
Merged

Conversation

alanlong9278
Copy link
Contributor

@alanlong9278 alanlong9278 commented Nov 30, 2020

Description

bugfix

  • can not get all bot publish histories. It just get the first bot publish history when initial the page
  • if the previous publish failed or success, start a new publish process, the notification modal will pop up the old ones. The notification card display wrong when publish bot again. It will show the old notification card when publishing again

Task Item

#minor

Screenshots

notification
image

@srinaath srinaath added 1.3 1.3 Release BotProjects Group all Bot projects tickets labels Dec 3, 2020
@srinaath srinaath added this to the R11 milestone Dec 3, 2020
yeze322
yeze322 previously requested changes Dec 3, 2020
Copy link
Contributor

@yeze322 yeze322 left a comment

Choose a reason for hiding this comment

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

Several advices to make sure readability:

  • Avoid nested if else clauses, return early.
  • Extract complicated state computation logic as pure functions.
  • Define necessary local variables to replace appearances of botPublishHistory[0].status. Avoid context switching when reading the code

@alanlong9278 alanlong9278 changed the base branch from feature/bot-projects to main December 3, 2020 03:33
@alanlong9278 alanlong9278 changed the base branch from main to feature/bot-projects December 3, 2020 03:36
@alanlong9278 alanlong9278 force-pushed the julong/bugfix-publish branch from fd109f2 to 242c667 Compare December 3, 2020 04:10
@alanlong9278 alanlong9278 changed the base branch from feature/bot-projects to main December 3, 2020 04:10
@coveralls
Copy link

coveralls commented Dec 3, 2020

Coverage Status

Coverage increased (+0.003%) to 55.837% when pulling a92b3a6 on julong/bugfix-publish into 8cdcf0d on main.

@boydc2014
Copy link
Contributor

boydc2014 commented Dec 3, 2020

I agree we can merge it if this is functional working and help unblock us for E2E testing. But i do have a few concern about the code quality here, left a few more comments for refactoring. See below

@@ -159,49 +159,85 @@ const Publish: React.FC<RouteComponentProps<{ projectId: string; targetName?: st
};

const [pendingNotification, setPendingNotification] = useState<Notification>();
const [previousBotPublishHistoryList, setPreviousBotPublishHistoryList] = useState(botPublishHistoryList);
Copy link
Contributor

Choose a reason for hiding this comment

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

can we have a better naming for this what previousHistory means? do we have a current history?

and there is no good to add "list" as postfix, botPublishHistory is good enough

return item;
})
);
if (!(bot.publishTarget && bot.publishTargets)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

First, the comments "// most recent item is a 202, which means we should poll for updates..." is not related to this line. there is even no 202 in many lines.

For such a long use effect and the many other long use effects below, we should give a top-level summary.

@boydc2014 boydc2014 dismissed stale reviews from a-b-r-o-w-n and yeze322 December 3, 2020 09:59

fixed

@alanlong9278 alanlong9278 merged commit b3f571b into main Dec 3, 2020
@alanlong9278 alanlong9278 deleted the julong/bugfix-publish branch December 3, 2020 10:39
lei9444 pushed a commit to lei9444/BotFramework-Composer-1 that referenced this pull request Jun 15, 2021
* get all publish history && notification cards display

* reduce nested loop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.3 1.3 Release BotProjects Group all Bot projects tickets
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants