Skip to content

Commit

Permalink
fix imports; remove .vscode and ignore it
Browse files Browse the repository at this point in the history
  • Loading branch information
cbellone committed Jun 25, 2023
1 parent 9a77550 commit 107e72a
Show file tree
Hide file tree
Showing 11 changed files with 142 additions and 110 deletions.
1 change: 1 addition & 0 deletions frontend/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ yarn-error.log

# IDEs and editors
.idea/
.vscode/
.project
.classpath
.c9/
Expand Down
4 changes: 0 additions & 4 deletions frontend/.vscode/extensions.json

This file was deleted.

20 changes: 0 additions & 20 deletions frontend/.vscode/launch.json

This file was deleted.

42 changes: 0 additions & 42 deletions frontend/.vscode/tasks.json

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,24 +1,13 @@
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { ChartConfiguration, ChartData, ChartOptions } from 'chart.js';
import { Observable, map, of, switchMap } from 'rxjs';
import {
Event,
EventInfo,
EventOrganizationInfo,
EventTicketsStatistics,
} from '../../model/event';
import { EventService } from '../../shared/event.service';
import { formatDate } from '@angular/common';
import { ConfigurationService } from '../../shared/configuration.service';
import { InstanceSetting } from '../../model/instance-settings';
import {
TicketAccessType,
TicketCategory,
TicketCategoryFilter,
TicketTokenStatus,
UiTicketCategory,
} from 'projects/public/src/app/model/ticket-category';
import {Component, OnInit} from '@angular/core';
import {ActivatedRoute} from '@angular/router';
import {ChartConfiguration, ChartData, ChartOptions} from 'chart.js';
import {map, Observable, of, switchMap} from 'rxjs';
import {Event, EventInfo, EventOrganizationInfo, EventTicketsStatistics,} from '../../model/event';
import {EventService} from '../../shared/event.service';
import {formatDate} from '@angular/common';
import {ConfigurationService} from '../../shared/configuration.service';
import {InstanceSetting} from '../../model/instance-settings';
import {TicketCategory, TicketCategoryFilter, TicketTokenStatus, UiTicketCategory} from '../../model/ticket-category';

