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 part of issue #19435: Migrate Skill Editor Page #19882

Closed
wants to merge 23 commits into from

Conversation

shivanandan17
Copy link
Contributor

Overview

  1. This PR fixes or fixes part of Migration of Individual Pages from Webpack/AngularJS to Lazy-Loaded Angular Modules #19435.
  2. This PR does the following: Migrates the Skill Editor page from Webpack/AngularJS to Lazy-Loaded Angular Modules.

Essential Checklist

  • The PR title starts with "Fix #bugnum: " or "Fix part of #bugnum: ...", followed by a short, clear summary of the changes.
  • I have followed the instructions for making a code change.
  • I have assigned the correct reviewers to this PR (or will leave a comment with the phrase "@{{reviewer_username}} PTAL" if I don't have permissions to assign reviewers directly).
  • The linter/Karma presubmit checks pass on my local machine, and my PR follows the coding style guide).
  • "Allow edits from maintainers" is checked. (See here for instructions on how to enable it.)

Proof that changes are correct

12e44861-adab-41b5-ac2e-b79ddec86556_hrDStOhj.mp4

PR Pointers

@shivanandan17 shivanandan17 requested review from a team as code owners March 5, 2024 17:13
Copy link

oppiabot bot commented Mar 5, 2024

Assigning @seanlip for the first pass review of this PR. Thanks!

@shivanandan17
Copy link
Contributor Author

PTAL @DubeySandeep

Copy link

oppiabot bot commented Mar 5, 2024

Hi @shivanandan17. Due to recent changes in the "develop" branch, this PR now has a merge conflict. Please follow this link if you need help resolving the conflict, so that the PR can be merged. Thanks!

Copy link
Member

@seanlip seanlip left a comment

Choose a reason for hiding this comment

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

Thanks @shivanandan17! LGTM for my codeowner files.

@seanlip seanlip removed their assignment Mar 6, 2024
Copy link

oppiabot bot commented Mar 6, 2024

Assigning @Nik-09 for code owner reviews. Thanks!

@oppiabot oppiabot bot assigned Nik-09 Mar 6, 2024
Copy link
Member

@DubeySandeep DubeySandeep left a comment

Choose a reason for hiding this comment

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

LGTM left one comment, PTAL!

);
});

it('should allow user to access the page if user is curriculum admin',
Copy link
Member

Choose a reason for hiding this comment

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

This doesn't depend on user role, right? (as it depends on accessValidatorfunction)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done. (Updated the File)

Comment on lines 45 to 48
const userInfo = await this.userService.getUserInfoAsync();
if (userInfo.isCurriculumAdmin()) {
return true;
}
Copy link
Member

Choose a reason for hiding this comment

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

Are we expecting to use the validateAccessToSkillEditorPage 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.

Done. (Updated the File)

Copy link

oppiabot bot commented Mar 10, 2024

Unassigning @DubeySandeep since they have already approved the PR.

@DubeySandeep
Copy link
Member

@shivanandan17 Tests are still failing on this PR, PTAL! (We need to get this merged quickly!)

Copy link

oppiabot bot commented Apr 28, 2024

Hi @shivanandan17. Due to recent changes in the "develop" branch, this PR now has a merge conflict. Please follow this link if you need help resolving the conflict, so that the PR can be merged. Thanks!

Copy link
Contributor

@StephenYu2018 StephenYu2018 left a comment

Choose a reason for hiding this comment

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

2 concerns.

Comment on lines +78 to +84
let canActivateResult: boolean | null = null;

guard
.canActivate(new ActivatedRouteSnapshot(), {} as RouterStateSnapshot)
.then(result => {
canActivateResult = result;
});
Copy link
Contributor

Choose a reason for hiding this comment

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

Can't we fit all this in one statement?

const resultCanBeActivated = guard.canActivate(
  new ActivatedRouteSnapshot(),
  {} as RouterStateSnapshot
).then(result => result);

Ditto for below.

Comment on lines +648 to +663
self.signup(self.VIEWER_EMAIL, self.VIEWER_USERNAME)
self.login(self.VIEWER_EMAIL)
self.get_json(
'%s/can_access_skill_editor/%s' % (
ACCESS_VALIDATION_HANDLER_PREFIX, self.skill_id
), expected_status_int=401
)
self.logout()

self.login(self.NEW_USER_EMAIL)
self.get_json(
'%s/can_access_skill_editor/%s' % (
ACCESS_VALIDATION_HANDLER_PREFIX, self.skill_id
), expected_status_int=401
)
self.logout()
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the difference between a viewer and a new user? Because either:

  • There are discernible differences between both user roles, so they should be in their own separate test OR
  • There is no difference between both user roles, so we should drop one of these group of statements to avoid exercising duplicate behaviors

Copy link

oppiabot bot commented May 13, 2024

Hi @shivanandan17, I'm going to mark this PR as stale because it hasn't had any updates for 7 days. If no further activity occurs within 4 days, it will be automatically closed so that others can take up the issue.
If you are still working on this PR, please make a follow-up commit within 4 days (and submit it for review, if applicable). Please also let us know if you are stuck so we can help you!

@oppiabot oppiabot bot added the stale label May 13, 2024
@oppiabot oppiabot bot removed the stale label May 17, 2024
Copy link

oppiabot bot commented May 24, 2024

Hi @shivanandan17, I'm going to mark this PR as stale because it hasn't had any updates for 7 days. If no further activity occurs within 4 days, it will be automatically closed so that others can take up the issue.
If you are still working on this PR, please make a follow-up commit within 4 days (and submit it for review, if applicable). Please also let us know if you are stuck so we can help you!

@oppiabot oppiabot bot added the stale label May 24, 2024
@oppiabot oppiabot bot removed the stale label May 26, 2024
Copy link

oppiabot bot commented Jun 2, 2024

Hi @shivanandan17, I'm going to mark this PR as stale because it hasn't had any updates for 7 days. If no further activity occurs within 4 days, it will be automatically closed so that others can take up the issue.
If you are still working on this PR, please make a follow-up commit within 4 days (and submit it for review, if applicable). Please also let us know if you are stuck so we can help you!

@oppiabot oppiabot bot added the stale label Jun 2, 2024
@oppiabot oppiabot bot closed this Jun 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants