Skip to content

Commit

Permalink
Added GITHUB AUTH
Browse files Browse the repository at this point in the history
  • Loading branch information
keshavsingh4522 committed Jan 7, 2024
1 parent 56836e3 commit f2ddc38
Show file tree
Hide file tree
Showing 22 changed files with 494 additions and 41 deletions.
19 changes: 13 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"@ngx-translate/core": "^15.0.0",
"@ngx-translate/http-loader": "^8.0.0",
"@popperjs/core": "^2.11.6",
"angular-oauth2-oidc": "^17.0.1",
"aos": "^2.3.4",
"bootstrap": "^5.3.2",
"crypto-js": "^4.2.0",
Expand Down
2 changes: 1 addition & 1 deletion src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { SettingComponent } from './components/setting/setting.component';
import { authGuard } from './guards/auth/auth.guard';
import { HomeComponent } from './components/home/home.component';
import { NotFoundComponent } from './components/general/not-found/not-found.component';
import { OauthButtonComponent } from './components/oauth/oauth-button/oauth-button.component';

const routes: Routes = [
{ path: '', component: HomeComponent, pathMatch: 'full' },
Expand Down Expand Up @@ -36,7 +37,6 @@ const routes: Routes = [
path: 'other',
loadChildren: () => import('./components/other-activity/other-activity.module').then(m => m.OtherActivityModule)
},

{ path: '404', component: NotFoundComponent },
{ path: '**', redirectTo: '/404', pathMatch: 'full' }
];
Expand Down
15 changes: 12 additions & 3 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { ReactiveFormsModule, FormsModule } from '@angular/forms';
import { AppRoutingModule } from './app-routing.module';
import { HttpClientModule, HttpClient } from '@angular/common/http';
import { HttpClientModule, HttpClient, HTTP_INTERCEPTORS } from '@angular/common/http';
import { TranslateModule, TranslateLoader } from '@ngx-translate/core';
import { TranslateHttpLoader } from '@ngx-translate/http-loader';

Expand Down Expand Up @@ -43,6 +43,8 @@ import { MatProgressBarModule } from '@angular/material/progress-bar';
import { QuestionEditDialogComponent } from './components/general/dialog/topic/question-edit-dialog/question-edit-dialog.component';
import { MatFormFieldModule } from '@angular/material/form-field';
import { MatChipsModule } from '@angular/material/chips';
import { GithubCallbackComponent } from './components/callback/github-callback/github-callback.component';
import { AuthInterceptor } from './guards/auth/interceptor/auth-interceptor.service';

// AOT compilation support
export function HttpLoaderFactory(http: HttpClient) {
Expand Down Expand Up @@ -76,7 +78,8 @@ export function HttpLoaderFactory(http: HttpClient) {
ConfettiComponent,
FileUploadComponent,
ConfirmDialogComponent,
QuestionEditDialogComponent
QuestionEditDialogComponent,
GithubCallbackComponent
],
// ...

Expand Down Expand Up @@ -107,7 +110,13 @@ export function HttpLoaderFactory(http: HttpClient) {
MatProgressBarModule,
MatChipsModule // Add this line
],
providers: [],
providers: [
{
provide: HTTP_INTERCEPTORS,
useClass: AuthInterceptor,
multi: true,
}
],
bootstrap: [AppComponent]
})
export class AppModule { }
4 changes: 3 additions & 1 deletion src/app/components/admin/admin-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { ChatComponent } from './chat/chat.component';
import { MarkdownRendererComponent } from './markdown-renderer/markdown-renderer.component';
import { FileUploadComponent } from '../general/file/file-upload/file-upload.component';
import { CsharpInterviewQaComponent } from './topic/csharp-interview-qa/csharp-interview-qa.component';
import { UserComponent } from './user/user/user.component';

