Skip to content

Commit

Permalink
Merge pull request #80 from uatisdeproblem/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
uatisdeproblem authored Feb 21, 2024
2 parents 07d8545 + fc56a40 commit 2ec7f6f
Show file tree
Hide file tree
Showing 10 changed files with 44 additions and 25 deletions.
10 changes: 5 additions & 5 deletions back-end/package-lock.json

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

2 changes: 1 addition & 1 deletion back-end/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "1.8.4",
"version": "1.8.5",
"name": "back-end",
"scripts": {
"lint": "eslint --ext .ts",
Expand Down
2 changes: 1 addition & 1 deletion back-end/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ openapi: 3.0.3

info:
title: ESN Assembly app
version: 1.8.4
version: 1.8.5
contact:
name: Matteo Carbone
email: [email protected]
Expand Down
16 changes: 8 additions & 8 deletions front-end/package-lock.json

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

2 changes: 1 addition & 1 deletion front-end/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "esn-assembly",
"version": "1.8.4",
"version": "1.8.5",
"author": "Matteo Carbone",
"homepage": "https://matteocarbone.com/",
"scripts": {
Expand Down
7 changes: 5 additions & 2 deletions front-end/src/app/tabs/topics/topics.page.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,11 @@
<ion-item lines="none" color="ideaToolbar" class="ion-hide-lg-down">
<ion-select interface="popover" [(ngModel)]="filterByStatus" (ionChange)="filter(searchbar.value)">
<ion-select-option [value]="null">{{ 'TOPICS.ALL_STATUSES' | translate }}</ion-select-option>
<ion-select-option [value]="true">{{ 'TOPICS.STATUSES.OPEN' | translate }}</ion-select-option>
<ion-select-option [value]="false">{{ 'TOPICS.STATUSES.CLOSED' | translate }}</ion-select-option>
<ion-select-option [value]="Statuses.DRAFT" *ngIf="app.user.isAdministrator">
{{ 'TOPICS.STATUSES.DRAFT' | translate }}
</ion-select-option>
<ion-select-option [value]="Statuses.OPEN">{{ 'TOPICS.STATUSES.OPEN' | translate }}</ion-select-option>
<ion-select-option [value]="Statuses.CLOSED">{{ 'TOPICS.STATUSES.CLOSED' | translate }}</ion-select-option>
</ion-select>
</ion-item>
<ion-item lines="none" color="ideaToolbar" class="ion-hide-xl-down">
Expand Down
5 changes: 3 additions & 2 deletions front-end/src/app/tabs/topics/topics.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { IonInfiniteScroll, IonRefresher, IonSearchbar } from '@ionic/angular';
import { IDEAActionSheetController, IDEATranslationsService } from '@idea-ionic/common';

import { AppService } from '@app/app.service';
import { TopicsService, TopicsSortBy } from './topics.service';
import { TopicsService, TopicsSortBy, TopicsFilterByStatus } from './topics.service';
import { TopicCategoryService } from '../configurations/categories/categories.service';
import { GAEventsService } from '../configurations/events/events.service';

Expand All @@ -28,7 +28,8 @@ export class TopicsPage implements OnInit {
events: GAEvent[];
filterByEvent: string = null;

filterByStatus: boolean = null;
filterByStatus: TopicsFilterByStatus = null;
Statuses = TopicsFilterByStatus;

TopicTypes = TopicTypes;
filterByType: TopicTypes = null;
Expand Down
22 changes: 18 additions & 4 deletions front-end/src/app/tabs/topics/topics.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export class TopicsService {
search?: string;
categoryId?: string;
eventId?: string;
status?: boolean;
status?: TopicsFilterByStatus;
type?: TopicTypes;
withPagination?: boolean;
startPaginationAfterId?: string;
Expand Down Expand Up @@ -65,9 +65,17 @@ export class TopicsService {

if (options.eventId) filteredList = filteredList.filter(x => x.event.eventId === options.eventId);

if (options.status === true || options.status === false)
filteredList = filteredList.filter(x => (options.status ? !x.closedAt : x.closedAt));

switch (options.status) {
case TopicsFilterByStatus.DRAFT:
filteredList = filteredList.filter(x => !x.publishedSince);
break;
case TopicsFilterByStatus.OPEN:
filteredList = filteredList.filter(x => !x.closedAt && !!x.publishedSince);
break;
case TopicsFilterByStatus.CLOSED:
filteredList = filteredList.filter(x => x.closedAt && !!x.publishedSince);
break;
}
if (options.type) filteredList = filteredList.filter(x => options.type === x.type);

switch (options.sortBy) {
Expand Down Expand Up @@ -264,3 +272,9 @@ export enum TopicsSortBy {
ACTIVITY_ASC = 'ACTIVITY_ASC',
ACTIVITY_DESC = 'ACTIVITY_DESC'
}

export enum TopicsFilterByStatus {
DRAFT = 'DRAFT',
OPEN = 'OPEN',
CLOSED = 'CLOSED'
}
1 change: 1 addition & 0 deletions front-end/src/assets/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@
"LIVE_ON": "Live on",
"STATUS": "Status",
"STATUSES": {
"DRAFT":"Draft",
"OPEN": "Open",
"CLOSED": "Closed"
},
Expand Down
2 changes: 1 addition & 1 deletion front-end/src/environments/environment.idea.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const STAGE = 'prod';
*/
export const environment = {
idea: {
app: { version: '1.8.4', mediaUrl: 'https://'.concat(parameters.mediaDomain), maxFileUploadSizeMB: 50 },
app: { version: '1.8.5', mediaUrl: 'https://'.concat(parameters.mediaDomain), maxFileUploadSizeMB: 50 },
api: { url: parameters.apiDomain, stage: STAGE },
socket: { url: parameters.webSocketApiDomain, stage: STAGE },
ionicExtraModules: ['common']
Expand Down

0 comments on commit 2ec7f6f

Please sign in to comment.