Changes in / [9885bee:f9983f5]


Ignore:
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  
    11import { NgModule } from '@angular/core';
    22import { Routes, RouterModule } from '@angular/router';
    3 import { AuthorizedGuard } from './core/guards/authorized.guard';
    43
    54const routes: Routes = [
    6   {
    7     path: 'questioning',
    8     canActivate: [AuthorizedGuard],
    9     loadChildren: () => import('./modules/questioning/questioning.module').then((x) => x.QuestioningModule)
    10   },
    115  {
    126    path: '**',
  • src/Clients/Angular/finki-chattery/src/app/app.component.html

    r9885bee rf9983f5  
    22  <mat-progress-bar class="global-loader" [class.hidden]="!(loader.isLoading | async)" mode="indeterminate"></mat-progress-bar>
    33  <router-outlet></router-outlet>
     4  <button (click)="login()">LOGIN</button>
    45</main>
  • src/Clients/Angular/finki-chattery/src/app/app.component.ts

    r9885bee rf9983f5  
    88})
    99export class AppComponent implements OnInit {
    10   constructor(public loader: LoaderService, private redirect: RedirectService) {}
     10  constructor(public loader: LoaderService, private redirect: RedirectService, private auth: AuthService) {}
    1111
    1212  ngOnInit(): void {
    1313    this.redirect.redirectLoggedInUser();
    1414  }
     15
     16  public login(): void {
     17    this.auth.login();
     18  }
    1519}
  • src/Clients/Angular/finki-chattery/src/app/core/services/auth.service.ts

    r9885bee rf9983f5  
    3535      map((user) => {
    3636        if (user) {
    37           if (user.expired) {
    38             return false;
    39           }
    40 
    4137          return true;
    4238        }
  • src/Clients/Angular/finki-chattery/src/app/core/services/notification.service.ts

    r9885bee rf9983f5  
    2222
    2323  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));
    2825  }
    2926}
  • src/Clients/Angular/finki-chattery/src/app/core/state/question-facade.service.ts

    r9885bee rf9983f5  
    1515export class QuestionFacadeService {
    1616  effectWorking$: Observable<boolean | HttpErrorResponse>;
     17  question$: Observable<QuestionStateViewModel>;
    1718
    1819  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));
    1923    this.effectWorking$ = this.store.select(questionStateQuery.effectWorking).pipe(
    2024      filter((effect) => effect !== null),
     
    3236  }
    3337
    34   public getQuestion(): Observable<QuestionStateViewModel> {
    35     return this.store
    36       .select(questionStateQuery.getQuestion)
    37       .pipe(filter((x: QuestionStateViewModel | null): x is QuestionStateViewModel => x !== null));
    38   }
    39 
    4038  public fetchQuestion(questionUid: string): void {
    4139    this.dispatchEffect(new GetQuestionState(questionUid));
  • src/Clients/Angular/finki-chattery/src/app/core/state/question-state/question-state.models.ts

    r9885bee rf9983f5  
    1616  public index!: string;
    1717  public imageUrl!: string;
    18   public reputation!: number;
    1918}
    2019
     
    4342  public index!: string;
    4443  public imageUrl!: string;
    45   public reputation!: number;
    4644}
    4745
     
    5755  public index!: string;
    5856  public imageUrl!: string;
    59   public reputation!: number;
    6057}
  • src/Clients/Angular/finki-chattery/src/app/core/state/question-state/question.mapper.ts

    r9885bee rf9983f5  
    2525              y.studentResponse.uid,
    2626              y.studentResponse.index,
    27               y.studentResponse.imageUrl,
    28               y.studentResponse.reputation
     27              y.studentResponse.imageUrl
    2928            );
    3029
     
    3635          x.studentResponse.uid,
    3736          x.studentResponse.index,
    38           x.studentResponse.imageUrl,
    39           x.studentResponse.reputation
     37          x.studentResponse.imageUrl
    4038        );
    4139
     
    6765      questionStateResponse.studentResponse.uid,
    6866      questionStateResponse.studentResponse.index,
    69       questionStateResponse.studentResponse.imageUrl,
    70       questionStateResponse.studentResponse.reputation
     67      questionStateResponse.studentResponse.imageUrl
    7168    );
    7269
  • src/Clients/Angular/finki-chattery/src/app/shared-app/directives/directives.ts

    r9885bee rf9983f5  
    1 import { HandleInputFormErrorsDirective, HoverElevationDirective, LoaderDirective, HandleSelectFormErrorsDirective, ShareLinkDirective } from '.';
     1import { HandleInputFormErrorsDirective, HoverElevationDirective, LoaderDirective, HandleSelectFormErrorsDirective } from '.';
    22
    3 export const DIRECTIVES: any[] = [HandleInputFormErrorsDirective, LoaderDirective, HoverElevationDirective, HandleSelectFormErrorsDirective, ShareLinkDirective];
     3export 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  
    33export * from './hover-elevation.directive';
    44export * 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  
    1515
    1616export 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) {}
    1818}
    1919
     
    3939
    4040export 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) {}
    4242}
    4343
     
    5252
    5353export 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) {}
    5555}
  • src/Clients/Angular/finki-chattery/src/app/shared-app/services/translate-from-json.service.ts

    r9885bee rf9983f5  
    4343  }
    4444
    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;
    4750  }
    4851}
  • src/Clients/Angular/finki-chattery/src/app/shared-app/shared-app.module.ts

    r9885bee rf9983f5  
    88import { FileUploadModule } from 'ng2-file-upload';
    99
    10 import { COMPONENTS } from './components/components';
     10import { COMPONENTS } from './components/generic/components';
    1111import { SharedMaterialModule } from '../shared-material/shared-material.module';
    1212import { DIRECTIVES } from './directives/directives';
    1313import { SERVICES } from './services/services';
    1414import { PIPES } from './pipes/pipes';
     15import { FileUploadComponent } from './components/generic/file-upload/file-upload.component';
     16import { HandleSelectFormErrorsDirective } from './directives/handle-select-form-errors.directive';
    1517
    1618@NgModule({
    17   declarations: [COMPONENTS, DIRECTIVES, PIPES],
     19  declarations: [COMPONENTS, DIRECTIVES, PIPES, FileUploadComponent, HandleSelectFormErrorsDirective],
    1820  providers: [SERVICES],
    1921  imports: [
     
    3739    COMPONENTS,
    3840    DIRECTIVES,
    39     PIPES,
    40     SharedMaterialModule
     41    PIPES
    4142  ]
    4243})
  • src/Clients/Angular/finki-chattery/src/app/shared-material/shared-material.module.ts

    r9885bee rf9983f5  
    2020import { MatDatepickerModule } from '@angular/material/datepicker';
    2121import { 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 
    2622@NgModule({
    2723  imports: [
     
    4440    MatTableModule,
    4541    MatDatepickerModule,
    46     MatNativeDateModule,
    47     MatChipsModule,
    48     MatTooltipModule,
    49     MatButtonToggleModule
     42    MatNativeDateModule
    5043  ],
    5144  exports: [
     
    6760    MatTableModule,
    6861    MatDatepickerModule,
    69     MatNativeDateModule,
    70     MatChipsModule,
    71     MatTooltipModule,
    72     MatButtonToggleModule
     62    MatNativeDateModule
    7363  ]
    7464})
  • src/Clients/Angular/finki-chattery/src/assets/translations/en.json

    r9885bee rf9983f5  
    1414  "password-not-match": "Passwords don't match",
    1515  "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"
    2717}
  • src/Clients/Angular/finki-chattery/src/styles.scss

    r9885bee rf9983f5  
    264264
    265265.avatar-image {
    266   width: 80px;
    267   height: 80px;
     266  width: 100px;
     267  height: 100px;
    268268  display: block;
    269269  border-radius: 50%;
  • src/FinkiChattery/FinkiChattery.Api/ApplicationServices/Questioning/Mapper/QuestionMapper.cs

    r9885bee rf9983f5  
    2424                        answerResponses = x.AnswerResponsesDto.Select(y =>
    2525                        {
    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);
    2727
    2828                            return new AnswerResponseQuestionStateResponse(y.Id, y.Uid, y.Text, y.CreatedOn, answerResponseStudent);
     
    3030                    }
    3131
    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);
    3333
    3434                    return new AnswerQuestionStateResponse(x.Id, x.Uid, x.Text, x.CorrectAnswer, x.CreatedOn, x.UpvotesCount, answerStudent, answerResponses);
     
    5050            }
    5151
    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);
    5353
    5454            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  
    4040    public class StudentQuestionStateResponse
    4141    {
    42         public StudentQuestionStateResponse(long id, Guid uid, string index, string imageUrl, long reputation)
     42        public StudentQuestionStateResponse(long id, Guid uid, string index, string imageUrl)
    4343        {
    4444            Id = id;
     
    4646            Index = index;
    4747            ImageUrl = imageUrl;
    48             Reputation = reputation;
    4948        }
    5049
     
    5453        public string Index { get; }
    5554        public string ImageUrl { get; }
    56         public long Reputation { get; }
    5755    }
    5856
     
    114112    public class AnswerStudentQuestionStateResponse
    115113    {
    116         public AnswerStudentQuestionStateResponse(long id, Guid uid, string index, string imageUrl, long reputation)
     114        public AnswerStudentQuestionStateResponse(long id, Guid uid, string index, string imageUrl)
    117115        {
    118116            Id = id;
     
    120118            Index = index;
    121119            ImageUrl = imageUrl;
    122             Reputation = reputation;
    123120        }
    124121
     
    128125        public string Index { get; }
    129126        public string ImageUrl { get; }
    130         public long Reputation { get; }
    131127    }
    132128
     
    152148    public class AnswerResponseStudentQuestionStateResponse
    153149    {
    154         public AnswerResponseStudentQuestionStateResponse(long id, Guid uid, string index, string imageUrl, long reputation)
     150        public AnswerResponseStudentQuestionStateResponse(long id, Guid uid, string index, string imageUrl)
    155151        {
    156152            Id = id;
     
    158154            Index = index;
    159155            ImageUrl = imageUrl;
    160             Reputation = reputation;
    161156        }
    162157
     
    166161        public string Index { get; }
    167162        public string ImageUrl { get; }
    168         public long Reputation { get; }
    169163    }
    170164}
  • src/FinkiChattery/FinkiChattery.Persistence/Repositories/Contracts/Question/QuestionStateDto.cs

    r9885bee rf9983f5  
    3838    public class StudentQuestionStateDto
    3939    {
    40         public StudentQuestionStateDto(long id, Guid uid, string index, string imageUrl, long reputation)
     40        public StudentQuestionStateDto(long id, Guid uid, string index, string imageUrl)
    4141        {
    4242            Id = id;
     
    4444            Index = index;
    4545            ImageUrl = imageUrl;
    46             Reputation = reputation;
    4746        }
    4847
     
    5150        public string Index { get; }
    5251        public string ImageUrl { get; }
    53         public long Reputation { get; }
    5452    }
    5553
     
    108106    public class AnswerStudentQuestionStateDto
    109107    {
    110         public AnswerStudentQuestionStateDto(long id, Guid uid, string index, string imageUrl, long reputation)
     108        public AnswerStudentQuestionStateDto(long id, Guid uid, string index, string imageUrl)
    111109        {
    112110            Id = id;
     
    114112            Index = index;
    115113            ImageUrl = imageUrl;
    116             Reputation = reputation;
    117114        }
    118115        public long Id { get; }
     
    120117        public string Index { get; }
    121118        public string ImageUrl { get; }
    122         public long Reputation { get; }
    123119    }
    124120
     
    143139    public class AnswerResponseStudentQuestionStateDto
    144140    {
    145         public AnswerResponseStudentQuestionStateDto(long id, Guid uid, string index, string imageUrl, long reputation)
     141        public AnswerResponseStudentQuestionStateDto(long id, Guid uid, string index, string imageUrl)
    146142        {
    147143            Id = id;
     
    149145            Index = index;
    150146            ImageUrl = imageUrl;
    151             Reputation = reputation;
    152147        }
    153148
     
    156151        public string Index { get; }
    157152        public string ImageUrl { get; }
    158         public long Reputation { get; }
    159153    }
    160154}
  • src/FinkiChattery/FinkiChattery.Persistence/Repositories/Implementations/QuestionRepo.cs

    r9885bee rf9983f5  
    3838                                                  x.Student.Uid,
    3939                                                  x.Student.IndexNumber,
    40                                                   x.Student.ImageUrl,
    41                                                   x.Student.Reputation),
     40                                                  x.Student.ImageUrl),
    4241                                                x.Answers.Select(y =>
    4342                                                new AnswerQuestionStateDto(
     
    5251                                                        y.Student.Uid,
    5352                                                        y.Student.IndexNumber,
    54                                                         y.Student.ImageUrl,
    55                                                         y.Student.Reputation),
     53                                                        y.Student.ImageUrl),
    5654                                                    y.AnswerResponses.Select(z =>
    5755                                                    new AnswerResponseQuestionStateDto(
     
    6462                                                            z.Student.Uid,
    6563                                                            z.Student.IndexNumber,
    66                                                             z.Student.ImageUrl,
    67                                                             z.Student.Reputation))))),
     64                                                            z.Student.ImageUrl))))),
    6865                                                x.QuestionCategories.Select(y =>
    6966                                                new QuestionCategoryQuestionStateDto(
Note: See TracChangeset for help on using the changeset viewer.