const routes: Routes = [{
path: "", component: AdminComponent, children: [
Expand All @@ -19,7 +20,8 @@ const routes: Routes = [{
{ path: "chat", component: ChatComponent },
{ path: "markdown-renderer", component: MarkdownRendererComponent },
{ path: "file", component: FileUploadComponent },
{ path: "topic", component: CsharpInterviewQaComponent }
{ path: "topic", component: CsharpInterviewQaComponent },
{ path: "user", component: UserComponent }
]
}];

Expand Down
2 changes: 1 addition & 1 deletion src/app/components/admin/admin.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ import { CsharpInterviewQaComponent } from './topic/csharp-interview-qa/csharp-i
MatTableModule,
MatDialogModule,
MatSelectModule,
MatOptionModule
MatOptionModule,
]
})
export class AdminModule { }
236 changes: 235 additions & 1 deletion src/app/components/admin/user/user/user.component.html
Original file line number Diff line number Diff line change
@@ -1 +1,235 @@
<p>user works!</p>
<div ba-panel ba-panel-class="profile-page">
<div class="panel-content">
<div class="progress-info">Your profile is 70% Complete</div>
<div class="progress">
<div class="progress-bar progress-bar-primary progress-bar-striped active" role="progressbar"
aria-valuenow="70" aria-valuemin="0" aria-valuemax="100" style="width: 70%">
</div>
</div>

<h3 class="with-line">General Information</h3>

<div class="row">
<div class="col-md-6">
<div class="form-group row clearfix">
<label for="inputFirstName" class="col-sm-3 control-label">Picture</label>

<div class="col-sm-9">
<div class="userpic">
<div class="userpic-wrapper">
<img src="{{ picture }}" alt="Profile Picture" (click)="uploadPicture()" (keydown)="handleKeyDown()" tabindex="0">
</div>
<i class="ion-ios-close-outline" ng-click="removePicture()" ng-if="!noPicture"></i>
<a href class="change-userpic" ng-click="uploadPicture()">Change Profile Picture</a>
<input type="file" ng-show="false" id="uploadFile" ng-file-select="onFileSelect($files)">
</div>
</div>
</div>
</div>
<div class="col-md-6"></div>
</div>

<div class="row">
<div class="col-md-6">
<div class="form-group row clearfix">
<label for="inputFirstName" class="col-sm-3 control-label">First Name</label>

<div class="col-sm-9">
<input type="text" class="form-control" id="inputFirstName" placeholder="" value="Anastasiya">
</div>
</div>
<div class="form-group row clearfix">
<label for="inputLastName" class="col-sm-3 control-label">Last Name</label>

<div class="col-sm-9">
<input type="text" class="form-control" id="inputLastName" placeholder="" value="">
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group row clearfix">
<div class="form-group row clearfix">
<label for="inputDepartment" class="col-sm-3 control-label">Department</label>

<div class="col-sm-9">
<input type="text" class="form-control" id="inputDepartment" placeholder="">
</div>
</div>

<div class="col-sm-9">
<select class="form-control" selectpicker>
<option>Web Development</option>
<option>System Development</option>
<option>Sales</option>
<option>Human Resources</option>
</select>
</div>
</div>

<div class="form-group row clearfix">
<label for="inputOccupation" class="col-sm-3 control-label">Occupation</label>

<div class="col-sm-9">
<input type="text" class="form-control" id="inputOccupation" placeholder="" value="Front End Web Developer">
</div>
</div>
</div>
</div>

<h3 class="with-line">Change Password</h3>

<div class="row">
<div class="col-md-6">
<div class="form-group row clearfix">
<label for="inputPassword" class="col-sm-3 control-label">Password</label>

<div class="col-sm-9">
<input type="password" class="form-control" id="inputPassword" placeholder="" value="12345678">
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group row clearfix">
<label for="inputConfirmPassword" class="col-sm-3 control-label">Confirm Password</label>

<div class="col-sm-9">
<input type="password" class="form-control" id="inputConfirmPassword" placeholder="">
</div>
</div>
</div>
</div>

<h3 class="with-line">Contact Information</h3>

<div class="row">
<div class="col-md-6">
<div class="form-group row clearfix">
<label for="inputEmail3" class="col-sm-3 control-label">Email</label>

<div class="col-sm-9">
<input type="email" class="form-control" id="inputEmail3" placeholder="" value="[email protected]">
</div>
</div>
<div class="form-group row clearfix">
<label for="inputPhone" class="col-sm-3 control-label">Phone</label>

<div class="col-sm-9">
<input type="text" class="form-control" id="inputPhone" placeholder="" value="+1 (23) 456 7890">
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group row clearfix">
<label for="inputOfficeLocation" class="col-sm-3 control-label">Office Location</label>

<div class="col-sm-9">
<select class="form-control" title="Standard Select" selectpicker>
<option>San Francisco</option>
<option>London</option>
<option>Minsk</option>
<option>Tokio</option>
</select>
</div>
</div>
<div class="form-group row clearfix">
<label for="inputRoom" class="col-sm-3 control-label">Room</label>

<div class="col-sm-9">
<input type="text" class="form-control" id="inputRoom" placeholder="" value="303">
</div>
</div>
</div>
</div>

<h3 class="with-line">Social Profiles</h3>

<!-- <div class="social-profiles row clearfix">
<div class="col-md-3 col-sm-4" ng-repeat="item in socialProfiles">
<a class="sn-link" href ng-click="showModal(item)" ng-if="!item.href">
<i class="socicon {{ item.icon }}"></i>
<span>{{ item.name }}</span>
</a>
<a class="sn-link connected" href="{{ item.href }}" target="_blank" ng-if="item.href">
<i class="socicon {{ item.icon }}"></i>
<span>{{ item.name }}</span>
<em class="ion-ios-close-empty sn-link-close" ng-mousedown="unconnect(item)"></em>
</a>
</div>
</div> -->

<h3 class="with-line">Send Email Notifications</h3>

<!-- <div class="notification row clearfix">
<div class="col-sm-6">
<div class="form-group row clearfix">
<label for="inputMessage" class="col-xs-8">When I receive a message</label>
<div class="col-xs-4">
<input type="text" id="inputMessage" class="form-control">
</div>
<div class="col-xs-4">
<switch color="primary" ng-model="switches[0]"></switch>
</div>
</div>
<div class="form-group row clearfix">
<label for="inputInvitation" class="col-xs-8">When Someone sends me an invitation</label>
<div class="col-xs-4">
<input type="text" id="inputInvitation" class="form-control">
</div>
<div class="col-xs-4">
<switch color="primary" ng-model="switches[1]"></switch>
</div>
</div>
<div class="form-group row clearfix">
<label for="inputProfile" class="col-xs-8">When profile information changes</label>
<div class="col-xs-4">
<switch color="primary" ng-model="switches[2]"></switch>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="form-group row clearfix">
<div class="form-group row clearfix">
<label for="inputLogin" class="col-xs-8">When anyone logs into your account from a new device or browser</label>
<div class="col-xs-4">
<input type="text" id="inputLogin" class="form-control">
</div>
</div>
<div class="col-xs-4">
<switch color="primary" ng-model="switches[3]"></switch>
</div>
</div>
<div class="form-group row clearfix">
<label class="col-xs-8">Weekly Reports</label>
<div class="col-xs-4">
<switch color="primary" ng-model="switches[4]"></switch>
</div>
</div>
<div class="form-group row clearfix">
<form>
<form>
<label for="inputDailyReports" class="col-xs-8">Daily Reports</label>
<div class="col-xs-4">
<input type="text" id="inputDailyReports" class="form-control">
</div>
</form>
</form>
<div class="col-xs-4">
<switch color="primary" ng-model="switches[5]"></switch>
</div>
</div>
</div>
</div> -->
<button type="button" class="btn btn-primary btn-with-icon save-profile">
<i class="ion-android-checkmark-circle"></i>Update Profile
</button>
</div>
</div>
7 changes: 7 additions & 0 deletions src/app/components/admin/user/user/user.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,12 @@ import { Component } from '@angular/core';
styleUrls: ['./user.component.css']
})
export class UserComponent {
handleKeyDown() {
throw new Error('Method not implemented.');
}
uploadPicture() {
throw new Error('Method not implemented.');
}
picture: any;

}
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<p>Processing login...</p>
Loading

0 comments on commit f2ddc38

Please sign in to comment.