@Component({
selector: 'app-event-dashboard',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { Pipe, PipeTransform } from '@angular/core';
import {
TicketCategoryFilter,
UiTicketCategory,
} from 'projects/public/src/app/model/ticket-category';
import {Pipe, PipeTransform} from '@angular/core';
import {TicketCategoryFilter, UiTicketCategory} from '../model/ticket-category';


@Pipe({
name: 'showSelectedCategories',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { Pipe, PipeTransform } from '@angular/core';
import {
TicketCategory,
UiTicketCategory,
} from 'projects/public/src/app/model/ticket-category';
import {Pipe, PipeTransform} from '@angular/core';
import {TicketCategory, UiTicketCategory} from '../model/ticket-category';


@Pipe({
name: 'uiCategoryBuilder',
Expand Down
4 changes: 2 additions & 2 deletions frontend/projects/admin/src/app/model/event.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { TicketCategory } from 'projects/public/src/app/model/ticket-category';
import { Organization } from './organization';
import {Organization} from './organization';
import {TicketCategory} from './ticket-category';

export interface EventInfo {
allowedPaymentProxies: string[]; // TODO: enum
Expand Down
116 changes: 116 additions & 0 deletions frontend/projects/admin/src/app/model/ticket-category.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
export type TicketAccessType = 'INHERIT' | 'IN_PERSON' | 'ONLINE';

export interface TicketTokenStatus {
accessCodeId: number | null;
code: string;
id: number;
priceInCents: number;
recipientEmail: string | null;
recipientName: string | null;
sentTimestamp: string | null;
status: string;
ticketCategoryId: number;
}

export interface TicketCategory {
accessRestricted: boolean;
availableTickets: number | null;
bounded: boolean;
checkedInTickets: number;
containingOrphans: boolean;
containingStuckTickets: boolean;
description: { [key: string]: string };
displayTaxInformation: boolean;
expired: boolean;
formattedDiscountedPrice: string;
formattedExpiration: { [key: string]: string };
formattedFinalPrice: string;
formattedInception: { [key: string]: string };
free: boolean;
hasDiscount: boolean;
id: number;
maximumSaleableTickets: number;
maxTickets: number;
name: string;
notSoldTickets: number;
pendingTickets: number;
saleableAndLimitNotReached: boolean;
saleInFuture: boolean;
soldOutOrLimitReached: boolean;
soldTickets: number;
ticketAccessType: TicketAccessType;
tokenStatus: TicketTokenStatus[];
}

export class UiTicketCategory implements TicketCategory {
accessRestricted: boolean;
availableTickets: number | null;
bounded: boolean;
checkedInTickets: number;
containingOrphans: boolean;
containingStuckTickets: boolean;
description: { [key: string]: string };
displayTaxInformation: boolean;
displayWarning: boolean;
expired: boolean;
formattedDiscountedPrice: string;
formattedExpiration: { [key: string]: string };
formattedFinalPrice: string;
formattedInception: { [key: string]: string };
free: boolean;
hasDiscount: boolean;
id: number;
maximumSaleableTickets: number;
maxTickets: number;
name: string;
notSoldTickets: number;
pendingTickets: number;
saleableAndLimitNotReached: boolean;
saleInFuture: boolean;
soldOutOrLimitReached: boolean;
soldTickets: number;
ticketAccessType: TicketAccessType;
tokenViewExpanded: boolean;
attendeesList: { groupId: number; groupName: string } | null;
tokenStatus: TicketTokenStatus[];

constructor(ticketCategory: TicketCategory) {
this.accessRestricted = ticketCategory.accessRestricted;
this.availableTickets = ticketCategory.availableTickets;
this.bounded = ticketCategory.bounded;
this.checkedInTickets = ticketCategory.checkedInTickets;
this.containingOrphans = ticketCategory.containingOrphans;
this.containingStuckTickets = ticketCategory.containingStuckTickets;
this.description = ticketCategory.description;
this.displayTaxInformation = ticketCategory.displayTaxInformation;
this.displayWarning =
ticketCategory.containingStuckTickets || ticketCategory.containingOrphans;
this.expired = ticketCategory.expired;
this.formattedDiscountedPrice = ticketCategory.formattedDiscountedPrice;
this.formattedExpiration = ticketCategory.formattedExpiration;
this.formattedFinalPrice = ticketCategory.formattedFinalPrice;
this.formattedInception = ticketCategory.formattedInception;
this.free = ticketCategory.free;
this.hasDiscount = ticketCategory.hasDiscount;
this.id = ticketCategory.id;
this.maximumSaleableTickets = ticketCategory.maximumSaleableTickets;
this.maxTickets = ticketCategory.maxTickets;
this.name = ticketCategory.name;
this.saleableAndLimitNotReached = ticketCategory.saleableAndLimitNotReached;
this.saleInFuture = ticketCategory.saleInFuture;
this.soldOutOrLimitReached = ticketCategory.soldOutOrLimitReached;
this.soldTickets = ticketCategory.soldTickets;
this.ticketAccessType = ticketCategory.ticketAccessType;
this.pendingTickets = ticketCategory.pendingTickets;
this.notSoldTickets = ticketCategory.notSoldTickets;
this.tokenStatus = ticketCategory.tokenStatus;
this.tokenViewExpanded = false;
this.attendeesList = null;
}
}

export interface TicketCategoryFilter {
active: boolean;
expired: boolean;
search: string;
}
16 changes: 6 additions & 10 deletions frontend/projects/admin/src/app/shared/event.service.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { map, Observable } from 'rxjs';
import {
Event,
EventInfo,
EventOrganizationInfo,
EventTicketsStatistics,
} from '../model/event';
import { UiTicketCategory } from 'projects/public/src/app/model/ticket-category';
import {HttpClient} from '@angular/common/http';
import {Injectable} from '@angular/core';
import {map, Observable} from 'rxjs';
import {Event, EventInfo, EventOrganizationInfo, EventTicketsStatistics,} from '../model/event';
import {UiTicketCategory} from '../model/ticket-category';


@Injectable()
export class EventService {
Expand Down
2 changes: 1 addition & 1 deletion frontend/projects/public/src/app/model/ticket-category.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export type TicketAccessType = 'INHERIT' | 'IN_PERSON' | 'ONLINE';

export class TicketCategory {
export interface TicketCategory {
id: number;
name: string;
ticketAccessType: TicketAccessType;
Expand Down

0 comments on commit 107e72a

Please sign in to comment.