From 44e41f9a880b05750a8bad8f4328023d80eaa493 Mon Sep 17 00:00:00 2001 From: kajol <44888949+Kajol-Kumari@users.noreply.github.com> Date: Fri, 15 May 2020 03:44:24 +0530 Subject: [PATCH 1/4] Bug fix in removing emails from banned email ID's(#317) --- .../challengesettings/challengesettings.component.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/app/components/challenge/challengesettings/challengesettings.component.ts b/src/app/components/challenge/challengesettings/challengesettings.component.ts index f28248449..d358adbec 100644 --- a/src/app/components/challenge/challengesettings/challengesettings.component.ts +++ b/src/app/components/challenge/challengesettings/challengesettings.component.ts @@ -105,11 +105,14 @@ export class ChallengesettingsComponent implements OnInit { */ remove(email): void { const SELF = this; - const index = this.bannedEmailIds.indexOf(email); + const index = SELF.bannedEmailIds.indexOf(email); if (index >= 0) { - this.bannedEmailIds.splice(index, 1); + SELF.bannedEmailIds.splice(index, 1); } + + // updating the banned Email Ids list + SELF.updateBannedEmailList(); } validateEmail(email) { From 2b9f2bfac6338341c082a54b3ef6f0a6822dbe90 Mon Sep 17 00:00:00 2001 From: Sanjeev Singh Date: Sun, 17 May 2020 13:49:46 +0530 Subject: [PATCH 2/4] Add dpkg package to update chrome version to match chrome driver version on travis (#318) --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index 2f9bbbec8..17b75afd1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,6 +2,9 @@ sudo: required dist: trusty language: node_js addons: + apt: + packages: + - dpkg chrome: stable node_js: From e5816b94a16d4be5a7ef1ace0b60e7d116b76b2c Mon Sep 17 00:00:00 2001 From: kajol <44888949+Kajol-Kumari@users.noreply.github.com> Date: Mon, 18 May 2020 11:18:06 +0530 Subject: [PATCH 3/4] Docs: Add instructions to rebase PR(#294) * rebase_feature_added_in_contribution_guideline * rebase_feature_added_in_contribution_guideline * minor_changes Co-authored-by: Rishabh Jain --- .github/CONTRIBUTING.md | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 4dd9fc868..7ada159cb 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -68,8 +68,28 @@ git checkout -b your-branch-name - If your checks have passed, your PR will be assigned a reviewer who will review your code and provide comments. Please address each review comment by pushing new commits to the same branch (the PR will automatically update, so you don’t need to submit a new one). Once you are done, comment below each review comment marking it as “Done”. Feel free to use the thread to have a discussion about comments that you don’t understand completely or don’t agree with. - - Once all comments are addressed, the reviewer will give an LGTM (‘looks good to me’) and merge the PR. -4. Rules for great commit messages: + - Once all comments are addressed, the maintainer will approve the PR. + +4. Once you get reviewed by a mentor and done with all the required changes, squash all the commits: + +``` +git checkout +git rebase -i HEAD~N (N is the number of commits to be squashed) +``` + +Then a screen will appear with all N commits having "pick" written in front of every commit.Change pick to s for the last N-1 commits and let it be pick for the first one. + +Press esc button and type ":wq" to save the change and close the screen. Now a new screen will appear asking you to change commit message. Change it accordingly and save it. + +``` +git push origin --force +``` + +For further query regarding rebasing, visit https://github.com/todotxt/todo.txt-android/wiki/Squash-All-Commits-Related-to-a-Single-Issue-into-a-Single-Commit + +Once rebasing is done, the reviewer will approve and merge the PR. + +5. Rules for great commit messages: - Write your commit message in the imperative: "Fix bug" and not "Fixed bug" or "Fixes bug." @@ -85,7 +105,7 @@ git checkout -b your-branch-name - Describe why a change is being made. -5. Commit message is important as it should answers/should do the following: +6. Commit message is important as it should answers/should do the following: - How does it address the issue? @@ -95,7 +115,7 @@ git checkout -b your-branch-name - Provide concise explaination to the user about limitations of the current code, like a bug or an issue -6. Examples of a great commit message: +7. Examples of a great commit message: - Add CPU arch filter scheduler support From 877957af440b4bee5e0910dcbf5072fc76e78cfc Mon Sep 17 00:00:00 2001 From: kajol <44888949+Kajol-Kumari@users.noreply.github.com> Date: Fri, 22 May 2020 05:07:19 +0530 Subject: [PATCH 4/4] Add lazy loading and code refactoring(#303) * using_feature_modules_for_app_module_and_app_routing_moduke * app_module_and_app_router_refactored --- src/app/app-routing.module.ts | 66 -------- src/app/app.module.ts | 141 ++---------------- .../components/auth/auth-routing.module.ts | 29 ++++ src/app/components/auth/auth.module.ts | 51 +++++++ .../challenge/challenge-routing.module.ts | 44 ++++++ .../components/challenge/challenge.module.ts | 99 ++++++++++++ .../components/dashboard/dashboard.module.ts | 30 ++++ .../components/home/home-routing.module.ts | 18 +++ src/app/components/home/home.module.ts | 46 ++++++ src/app/components/nav/nav.module.ts | 32 ++++ .../publiclists/publiclist-routing.module.ts | 27 ++++ .../publiclists/publiclist.module.ts | 56 +++++++ src/app/components/utility/utility.module.ts | 70 +++++++++ 13 files changed, 518 insertions(+), 191 deletions(-) create mode 100644 src/app/components/auth/auth-routing.module.ts create mode 100644 src/app/components/auth/auth.module.ts create mode 100644 src/app/components/challenge/challenge-routing.module.ts create mode 100644 src/app/components/challenge/challenge.module.ts create mode 100644 src/app/components/dashboard/dashboard.module.ts create mode 100644 src/app/components/home/home-routing.module.ts create mode 100644 src/app/components/home/home.module.ts create mode 100644 src/app/components/nav/nav.module.ts create mode 100644 src/app/components/publiclists/publiclist-routing.module.ts create mode 100644 src/app/components/publiclists/publiclist.module.ts create mode 100644 src/app/components/utility/utility.module.ts diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 53507f122..81b1ead8a 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -1,30 +1,12 @@ import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; import { RouterModule, Routes } from '@angular/router'; import { HomeComponent } from './components/home/home.component'; -import { AuthComponent } from './components/auth/auth.component'; -import { LoginComponent } from './components/auth/login/login.component'; -import { SignupComponent } from './components/auth/signup/signup.component'; -import { VerifyEmailComponent } from './components/auth/verify-email/verify-email.component'; import { PubliclistsComponent } from './components/publiclists/publiclists.component'; -import { ChallengelistComponent } from './components/publiclists/challengelist/challengelist.component'; import { TeamlistComponent } from './components/publiclists/teamlist/teamlist.component'; import { ContactComponent } from './components/contact/contact.component'; import { PrivacyPolicyComponent } from './components/privacy-policy/privacy-policy.component'; import { GetInvolvedComponent } from './components/get-involved/get-involved.component'; import { AboutComponent } from './components/about/about.component'; -import { ChallengeComponent } from './components/challenge/challenge.component'; -import { ChallengesettingsComponent } from './components/challenge/challengesettings/challengesettings.component'; -import { ChallengeoverviewComponent} from './components/challenge/challengeoverview/challengeoverview.component'; -import { ChallengeevaluationComponent } from './components/challenge/challengeevaluation/challengeevaluation.component'; -import { ChallengephasesComponent} from './components/challenge/challengephases/challengephases.component'; -import { ChallengeparticipateComponent } from './components/challenge/challengeparticipate/challengeparticipate.component'; -import { ChallengeleaderboardComponent } from './components/challenge/challengeleaderboard/challengeleaderboard.component'; -import { ChallengesubmitComponent } from './components/challenge/challengesubmit/challengesubmit.component'; -import { ChallengesubmissionsComponent } from './components/challenge/challengesubmissions/challengesubmissions.component'; -import { - ChallengeviewallsubmissionsComponent -} from './components/challenge/challengeviewallsubmissions/challengeviewallsubmissions.component'; import { ChallengeCreateComponent } from './components/challenge-create/challenge-create.component'; import { DashboardComponent } from './components/dashboard/dashboard.component'; import { ProfileComponent } from './components/profile/profile.component'; @@ -32,8 +14,6 @@ import { OurTeamComponent } from './components/our-team/our-team.component'; import { NotFoundComponent } from './components/not-found/not-found.component'; import {AnalyticsComponent} from './components/analytics/analytics.component'; import {HostAnalyticsComponent} from './components/analytics/host-analytics/host-analytics.component'; -import {ResetPasswordComponent} from './components/auth/reset-password/reset-password.component'; -import {ResetPasswordConfirmComponent} from './components/auth/reset-password-confirm/reset-password-confirm.component'; const routes: Routes = [ { @@ -47,52 +27,6 @@ const routes: Routes = [ path: 'about', component: AboutComponent }, - { - path: 'auth', - component: AuthComponent, - children: [ - {path: '', redirectTo: 'login', pathMatch: 'full'}, - {path: 'login', component: LoginComponent}, - {path: 'reset-password', component: ResetPasswordComponent}, - {path: 'reset-password/confirm/:user_id/:reset_token', component: ResetPasswordConfirmComponent}, - {path: 'signup', component: SignupComponent}, - {path: 'verify-email/:token', component: VerifyEmailComponent}, - {path: '**', redirectTo: 'login'} - ] - }, - { - path: 'challenge', - redirectTo: 'challenges' - }, - { - path: 'challenge/:id', - component: ChallengeComponent, - children: [ - {path: '', redirectTo: 'overview', pathMatch: 'full'}, - {path: 'overview', component: ChallengeoverviewComponent}, - {path: 'evaluation', component: ChallengeevaluationComponent}, - {path: 'phases', component: ChallengephasesComponent}, - {path: 'participate', component: ChallengeparticipateComponent}, - {path: 'submit', component: ChallengesubmitComponent}, - {path: 'my-submissions', component: ChallengesubmissionsComponent}, - {path: 'my-submissions/:phase', component: ChallengesubmissionsComponent}, - {path: 'mysubmissions/:phase/:submission', component: ChallengesubmissionsComponent}, - {path: 'view-all-submissions', component: ChallengeviewallsubmissionsComponent}, - {path: 'leaderboard', component: ChallengeleaderboardComponent}, - {path: 'leaderboard/:split', component: ChallengeleaderboardComponent}, - {path: 'leaderboard/:split/:entry', component: ChallengeleaderboardComponent}, - {path: 'settings', component: ChallengesettingsComponent} - ] - }, - { - path: 'challenges', - component: PubliclistsComponent, - children: [ - {path: '', redirectTo: 'all', pathMatch: 'full'}, - {path: 'all', component: ChallengelistComponent}, - {path: 'me', component: ChallengelistComponent} - ] - }, { path: 'challenge-create', component: ChallengeCreateComponent diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 99f1769ae..45642f021 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -3,17 +3,8 @@ import {BrowserAnimationsModule} from '@angular/platform-browser/animations'; import { NgModule } from '@angular/core'; import { HttpClientModule } from '@angular/common/http'; import { EmailValidator, FormsModule } from '@angular/forms'; -import { FroalaEditorModule, FroalaViewModule } from 'angular-froala-wysiwyg'; -import { TextareaAutosizeModule } from 'ngx-textarea-autosize'; -import { OwlDateTimeModule, OwlNativeDateTimeModule } from 'ng-pick-datetime'; -import { MatSelectModule } from '@angular/material/select'; -import { MatChipsModule } from '@angular/material/chips'; -import { MatMenuModule } from '@angular/material/menu'; -import { MatIconModule } from '@angular/material/icon'; -import { MatCheckboxModule } from '@angular/material'; -// Import serivces -import { AuthService } from './services/auth.service'; +// Import services import { WindowService } from './services/window.service'; import { ApiService } from './services/api.service'; import { GlobalService } from './services/global.service'; @@ -23,159 +14,59 @@ import { EndpointsService } from './services/endpoints.service'; // Import Components import { AppComponent } from './app.component'; -import { HomeComponent } from './components/home/home.component'; import { AppRoutingModule } from './app-routing.module'; -import { HeaderStaticComponent } from './components/nav/header-static/header-static.component'; import { ContactComponent } from './components/contact/contact.component'; -import { FooterComponent } from './components/nav/footer/footer.component'; import { PrivacyPolicyComponent } from './components/privacy-policy/privacy-policy.component'; -import { InputComponent } from './components/utility/input/input.component'; -import { AuthComponent } from './components/auth/auth.component'; -import { LoginComponent } from './components/auth/login/login.component'; -import { SignupComponent } from './components/auth/signup/signup.component'; -import { ToastComponent } from './components/utility/toast/toast.component'; import { GetInvolvedComponent } from './components/get-involved/get-involved.component'; import { AboutComponent } from './components/about/about.component'; -import { CardlistComponent } from './components/utility/cardlist/cardlist.component'; -import { ChallengecardComponent } from './components/publiclists/challengelist/challengecard/challengecard.component'; -import { ChallengelistComponent } from './components/publiclists/challengelist/challengelist.component'; -import { TeamcardComponent } from './components/publiclists/teamlist/teamcard/teamcard.component'; -import { TeamlistComponent } from './components/publiclists/teamlist/teamlist.component'; -import { PubliclistsComponent } from './components/publiclists/publiclists.component'; -import { ForceloginComponent } from './components/utility/forcelogin/forcelogin.component'; -import { ChallengeComponent } from './components/challenge/challenge.component'; -import { ChallengeoverviewComponent } from './components/challenge/challengeoverview/challengeoverview.component'; -import { ChallengeevaluationComponent } from './components/challenge/challengeevaluation/challengeevaluation.component'; -import { ChallengephasesComponent } from './components/challenge/challengephases/challengephases.component'; -import { ChallengeparticipateComponent } from './components/challenge/challengeparticipate/challengeparticipate.component'; -import { ChallengeleaderboardComponent } from './components/challenge/challengeleaderboard/challengeleaderboard.component'; -import { ChallengesubmitComponent } from './components/challenge/challengesubmit/challengesubmit.component'; -import { ChallengesubmissionsComponent } from './components/challenge/challengesubmissions/challengesubmissions.component'; -import { PhasecardComponent } from './components/challenge/challengephases/phasecard/phasecard.component'; -import { ConfirmComponent } from './components/utility/confirm/confirm.component'; -import { LoadingComponent } from './components/utility/loading/loading.component'; -import { SelectphaseComponent } from './components/utility/selectphase/selectphase.component'; -import { HomemainComponent } from './components/home/homemain/homemain.component'; import { ChallengeCreateComponent } from './components/challenge-create/challenge-create.component'; -import { VerifyEmailComponent } from './components/auth/verify-email/verify-email.component'; -import { ModalComponent } from './components/utility/modal/modal.component'; -import { DashboardComponent } from './components/dashboard/dashboard.component'; import { ProfileComponent } from './components/profile/profile.component'; import { NotFoundComponent } from './components/not-found/not-found.component'; import { OurTeamComponent } from './components/our-team/our-team.component'; -import { TwitterFeedComponent } from './components/home/twitter-feed/twitter-feed.component'; import { NgxTwitterTimelineModule } from 'ngx-twitter-timeline'; -import { PartnersComponent } from './components/home/partners/partners.component'; -import { RulesComponent } from './components/home/rules/rules.component'; -import { TestimonialsComponent } from './components/home/testimonials/testimonials.component'; -import { FeaturedChallengesComponent } from './components/home/featured-challenges/featured-challenges.component'; -import { ChallengesettingsComponent } from './components/challenge/challengesettings/challengesettings.component'; import { AnalyticsComponent } from './components/analytics/analytics.component'; import { HostAnalyticsComponent } from './components/analytics/host-analytics/host-analytics.component'; -import { EditphasemodalComponent } from './components/challenge/challengephases/editphasemodal/editphasemodal.component'; -import { - TermsAndConditionsModalComponent -} from './components/challenge/challengeparticipate/terms-and-conditions-modal/terms-and-conditions-modal.component'; -import { - ChallengeviewallsubmissionsComponent -} from './components/challenge/challengeviewallsubmissions/challengeviewallsubmissions.component'; -import { SideBarComponent } from './components/utility/side-bar/side-bar.component'; +import { AuthModule } from './components/auth/auth.module'; +import { PubliclistModule } from './components/publiclists/publiclist.module'; +import { HomeModule } from './components/home/home.module'; +import { AuthService } from './services/auth.service'; +import { ChallengeModule } from './components/challenge/challenge.module'; +import { DashboardModule } from './components/dashboard/dashboard.module'; -import { MatTableModule } from '@angular/material/table'; -import { MatDividerModule } from '@angular/material/divider'; -import { DashboardContentComponent } from './components/dashboard/dashboard-content/dashboard-content.component'; -import {PasswordMismatchValidatorDirective} from './Directives/password.validator'; -import { ResetPasswordComponent } from './components/auth/reset-password/reset-password.component'; -import { EmailValidatorDirective } from './Directives/email.validator'; -import { ResetPasswordConfirmComponent } from './components/auth/reset-password-confirm/reset-password-confirm.component'; @NgModule({ declarations: [ AppComponent, - HomeComponent, - HeaderStaticComponent, - FooterComponent, PrivacyPolicyComponent, - InputComponent, - AuthComponent, - LoginComponent, - SignupComponent, ContactComponent, - ToastComponent, GetInvolvedComponent, AboutComponent, - CardlistComponent, - ChallengecardComponent, - ChallengelistComponent, - TeamcardComponent, - TeamlistComponent, - PubliclistsComponent, - ForceloginComponent, - ChallengeComponent, - ChallengeoverviewComponent, - ChallengeevaluationComponent, - ChallengephasesComponent, - ChallengeparticipateComponent, - ChallengeleaderboardComponent, - ChallengesubmitComponent, - ChallengesubmissionsComponent, - PhasecardComponent, - ConfirmComponent, - LoadingComponent, - SelectphaseComponent, - HomemainComponent, ChallengeCreateComponent, - VerifyEmailComponent, - ModalComponent, - DashboardComponent, ProfileComponent, NotFoundComponent, OurTeamComponent, - TwitterFeedComponent, - PartnersComponent, - RulesComponent, - TestimonialsComponent, - ChallengesettingsComponent, - SideBarComponent, AnalyticsComponent, - FeaturedChallengesComponent, - DashboardContentComponent, - HostAnalyticsComponent, - PasswordMismatchValidatorDirective, - EmailValidatorDirective, - ResetPasswordComponent, - EditphasemodalComponent, - ResetPasswordConfirmComponent, - ChallengeviewallsubmissionsComponent, - TermsAndConditionsModalComponent + HostAnalyticsComponent ], imports: [ + AuthModule, + HomeModule, + PubliclistModule, + ChallengeModule, + DashboardModule, BrowserModule, BrowserAnimationsModule, AppRoutingModule, HttpClientModule, - FormsModule, - NgxTwitterTimelineModule, - FroalaEditorModule.forRoot(), - FroalaViewModule.forRoot(), - TextareaAutosizeModule, - OwlDateTimeModule, - OwlNativeDateTimeModule, - MatSelectModule, - MatChipsModule, - MatMenuModule, - MatIconModule, - MatTableModule, - MatDividerModule, - MatCheckboxModule + FormsModule ], providers: [ - AuthService, WindowService, + AuthService, ApiService, GlobalService, ChallengeService, EndpointsService ], - bootstrap: [AppComponent] + bootstrap: [AppComponent], }) export class AppModule { } diff --git a/src/app/components/auth/auth-routing.module.ts b/src/app/components/auth/auth-routing.module.ts new file mode 100644 index 000000000..eb8fde95e --- /dev/null +++ b/src/app/components/auth/auth-routing.module.ts @@ -0,0 +1,29 @@ +import { NgModule } from '@angular/core'; +import { RouterModule, Routes } from '@angular/router'; +import { AuthComponent } from './auth.component'; +import { LoginComponent } from './login/login.component'; +import { ResetPasswordComponent } from './reset-password/reset-password.component'; +import { ResetPasswordConfirmComponent } from './reset-password-confirm/reset-password-confirm.component'; +import { SignupComponent } from './signup/signup.component'; +import { VerifyEmailComponent } from './verify-email/verify-email.component'; + +const routes: Routes = [ + { + path: 'auth', + component: AuthComponent, + children: [ + {path: '', redirectTo: 'login', pathMatch: 'full'}, + {path: 'login', component: LoginComponent}, + {path: 'reset-password', component: ResetPasswordComponent}, + {path: 'reset-password/confirm/:user_id/:reset_token', component: ResetPasswordConfirmComponent}, + {path: 'signup', component: SignupComponent}, + {path: 'verify-email/:token', component: VerifyEmailComponent}, + {path: '**', redirectTo: 'login'} + ] + }, +]; +@NgModule({ + imports: [ RouterModule.forChild(routes)], + exports: [RouterModule] +}) +export class AuthRoutingModule {} diff --git a/src/app/components/auth/auth.module.ts b/src/app/components/auth/auth.module.ts new file mode 100644 index 000000000..48c838b20 --- /dev/null +++ b/src/app/components/auth/auth.module.ts @@ -0,0 +1,51 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { FormsModule } from '@angular/forms'; +import { RouterModule } from '@angular/router'; + +// import components +import { LoginComponent } from './login/login.component'; +import { SignupComponent } from './signup/signup.component'; +import { ResetPasswordConfirmComponent } from './reset-password-confirm/reset-password-confirm.component'; +import { ResetPasswordComponent } from './reset-password/reset-password.component'; +import { VerifyEmailComponent } from './verify-email/verify-email.component'; +import { AuthComponent } from './auth.component'; + +// import modules +import { AuthRoutingModule } from './auth-routing.module'; +import { NavModule } from '../nav/nav.module'; + +// import services +import { AuthService } from '../../services/auth.service'; + + +@NgModule({ + declarations: [ + LoginComponent, + SignupComponent, + ResetPasswordConfirmComponent, + ResetPasswordComponent, + VerifyEmailComponent, + AuthComponent + ], + imports: [ + CommonModule, + RouterModule, + AuthRoutingModule, + FormsModule, + NavModule + ], + exports: [ + LoginComponent, + SignupComponent, + ResetPasswordConfirmComponent, + ResetPasswordComponent, + VerifyEmailComponent, + AuthComponent, + NavModule + ], + providers: [ + AuthService + ] +}) +export class AuthModule { } diff --git a/src/app/components/challenge/challenge-routing.module.ts b/src/app/components/challenge/challenge-routing.module.ts new file mode 100644 index 000000000..5fd85b3d8 --- /dev/null +++ b/src/app/components/challenge/challenge-routing.module.ts @@ -0,0 +1,44 @@ +import { NgModule } from '@angular/core'; +import { RouterModule, Routes } from '@angular/router'; +import { ChallengeComponent } from './challenge.component'; +import { ChallengeoverviewComponent } from './challengeoverview/challengeoverview.component'; +import { ChallengeevaluationComponent } from './challengeevaluation/challengeevaluation.component'; +import { ChallengephasesComponent } from './challengephases/challengephases.component'; +import { ChallengeparticipateComponent } from './challengeparticipate/challengeparticipate.component'; +import { ChallengesubmitComponent } from './challengesubmit/challengesubmit.component'; +import { ChallengesubmissionsComponent } from './challengesubmissions/challengesubmissions.component'; +import { ChallengeviewallsubmissionsComponent } from './challengeviewallsubmissions/challengeviewallsubmissions.component'; +import { ChallengeleaderboardComponent } from './challengeleaderboard/challengeleaderboard.component'; +import { ChallengesettingsComponent } from './challengesettings/challengesettings.component'; + +const routes: Routes = [ + { + path: 'challenge', + redirectTo: 'challenges' + }, + { + path: 'challenge/:id', + component: ChallengeComponent, + children: [ + {path: '', redirectTo: 'overview', pathMatch: 'full'}, + {path: 'overview', component: ChallengeoverviewComponent}, + {path: 'evaluation', component: ChallengeevaluationComponent}, + {path: 'phases', component: ChallengephasesComponent}, + {path: 'participate', component: ChallengeparticipateComponent}, + {path: 'submit', component: ChallengesubmitComponent}, + {path: 'my-submissions', component: ChallengesubmissionsComponent}, + {path: 'my-submissions/:phase', component: ChallengesubmissionsComponent}, + {path: 'mysubmissions/:phase/:submission', component: ChallengesubmissionsComponent}, + {path: 'view-all-submissions', component: ChallengeviewallsubmissionsComponent}, + {path: 'leaderboard', component: ChallengeleaderboardComponent}, + {path: 'leaderboard/:split', component: ChallengeleaderboardComponent}, + {path: 'leaderboard/:split/:entry', component: ChallengeleaderboardComponent}, + {path: 'settings', component: ChallengesettingsComponent} + ] + }, +]; +@NgModule({ +imports: [RouterModule.forChild(routes)], +exports: [RouterModule] +}) +export class ChallengeRoutingModule {} diff --git a/src/app/components/challenge/challenge.module.ts b/src/app/components/challenge/challenge.module.ts new file mode 100644 index 000000000..b905344ab --- /dev/null +++ b/src/app/components/challenge/challenge.module.ts @@ -0,0 +1,99 @@ +import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { + MatChipsModule, + MatTableModule, + MatMenuModule, + MatSelectModule, + MatIconModule, + MatDividerModule, + MatCheckboxModule } from '@angular/material'; +import { FormsModule } from '@angular/forms'; +import { RouterModule } from '@angular/router'; +import { FroalaEditorModule, FroalaViewModule } from 'angular-froala-wysiwyg'; + +// import components +import { ChallengeevaluationComponent } from './challengeevaluation/challengeevaluation.component'; +import { ChallengeleaderboardComponent } from './challengeleaderboard/challengeleaderboard.component'; +import { ChallengeoverviewComponent } from './challengeoverview/challengeoverview.component'; +import { ChallengeparticipateComponent } from './challengeparticipate/challengeparticipate.component'; +import { ChallengephasesComponent } from './challengephases/challengephases.component'; +import { ChallengesettingsComponent } from './challengesettings/challengesettings.component'; +import { ChallengesubmissionsComponent } from './challengesubmissions/challengesubmissions.component'; +import { ChallengesubmitComponent } from './challengesubmit/challengesubmit.component'; +import { ChallengeviewallsubmissionsComponent } from './challengeviewallsubmissions/challengeviewallsubmissions.component'; +import { TermsAndConditionsModalComponent } from './challengeparticipate/terms-and-conditions-modal/terms-and-conditions-modal.component'; +import { EditphasemodalComponent } from './challengephases/editphasemodal/editphasemodal.component'; +import { PhasecardComponent } from './challengephases/phasecard/phasecard.component'; +import { ChallengeComponent } from './challenge.component'; + +// import Modules +import { NavModule } from '../nav/nav.module'; +import { ChallengeRoutingModule } from './challenge-routing.module'; +import { PubliclistModule } from '../publiclists/publiclist.module'; + +// import services +import { ApiService } from '../../services/api.service'; +import { ChallengeService } from '../../services/challenge.service'; +import { AuthService } from '../../services/auth.service'; +import { GlobalService } from '../../services/global.service'; + +@NgModule({ + declarations: [ + ChallengeevaluationComponent, + ChallengeleaderboardComponent, + ChallengeoverviewComponent, + ChallengeparticipateComponent, + ChallengephasesComponent, + EditphasemodalComponent, + PhasecardComponent, + ChallengesettingsComponent, + ChallengesubmissionsComponent, + ChallengesubmitComponent, + ChallengeviewallsubmissionsComponent, + TermsAndConditionsModalComponent, + ChallengeComponent + ], + imports: [ + CommonModule, + RouterModule, + FormsModule, + MatChipsModule, + MatTableModule, + MatMenuModule, + MatSelectModule, + MatIconModule, + MatDividerModule, + MatCheckboxModule, + FroalaEditorModule.forRoot(), + FroalaViewModule.forRoot(), + ChallengeRoutingModule, + PubliclistModule, + NavModule + ], + exports: [ + ChallengeevaluationComponent, + ChallengeleaderboardComponent, + ChallengeoverviewComponent, + ChallengeparticipateComponent, + ChallengephasesComponent, + EditphasemodalComponent, + PhasecardComponent, + ChallengesettingsComponent, + ChallengesubmissionsComponent, + ChallengesubmitComponent, + ChallengeviewallsubmissionsComponent, + TermsAndConditionsModalComponent, + ChallengeComponent, + PubliclistModule, + NavModule + ], + providers: [ + ChallengeService, + ApiService, + AuthService, + GlobalService + ], + schemas: [ CUSTOM_ELEMENTS_SCHEMA ], +}) +export class ChallengeModule { } diff --git a/src/app/components/dashboard/dashboard.module.ts b/src/app/components/dashboard/dashboard.module.ts new file mode 100644 index 000000000..6270fc3d9 --- /dev/null +++ b/src/app/components/dashboard/dashboard.module.ts @@ -0,0 +1,30 @@ +import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { RouterModule } from '@angular/router'; + +// import components +import { DashboardComponent } from './dashboard.component'; +import { DashboardContentComponent } from './dashboard-content/dashboard-content.component'; + +// import modules +import { NavModule } from '../nav/nav.module'; + +@NgModule({ +declarations: [ + DashboardContentComponent, + DashboardComponent +], +imports: [ + CommonModule, + RouterModule, + NavModule +], +exports: [ + DashboardContentComponent, + DashboardComponent, + NavModule +], +schemas: [ CUSTOM_ELEMENTS_SCHEMA ], +}) + +export class DashboardModule {} diff --git a/src/app/components/home/home-routing.module.ts b/src/app/components/home/home-routing.module.ts new file mode 100644 index 000000000..acdbf5b5e --- /dev/null +++ b/src/app/components/home/home-routing.module.ts @@ -0,0 +1,18 @@ +import { NgModule } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; +import { HomeComponent } from './home.component'; + +const routes: Routes = [ + { + path: '', + component: HomeComponent, + data: { + 'title': 'EvalAI - Welcome' + } + }, +]; +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule] +}) +export class HomeRoutingModule {} diff --git a/src/app/components/home/home.module.ts b/src/app/components/home/home.module.ts new file mode 100644 index 000000000..05f755be3 --- /dev/null +++ b/src/app/components/home/home.module.ts @@ -0,0 +1,46 @@ +import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { NgxTwitterTimelineModule } from 'ngx-twitter-timeline'; +import { RouterModule } from '@angular/router'; + +// import components +import { FeaturedChallengesComponent } from './featured-challenges/featured-challenges.component'; +import { HomemainComponent } from './homemain/homemain.component'; +import { PartnersComponent } from './partners/partners.component'; +import { RulesComponent } from './rules/rules.component'; +import { TestimonialsComponent } from './testimonials/testimonials.component'; +import { TwitterFeedComponent } from './twitter-feed/twitter-feed.component'; +import { HomeComponent } from './home.component'; + +// import module +import { NavModule } from '../nav/nav.module'; + +@NgModule({ + declarations: [ + FeaturedChallengesComponent, + HomemainComponent, + PartnersComponent, + RulesComponent, + TestimonialsComponent, + TwitterFeedComponent, + HomeComponent + ], + imports: [ + CommonModule, + RouterModule, + NgxTwitterTimelineModule, + NavModule + ], + exports: [ + FeaturedChallengesComponent, + HomemainComponent, + PartnersComponent, + RulesComponent, + TestimonialsComponent, + TwitterFeedComponent, + HomeComponent, + NavModule + ], + schemas: [ CUSTOM_ELEMENTS_SCHEMA ], +}) +export class HomeModule { } diff --git a/src/app/components/nav/nav.module.ts b/src/app/components/nav/nav.module.ts new file mode 100644 index 000000000..36c81a269 --- /dev/null +++ b/src/app/components/nav/nav.module.ts @@ -0,0 +1,32 @@ +import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { FormsModule } from '@angular/forms'; +import { RouterModule } from '@angular/router'; + +// import component +import { FooterComponent } from './footer/footer.component'; +import { HeaderStaticComponent } from './header-static/header-static.component'; + +// import module +import { UtilityModule } from '../utility/utility.module'; + +@NgModule({ +declarations: [ + FooterComponent, + HeaderStaticComponent +], +imports: [ + CommonModule, + FormsModule, + RouterModule, + UtilityModule +], +exports: [ + FooterComponent, + HeaderStaticComponent, + UtilityModule +], +schemas: [ CUSTOM_ELEMENTS_SCHEMA ], +}) + +export class NavModule {} diff --git a/src/app/components/publiclists/publiclist-routing.module.ts b/src/app/components/publiclists/publiclist-routing.module.ts new file mode 100644 index 000000000..207b25c56 --- /dev/null +++ b/src/app/components/publiclists/publiclist-routing.module.ts @@ -0,0 +1,27 @@ +import { NgModule } from '@angular/core'; + +import { RouterModule, Routes } from '@angular/router'; +import { ChallengelistComponent } from './challengelist/challengelist.component'; +import { PubliclistsComponent } from './publiclists.component'; + +const routes: Routes = [ + { + path: 'challenge', + redirectTo: 'challenges' + }, + { + path: 'challenges', + component: PubliclistsComponent, + children: [ + {path: '', redirectTo: 'all', pathMatch: 'full'}, + {path: 'all', component: ChallengelistComponent}, + {path: 'me', component: ChallengelistComponent} + ] + }, +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule] +}) +export class PubliclistRoutingModule {} diff --git a/src/app/components/publiclists/publiclist.module.ts b/src/app/components/publiclists/publiclist.module.ts new file mode 100644 index 000000000..94ce8766c --- /dev/null +++ b/src/app/components/publiclists/publiclist.module.ts @@ -0,0 +1,56 @@ +import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { RouterModule } from '@angular/router'; +import { FormsModule } from '@angular/forms'; + +// import components +import { ChallengelistComponent } from './challengelist/challengelist.component'; +import { ChallengecardComponent } from './challengelist/challengecard/challengecard.component'; +import { TeamcardComponent } from './teamlist/teamcard/teamcard.component'; +import { TeamlistComponent } from './teamlist/teamlist.component'; +import { PubliclistsComponent } from './publiclists.component'; + +// import services +import { ApiService } from '../../services/api.service'; +import { GlobalService } from '../../services/global.service'; +import { AuthService } from '../../services/auth.service'; +import { ChallengeService } from '../../services/challenge.service'; + +// import routes +import { PubliclistRoutingModule } from './publiclist-routing.module'; + +// import Module +import { NavModule } from '../nav/nav.module'; + +@NgModule({ + declarations: [ + ChallengelistComponent, + ChallengecardComponent, + TeamcardComponent, + TeamlistComponent, + PubliclistsComponent + ], + imports: [ + CommonModule, + RouterModule, + FormsModule, + PubliclistRoutingModule, + NavModule + ], + exports: [ + ChallengelistComponent, + ChallengecardComponent, + TeamcardComponent, + TeamlistComponent, + PubliclistsComponent, + NavModule + ], + providers: [ + ApiService, + GlobalService, + AuthService, + ChallengeService + ], + schemas: [ CUSTOM_ELEMENTS_SCHEMA ], +}) +export class PubliclistModule {} diff --git a/src/app/components/utility/utility.module.ts b/src/app/components/utility/utility.module.ts new file mode 100644 index 000000000..272de6ecf --- /dev/null +++ b/src/app/components/utility/utility.module.ts @@ -0,0 +1,70 @@ +import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { OwlDateTimeModule, OwlNativeDateTimeModule } from 'ng-pick-datetime'; +import { FroalaEditorModule, FroalaViewModule } from 'angular-froala-wysiwyg'; +import { RouterModule } from '@angular/router'; +import { MatChipsModule, MatTableModule, MatMenuModule, MatSelectModule, MatIconModule, MatDividerModule, MatCheckboxModule } from '@angular/material'; +import { FormsModule } from '@angular/forms'; + +// import components +import { CardlistComponent } from './cardlist/cardlist.component'; +import { ConfirmComponent } from './confirm/confirm.component'; +import { ForceloginComponent } from './forcelogin/forcelogin.component'; +import { InputComponent } from './input/input.component'; +import { LoadingComponent } from './loading/loading.component'; +import { ModalComponent } from './modal/modal.component'; +import { SelectphaseComponent } from './selectphase/selectphase.component'; +import { SideBarComponent } from './side-bar/side-bar.component'; +import { ToastComponent } from './toast/toast.component'; + +// import Directives +import { EmailValidatorDirective } from '../../Directives/email.validator'; +import { PasswordMismatchValidatorDirective } from '../../Directives/password.validator'; + +@NgModule({ +declarations: [ + CardlistComponent, + ConfirmComponent, + ForceloginComponent, + InputComponent, + LoadingComponent, + ModalComponent, + SelectphaseComponent, + SideBarComponent, + ToastComponent, + EmailValidatorDirective, + PasswordMismatchValidatorDirective +], +imports: [ + CommonModule, + FormsModule, + MatChipsModule, + MatTableModule, + MatMenuModule, + MatSelectModule, + MatIconModule, + MatDividerModule, + MatCheckboxModule, + RouterModule, + OwlDateTimeModule, + OwlNativeDateTimeModule, + FroalaEditorModule.forRoot(), + FroalaViewModule.forRoot(), +], +exports: [ + + CardlistComponent, + ConfirmComponent, + ForceloginComponent, + InputComponent, + LoadingComponent, + ModalComponent, + SelectphaseComponent, + SideBarComponent, + ToastComponent, + EmailValidatorDirective, + PasswordMismatchValidatorDirective +], +schemas: [ CUSTOM_ELEMENTS_SCHEMA ], +}) +export class UtilityModule {}