Changeset 31c006c


Ignore:
Timestamp:
10/21/21 19:51:27 (3 years ago)
Author:
Стојков Марко <mst@…>
Branches:
dev
Children:
45cf412
Parents:
3b395c5
Message:

Add categories endpoint and state for categories, added questions preview component

Location:
src
Files:
16 added
10 edited

Legend:

Unmodified
Added
Removed
  • src/Clients/Angular/finki-chattery/src/app/app-routing.module.ts

    r3b395c5 r31c006c  
    1111  {
    1212    path: '**',
    13     redirectTo: 'public/home'
     13    redirectTo: 'questioning/preview'
    1414  }
    1515];
  • src/Clients/Angular/finki-chattery/src/app/app.component.ts

    r3b395c5 r31c006c  
    11import { Component, OnInit } from '@angular/core';
    2 import { AuthService, LoaderService, RedirectService } from './core/services';
     2import { LoaderService, RedirectService } from './core/services';
    33
    44@Component({
  • src/Clients/Angular/finki-chattery/src/app/core/core.module.ts

    r3b395c5 r31c006c  
    1616import { EffectsModule } from '@ngrx/effects';
    1717import { QuestionEffects } from './state/question-state/question.effects';
     18import { CategoriesEffects } from './state/category-state/category.effects';
    1819
    1920@NgModule({
     
    3637      logOnly: !environment.production
    3738    }),
    38     EffectsModule.forRoot([QuestionEffects])
     39    EffectsModule.forRoot([QuestionEffects, CategoriesEffects])
    3940  ],
    4041  exports: [HttpClientModule, COMPONENTS]
  • src/Clients/Angular/finki-chattery/src/app/core/state/index.ts

    r3b395c5 r31c006c  
    22import { QuestionState } from './question-state/question.state';
    33import { reducer as questionReducer } from './question-state/question.reducers';
     4import { CategoryState } from './category-state/category.state';
     5import { reducer as categoryReducer } from './category-state/category.reducers';
    46
    57export interface State {
    68  question: QuestionState;
     9  category: CategoryState;
    710}
    811
    912export const reducers: ActionReducerMap<State, any> = {
    10   question: questionReducer
     13  question: questionReducer,
     14  category: categoryReducer
    1115};
  • src/Clients/Angular/finki-chattery/src/app/modules/questioning/components/questioning-components.ts

    r3b395c5 r31c006c  
    11import { QuestionPreviewGeneralComponent } from './question-preview-general/question-preview-general.component';
     2import { QuestionsPreviewGeneralComponent } from './questions-preview-general/questions-preview-general.component';
    23
    3 export const QUESTIONING_COMPONENTS: any[] = [QuestionPreviewGeneralComponent];
     4export const QUESTIONING_COMPONENTS: any[] = [QuestionPreviewGeneralComponent, QuestionsPreviewGeneralComponent];
  • src/Clients/Angular/finki-chattery/src/app/modules/questioning/questioning.module.ts

    r3b395c5 r31c006c  
    44import { QUESTIONING_COMPONENTS } from './components/questioning-components';
    55import { SharedAppModule } from 'src/app/shared-app/shared-app.module';
    6 
    76@NgModule({
    87  declarations: [QUESTIONING_COMPONENTS],
  • src/Clients/Angular/finki-chattery/src/app/modules/questioning/questioning.routes.ts

    r3b395c5 r31c006c  
    22import { Routes, RouterModule } from '@angular/router';
    33import { QuestionPreviewGeneralComponent } from './components/question-preview-general/question-preview-general.component';
     4import { QuestionsPreviewGeneralComponent } from './components/questions-preview-general/questions-preview-general.component';
    45
    56const routes: Routes = [
     7  {
     8    path: 'preview',
     9    pathMatch: 'full',
     10    component: QuestionsPreviewGeneralComponent
     11  },
    612  {
    713    path: ':questionUid',
  • src/Clients/Angular/finki-chattery/src/app/shared-app/models/index.ts

    r3b395c5 r31c006c  
    22export * from './user.models';
    33export * from './question-state-view-models.models';
     4export * from './category-state-view-models.models';
  • src/Clients/Angular/finki-chattery/src/assets/translations/en.json

    r3b395c5 r31c006c  
    2424  "vote-correct-answer": "This has been accepted as the correct answer by the owner of the question",
    2525  "answer-sort-oldest": "Oldest",
    26   "answer-sort-votes": "Votes"
     26  "answer-sort-votes": "Votes",
     27  "internet-techologies": "Internet technologies",
     28  "software-engineering": "Software engineering",
     29  "visual-programming": "Visual programming",
     30  "operating-systems": "Operating systems"
    2731}
  • src/FinkiChattery/FinkiChattery.Api/Controllers/v1/CategoriesController.cs

    r3b395c5 r31c006c  
    1 using FinkiChattery.Api.ApplicationServices.Authentication;
    2 using FinkiChattery.Api.ApplicationServices.Questioning;
    3 using FinkiChattery.Commands.Questioning;
     1using FinkiChattery.Api.ApplicationServices.Questioning;
    42using FinkiChattery.Common.Mediator.Interfaces;
    5 using FinkiChattery.Contracts.Questioning;
    63using FinkiChattery.Queries.Questioning;
    7 using IdentityServer4.AccessTokenValidation;
    84using Microsoft.AspNetCore.Authorization;
    95using Microsoft.AspNetCore.Mvc;
    10 using System;
    116using System.Threading.Tasks;
    127
     
    2924        public async Task<IActionResult> GetCategories()
    3025        {
    31             return Ok();
     26            var categoriesList = await MediatorService.SendQueryAsync(new GetCategoriesQuery());
     27            return Ok(categoriesList.ToCategoryDtos());
    3228        }
    3329    }
Note: See TracChangeset for help on using the changeset viewer.