Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Conversation

@beyackle
Copy link
Contributor

@beyackle beyackle commented Nov 9, 2020

Description

This adds awareness of the project and skill structure to the LG, LU, and QnA pages. They will now display the dialogs of whichever the current selected bot or skill is, keeping that around in the URL and using it to correctly point to the right place back in Design View.

Task Item

closes #4615

@beyackle beyackle changed the title Beyackle/bot proj url state fix: correct URL when switching page modes Nov 9, 2020
const { dialogId = '', projectId = '', skillId = null } = props;
const dialogs = useRecoilValue(validateDialogsSelectorFamily(skillId ?? projectId));

console.log(skillId, projectId, skillId ?? projectId, dialogs);
Copy link
Contributor

Choose a reason for hiding this comment

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

remove logs

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops. Thanks for catching this.

@srinaath srinaath added BotProjects Group all Bot projects tickets Team: Authoring labels Nov 10, 2020
@srinaath srinaath added this to the R11 milestone Nov 10, 2020
const { dialogId = '', projectId = '', skillId = null } = props;

const baseURL =
projectId === skillId || skillId == null ? `/bot/${projectId}/` : `/bot/${projectId}/skill/${skillId}/`;
Copy link
Contributor

Choose a reason for hiding this comment

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

projectId === skillId should never happen correct?

const edit = /\/edit(\/)?$/.test(path);

const baseURL =
projectId === skillId || skillId == null ? `/bot/${projectId}/` : `/bot/${projectId}/skill/${skillId}/`;
Copy link
Contributor

Choose a reason for hiding this comment

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

same issue here projectId===skillId is a scenario that should never occur

}>> = (props) => {
const { dialogId = '', projectId = '' } = props;
const dialogs = useRecoilValue(validateDialogsSelectorFamily(projectId));
const { dialogId = '', projectId = '', skillId = null } = props;
Copy link
Contributor

Choose a reason for hiding this comment

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

is there a reason why skillId is instanitated to null and other props are'nt? Can we make the instantiation consistent?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I originally had this as '', but that broke the ?? melding I was doing. If anything, I think they should all default to null, so I'll make that change too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Update on this - changing them all to null caused more typechecking issues downstream, so I found another solution that looks less strange than this. We need a projectId and dialogId in all cases, but the skillId is optional and gets marked as such.

Copy link
Contributor

@hatpick hatpick left a comment

Choose a reason for hiding this comment

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

Please use:

`${baseUrl}restOfUrl`

instead of + concat.

@beyackle beyackle merged commit a6d5111 into feature/bot-projects Nov 10, 2020
@beyackle beyackle deleted the beyackle/botProjURLState branch November 10, 2020 20:48
alanlong9278 added a commit to alanlong9278/BotFramework-Composer that referenced this pull request Nov 12, 2020
* settingsPage:
  remove useless files
  Corrected types
  Support undo/redo for skill (microsoft#4754)
  fix UT
  feat: Diagnostics Page (microsoft#4457)
  set defaultLanguage as active language if active language is deleted
  fix: correct URL when switching page modes (microsoft#4736)
  fix: do not stub __dirname for node extensions (microsoft#4749)
  chore: bundle extensions (microsoft#4745)
  fix: Delete & Undo on actions with LG templates doesn't bring back the LG content (microsoft#4740)
  feat: update sdk package to 4.11.0 (microsoft#4741)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

BotProjects Group all Bot projects tickets Team: Authoring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants