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

Fixes part of #8472: EdiatbleSkillBackendApiService migration to Angular 8 #8863

Closed
wants to merge 51 commits into from
Closed

Fixes part of #8472: EdiatbleSkillBackendApiService migration to Angular 8 #8863

wants to merge 51 commits into from

Conversation

srijanreddy98
Copy link
Member

@srijanreddy98 srijanreddy98 commented Mar 17, 2020

Overview

  1. This PR fixes part of Migrate AngularJS services to Angular 8 #8472.
  2. This PR does the following: migrates EditableSkillBackendApiService to angular 8

Essential Checklist

  • The PR title starts with "Fix #bugnum: ", followed by a short, clear summary of the changes. (If this PR fixes part of an issue, prefix the title with "Fix part of #bugnum: ...".)
  • The linter/Karma presubmit checks have passed locally on your machine.
  • "Allow edits from maintainers" is checked. (See here for instructions on how to enable it.)
    • This lets reviewers restart your CircleCI tests for you.
  • The PR is made from a branch that's not called "develop".

PR Pointers

  • Oppiabot will notify you when you don't add a PR_CHANGELOG label. If you are unable to do so, please @-mention a code owner (who will be in the Reviewers list), or ask on Gitter.
  • For what code owners will expect, see the Code Owner's wiki page.
  • Make sure your PR follows conventions in the style guide, otherwise this will lead to review delays
  • Never force push. If you do, your PR will be closed.

…arJS to Angular8. Migrate AngularJS files to Angular 8 #8472
…arJS to Angular8. Migrate AngularJS files to Angular 8 #8472
…arJS to Angular8. Migrate AngularJS files to Angular 8 #8472
…arJS to Angular8. Migrate AngularJS files to Angular 8 #8472
Revert yarn lock changes
Remove extra space after the last function argument.
@oppiabot
Copy link

oppiabot bot commented Mar 17, 2020

Hi, @srijanreddy98. This pull request does not have a "CHANGELOG: ..." label as mentioned in the PR checkbox list. Please add this label. PRs without this label will not be merged. If you are unsure of which label to add, please ask the reviewers for guidance. Thanks!

@srijanreddy98 srijanreddy98 changed the title Fixes part of #8472: EdiatbleSkillBackendApiService migration to angular 8 Fixes part of #8472: EdiatbleSkillBackendApiService migration to Angular 8 Mar 17, 2020
@srijanreddy98
Copy link
Member Author

It doesn't pass the karma tests or e2e tests. I pushed it using --no-verify. The reason for the failing tests is that the Request Interceptor is not intercepting the request.
@bansalnitish need help here. Any changes I need to make so that request interceptor intercepts the request.

@srijanreddy98
Copy link
Member Author

@sagangwee @DubeySandeep could you ptal

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.

@srijanreddy98, I've left a few comments, PTAL!

Also, can you please share the screenshot of a skill created and edited through this branch? (It would be helpful for reviewers)

@@ -330,6 +330,7 @@


# New structures team.
/core/templates/domain/skill/skill-domain.types.ts @bansalnitish
Copy link
Member

Choose a reason for hiding this comment

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

Move this inside skill project section (After line 360)

@@ -15,62 +15,53 @@
/**
* @fileoverview Unit tests for SkillBackendApiService.
*/
import { HttpClientTestingModule, HttpTestingController } from
Copy link
Member

Choose a reason for hiding this comment

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

Add a newline above

// ^^^ This block is to be removed.

import { CsrfTokenService } from
'services/csrf-token.service';
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 adjust this to the line above (line 22)? (Considering at max 80 chars in a line)

import { CsrfTokenService } from
'services/csrf-token.service';
import { SkillBackendApiService } from
'domain/skill/skill-backend-api.service';
Copy link
Member

Choose a reason for hiding this comment

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

Ditto

var deferred = $q.defer();
deferred.resolve('sample-csrf-token');
return deferred.promise;
let skillBackendApiService = null;
Copy link
Member

Choose a reason for hiding this comment

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

This is written as the angular8 service, right? If yes can we add the type of these variables?

SkillDomainConstants.EDITABLE_SKILL_DATA_URL_TEMPLATE, {
skill_id: skillId
});
// eslint-disable-next-line dot-notation
Copy link
Member

Choose a reason for hiding this comment

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

Why is this needed? If it's for any specific reason, can we avoid using pragma?

import { RequestInterceptor } from 'services/request-interceptor.service';


Copy link
Member

Choose a reason for hiding this comment

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

is this expected change?

@@ -22,10 +22,10 @@ import 'zone.js';
import { Component, NgModule, StaticProvider } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { downgradeComponent } from '@angular/upgrade/static';
import { HttpClientModule } from '@angular/common/http';
import { HTTP_INTERCEPTORS } from '@angular/common/http';
import { HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http';
Copy link
Member

Choose a reason for hiding this comment

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

Thanks for fixing this! :)

// TODO(#7165): Replace any with exact type.
export interface EditableSkillResponseConfig {
skill?: any;
skills?: any;
Copy link
Member

Choose a reason for hiding this comment

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

why both skill and skills, if required yo can create two interface skillResponse and skillsResponse

grouped_skill_summaries?: any;
}

export interface ChangeList {
Copy link
Member

Choose a reason for hiding this comment

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

ChangeList sounds like an array but it's a dict. don't use the List suffix

Copy link
Contributor

@sagangwee sagangwee left a comment

Choose a reason for hiding this comment

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

@srijanreddy98 LGTM once Sandeep's comments are addressed. Thanks!

}
);
this.http.get(skillDataUrl).toPromise().then(
(data: EditableSkillResponseConfig) => successCallback(data.skills),
Copy link
Contributor

Choose a reason for hiding this comment

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

I want to say this is a remnant of the renaming of the EditableSkillBackend service (the 'editable' was dropped).

@sagangwee sagangwee removed their assignment Apr 10, 2020
@oppiabot
Copy link

oppiabot bot commented Apr 18, 2020

Hi @srijanreddy98, 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 Apr 18, 2020
@bansalnitish
Copy link
Contributor

Ping @srijanreddy98

@oppiabot oppiabot bot removed the stale label Apr 21, 2020
@oppiabot
Copy link

oppiabot bot commented Apr 28, 2020

Hi @srijanreddy98, 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 Apr 28, 2020
@bansalnitish
Copy link
Contributor

Hey @srijanreddy98, could we get this in? (Let me know if you're busy I can take over this)

@oppiabot oppiabot bot removed the stale label Apr 28, 2020
@srijanreddy98
Copy link
Member Author

@bansalnitish sorry for letting this fall this far... I'll finish it. Actually I have deleted the fork which had this branch, so I will shift this to a different pr.

@kevinlee12
Copy link
Contributor

@srijanreddy98 should this PR be closed? If so, please close it.

@nithusha21
Copy link
Contributor

Hi @srijanreddy98 could you please merge with develop as there were some new checks introduced, and a change to the development workflow which will help make sure develop will not break after merging this PR.

@srijanreddy98
Copy link
Member Author

@nithusha21 I am closing this pr, it needs some work with the typings and I had to delete this version of my fork because it kept on adding some files changes (made in my very first pr) to every pr I made. Please continue as if this didn't exist

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants