Changes in / [9885bee:f9983f5]
- Location:
- src
- Files:
-
- 1 added
- 22 deleted
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Clients/Angular/finki-chattery/src/app/app-routing.module.ts
r9885bee rf9983f5 1 1 import { NgModule } from '@angular/core'; 2 2 import { Routes, RouterModule } from '@angular/router'; 3 import { AuthorizedGuard } from './core/guards/authorized.guard';4 3 5 4 const routes: Routes = [ 6 {7 path: 'questioning',8 canActivate: [AuthorizedGuard],9 loadChildren: () => import('./modules/questioning/questioning.module').then((x) => x.QuestioningModule)10 },11 5 { 12 6 path: '**', -
src/Clients/Angular/finki-chattery/src/app/app.component.html
r9885bee rf9983f5 2 2 <mat-progress-bar class="global-loader" [class.hidden]="!(loader.isLoading | async)" mode="indeterminate"></mat-progress-bar> 3 3 <router-outlet></router-outlet> 4 <button (click)="login()">LOGIN</button> 4 5 </main> -
src/Clients/Angular/finki-chattery/src/app/app.component.ts
r9885bee rf9983f5 8 8 }) 9 9 export class AppComponent implements OnInit { 10 constructor(public loader: LoaderService, private redirect: RedirectService ) {}10 constructor(public loader: LoaderService, private redirect: RedirectService, private auth: AuthService) {} 11 11 12 12 ngOnInit(): void { 13 13 this.redirect.redirectLoggedInUser(); 14 14 } 15 16 public login(): void { 17 this.auth.login(); 18 } 15 19 } -
src/Clients/Angular/finki-chattery/src/app/core/services/auth.service.ts
r9885bee rf9983f5 35 35 map((user) => { 36 36 if (user) { 37 if (user.expired) {38 return false;39 }40 41 37 return true; 42 38 } -
src/Clients/Angular/finki-chattery/src/app/core/services/notification.service.ts
r9885bee rf9983f5 22 22 23 23 public successNotification(title: string, description?: string): void { 24 if (description) { 25 this.toastr.success(this.translate.instant(description), this.translate.instant(title)); 26 } 27 this.toastr.success(this.translate.instant(title)); 24 this.toastr.success(this.translate.instant(description), this.translate.instant(title)); 28 25 } 29 26 } -
src/Clients/Angular/finki-chattery/src/app/core/state/question-facade.service.ts
r9885bee rf9983f5 15 15 export class QuestionFacadeService { 16 16 effectWorking$: Observable<boolean | HttpErrorResponse>; 17 question$: Observable<QuestionStateViewModel>; 17 18 18 19 constructor(private store: Store<QuestionState>) { 20 this.question$ = this.store 21 .select(questionStateQuery.getQuestion) 22 .pipe(filter((x: QuestionStateViewModel | null): x is QuestionStateViewModel => x !== null)); 19 23 this.effectWorking$ = this.store.select(questionStateQuery.effectWorking).pipe( 20 24 filter((effect) => effect !== null), … … 32 36 } 33 37 34 public getQuestion(): Observable<QuestionStateViewModel> {35 return this.store36 .select(questionStateQuery.getQuestion)37 .pipe(filter((x: QuestionStateViewModel | null): x is QuestionStateViewModel => x !== null));38 }39 40 38 public fetchQuestion(questionUid: string): void { 41 39 this.dispatchEffect(new GetQuestionState(questionUid)); -
src/Clients/Angular/finki-chattery/src/app/core/state/question-state/question-state.models.ts
r9885bee rf9983f5 16 16 public index!: string; 17 17 public imageUrl!: string; 18 public reputation!: number;19 18 } 20 19 … … 43 42 public index!: string; 44 43 public imageUrl!: string; 45 public reputation!: number;46 44 } 47 45 … … 57 55 public index!: string; 58 56 public imageUrl!: string; 59 public reputation!: number;60 57 } -
src/Clients/Angular/finki-chattery/src/app/core/state/question-state/question.mapper.ts
r9885bee rf9983f5 25 25 y.studentResponse.uid, 26 26 y.studentResponse.index, 27 y.studentResponse.imageUrl, 28 y.studentResponse.reputation 27 y.studentResponse.imageUrl 29 28 ); 30 29 … … 36 35 x.studentResponse.uid, 37 36 x.studentResponse.index, 38 x.studentResponse.imageUrl, 39 x.studentResponse.reputation 37 x.studentResponse.imageUrl 40 38 ); 41 39 … … 67 65 questionStateResponse.studentResponse.uid, 68 66 questionStateResponse.studentResponse.index, 69 questionStateResponse.studentResponse.imageUrl, 70 questionStateResponse.studentResponse.reputation 67 questionStateResponse.studentResponse.imageUrl 71 68 ); 72 69 -
src/Clients/Angular/finki-chattery/src/app/shared-app/directives/directives.ts
r9885bee rf9983f5 1 import { HandleInputFormErrorsDirective, HoverElevationDirective, LoaderDirective, HandleSelectFormErrorsDirective , ShareLinkDirective} from '.';1 import { HandleInputFormErrorsDirective, HoverElevationDirective, LoaderDirective, HandleSelectFormErrorsDirective } from '.'; 2 2 3 export const DIRECTIVES: any[] = [HandleInputFormErrorsDirective, LoaderDirective, HoverElevationDirective, HandleSelectFormErrorsDirective, ShareLinkDirective]; 3 export const DIRECTIVES: any[] = [ 4 HandleInputFormErrorsDirective, 5 LoaderDirective, 6 HoverElevationDirective, 7 HandleSelectFormErrorsDirective 8 ]; -
src/Clients/Angular/finki-chattery/src/app/shared-app/directives/index.ts
r9885bee rf9983f5 3 3 export * from './hover-elevation.directive'; 4 4 export * from './handle-select-form-errors.directive'; 5 export * from './share-link.directive'; -
src/Clients/Angular/finki-chattery/src/app/shared-app/models/question-state-view-models.models.ts
r9885bee rf9983f5 15 15 16 16 export class StudentQuestionStateViewModel { 17 constructor(public uid: string, public index: string, public imageUrl: string , public reputation: number) {}17 constructor(public uid: string, public index: string, public imageUrl: string) {} 18 18 } 19 19 … … 39 39 40 40 export class AnswerStudentQuestionStateViewModel { 41 constructor(public uid: string, public index: string, public imageUrl: string , public reputation: number) {}41 constructor(public uid: string, public index: string, public imageUrl: string) {} 42 42 } 43 43 … … 52 52 53 53 export class AnswerResponseStudentQuestionStateViewModel { 54 constructor(public uid: string, public index: string, public imageUrl: string , public reputation: number) {}54 constructor(public uid: string, public index: string, public imageUrl: string) {} 55 55 } -
src/Clients/Angular/finki-chattery/src/app/shared-app/services/translate-from-json.service.ts
r9885bee rf9983f5 43 43 } 44 44 45 public instant(key: string): string { 46 return this.translateService.instant(key); 45 public instant(key?: string): string | undefined { 46 if (key) { 47 return this.translateService.instant(key); 48 } 49 return undefined; 47 50 } 48 51 } -
src/Clients/Angular/finki-chattery/src/app/shared-app/shared-app.module.ts
r9885bee rf9983f5 8 8 import { FileUploadModule } from 'ng2-file-upload'; 9 9 10 import { COMPONENTS } from './components/ components';10 import { COMPONENTS } from './components/generic/components'; 11 11 import { SharedMaterialModule } from '../shared-material/shared-material.module'; 12 12 import { DIRECTIVES } from './directives/directives'; 13 13 import { SERVICES } from './services/services'; 14 14 import { PIPES } from './pipes/pipes'; 15 import { FileUploadComponent } from './components/generic/file-upload/file-upload.component'; 16 import { HandleSelectFormErrorsDirective } from './directives/handle-select-form-errors.directive'; 15 17 16 18 @NgModule({ 17 declarations: [COMPONENTS, DIRECTIVES, PIPES ],19 declarations: [COMPONENTS, DIRECTIVES, PIPES, FileUploadComponent, HandleSelectFormErrorsDirective], 18 20 providers: [SERVICES], 19 21 imports: [ … … 37 39 COMPONENTS, 38 40 DIRECTIVES, 39 PIPES, 40 SharedMaterialModule 41 PIPES 41 42 ] 42 43 }) -
src/Clients/Angular/finki-chattery/src/app/shared-material/shared-material.module.ts
r9885bee rf9983f5 20 20 import { MatDatepickerModule } from '@angular/material/datepicker'; 21 21 import { MatNativeDateModule } from '@angular/material/core'; 22 import { MatChipsModule } from '@angular/material/chips';23 import { MatTooltipModule } from '@angular/material/tooltip';24 import { MatButtonToggleModule } from '@angular/material/button-toggle';25 26 22 @NgModule({ 27 23 imports: [ … … 44 40 MatTableModule, 45 41 MatDatepickerModule, 46 MatNativeDateModule, 47 MatChipsModule, 48 MatTooltipModule, 49 MatButtonToggleModule 42 MatNativeDateModule 50 43 ], 51 44 exports: [ … … 67 60 MatTableModule, 68 61 MatDatepickerModule, 69 MatNativeDateModule, 70 MatChipsModule, 71 MatTooltipModule, 72 MatButtonToggleModule 62 MatNativeDateModule 73 63 ] 74 64 }) -
src/Clients/Angular/finki-chattery/src/assets/translations/en.json
r9885bee rf9983f5 14 14 "password-not-match": "Passwords don't match", 15 15 "code-date-passed": "The code date has passed", 16 "not-found": "Not found", 17 "question-preview-subtitle": "Asked <b>{{createdOn}}</b>, Last active <b>{{lastActive}}</b>, Viewed <b>{{views}}</b> times", 18 "share-link": "Share", 19 "share-link-success": "Successfully copied link for sharing", 20 "question-asked-by-subtitle": "Asked on: {{date}}", 21 "question-answers": "{{answerCount}} Answers", 22 "question-answered-by-subtitle": "Answered on: {{date}}", 23 "student-reputation": "{{reputation}} reputation", 24 "vote-correct-answer": "This has been accepted as the correct answer by the owner of the question", 25 "answer-sort-oldest": "Oldest", 26 "answer-sort-votes": "Votes" 16 "not-found": "Not found" 27 17 } -
src/Clients/Angular/finki-chattery/src/styles.scss
r9885bee rf9983f5 264 264 265 265 .avatar-image { 266 width: 80px;267 height: 80px;266 width: 100px; 267 height: 100px; 268 268 display: block; 269 269 border-radius: 50%; -
src/FinkiChattery/FinkiChattery.Api/ApplicationServices/Questioning/Mapper/QuestionMapper.cs
r9885bee rf9983f5 24 24 answerResponses = x.AnswerResponsesDto.Select(y => 25 25 { 26 var answerResponseStudent = new AnswerResponseStudentQuestionStateResponse(y.StudentDto.Id, y.StudentDto.Uid, y.StudentDto.Index, y.StudentDto.ImageUrl , y.StudentDto.Reputation);26 var answerResponseStudent = new AnswerResponseStudentQuestionStateResponse(y.StudentDto.Id, y.StudentDto.Uid, y.StudentDto.Index, y.StudentDto.ImageUrl); 27 27 28 28 return new AnswerResponseQuestionStateResponse(y.Id, y.Uid, y.Text, y.CreatedOn, answerResponseStudent); … … 30 30 } 31 31 32 var answerStudent = new AnswerStudentQuestionStateResponse(x.StudentDto.Id, x.StudentDto.Uid, x.StudentDto.Index, x.StudentDto.ImageUrl , x.StudentDto.Reputation);32 var answerStudent = new AnswerStudentQuestionStateResponse(x.StudentDto.Id, x.StudentDto.Uid, x.StudentDto.Index, x.StudentDto.ImageUrl); 33 33 34 34 return new AnswerQuestionStateResponse(x.Id, x.Uid, x.Text, x.CorrectAnswer, x.CreatedOn, x.UpvotesCount, answerStudent, answerResponses); … … 50 50 } 51 51 52 var student = new StudentQuestionStateResponse(questionState.StudentDto.Id, questionState.StudentDto.Uid, questionState.StudentDto.Index, questionState.StudentDto.ImageUrl , questionState.StudentDto.Reputation);52 var student = new StudentQuestionStateResponse(questionState.StudentDto.Id, questionState.StudentDto.Uid, questionState.StudentDto.Index, questionState.StudentDto.ImageUrl); 53 53 54 54 return new QuestionStateResponse(questionState.Id, questionState.Uid, questionState.Title, questionState.Text, questionState.CreatedOn, questionState.Views, questionState.LastActiveOn, student, answers, questionCategories, team); -
src/FinkiChattery/FinkiChattery.Contracts/Questioning/GetQuestionState/QuestionStateResponse.cs
r9885bee rf9983f5 40 40 public class StudentQuestionStateResponse 41 41 { 42 public StudentQuestionStateResponse(long id, Guid uid, string index, string imageUrl , long reputation)42 public StudentQuestionStateResponse(long id, Guid uid, string index, string imageUrl) 43 43 { 44 44 Id = id; … … 46 46 Index = index; 47 47 ImageUrl = imageUrl; 48 Reputation = reputation;49 48 } 50 49 … … 54 53 public string Index { get; } 55 54 public string ImageUrl { get; } 56 public long Reputation { get; }57 55 } 58 56 … … 114 112 public class AnswerStudentQuestionStateResponse 115 113 { 116 public AnswerStudentQuestionStateResponse(long id, Guid uid, string index, string imageUrl , long reputation)114 public AnswerStudentQuestionStateResponse(long id, Guid uid, string index, string imageUrl) 117 115 { 118 116 Id = id; … … 120 118 Index = index; 121 119 ImageUrl = imageUrl; 122 Reputation = reputation;123 120 } 124 121 … … 128 125 public string Index { get; } 129 126 public string ImageUrl { get; } 130 public long Reputation { get; }131 127 } 132 128 … … 152 148 public class AnswerResponseStudentQuestionStateResponse 153 149 { 154 public AnswerResponseStudentQuestionStateResponse(long id, Guid uid, string index, string imageUrl , long reputation)150 public AnswerResponseStudentQuestionStateResponse(long id, Guid uid, string index, string imageUrl) 155 151 { 156 152 Id = id; … … 158 154 Index = index; 159 155 ImageUrl = imageUrl; 160 Reputation = reputation;161 156 } 162 157 … … 166 161 public string Index { get; } 167 162 public string ImageUrl { get; } 168 public long Reputation { get; }169 163 } 170 164 } -
src/FinkiChattery/FinkiChattery.Persistence/Repositories/Contracts/Question/QuestionStateDto.cs
r9885bee rf9983f5 38 38 public class StudentQuestionStateDto 39 39 { 40 public StudentQuestionStateDto(long id, Guid uid, string index, string imageUrl , long reputation)40 public StudentQuestionStateDto(long id, Guid uid, string index, string imageUrl) 41 41 { 42 42 Id = id; … … 44 44 Index = index; 45 45 ImageUrl = imageUrl; 46 Reputation = reputation;47 46 } 48 47 … … 51 50 public string Index { get; } 52 51 public string ImageUrl { get; } 53 public long Reputation { get; }54 52 } 55 53 … … 108 106 public class AnswerStudentQuestionStateDto 109 107 { 110 public AnswerStudentQuestionStateDto(long id, Guid uid, string index, string imageUrl , long reputation)108 public AnswerStudentQuestionStateDto(long id, Guid uid, string index, string imageUrl) 111 109 { 112 110 Id = id; … … 114 112 Index = index; 115 113 ImageUrl = imageUrl; 116 Reputation = reputation;117 114 } 118 115 public long Id { get; } … … 120 117 public string Index { get; } 121 118 public string ImageUrl { get; } 122 public long Reputation { get; }123 119 } 124 120 … … 143 139 public class AnswerResponseStudentQuestionStateDto 144 140 { 145 public AnswerResponseStudentQuestionStateDto(long id, Guid uid, string index, string imageUrl , long reputation)141 public AnswerResponseStudentQuestionStateDto(long id, Guid uid, string index, string imageUrl) 146 142 { 147 143 Id = id; … … 149 145 Index = index; 150 146 ImageUrl = imageUrl; 151 Reputation = reputation;152 147 } 153 148 … … 156 151 public string Index { get; } 157 152 public string ImageUrl { get; } 158 public long Reputation { get; }159 153 } 160 154 } -
src/FinkiChattery/FinkiChattery.Persistence/Repositories/Implementations/QuestionRepo.cs
r9885bee rf9983f5 38 38 x.Student.Uid, 39 39 x.Student.IndexNumber, 40 x.Student.ImageUrl, 41 x.Student.Reputation), 40 x.Student.ImageUrl), 42 41 x.Answers.Select(y => 43 42 new AnswerQuestionStateDto( … … 52 51 y.Student.Uid, 53 52 y.Student.IndexNumber, 54 y.Student.ImageUrl, 55 y.Student.Reputation), 53 y.Student.ImageUrl), 56 54 y.AnswerResponses.Select(z => 57 55 new AnswerResponseQuestionStateDto( … … 64 62 z.Student.Uid, 65 63 z.Student.IndexNumber, 66 z.Student.ImageUrl, 67 z.Student.Reputation))))), 64 z.Student.ImageUrl))))), 68 65 x.QuestionCategories.Select(y => 69 66 new QuestionCategoryQuestionStateDto(
Note:
See TracChangeset
for help on using the changeset viewer.