Skip to content

Commit

Permalink
feat: update packs
Browse files Browse the repository at this point in the history
  • Loading branch information
EmmanuelDemey committed Feb 3, 2024
1 parent 00b6192 commit 638464c
Show file tree
Hide file tree
Showing 9 changed files with 68 additions and 67 deletions.
2 changes: 1 addition & 1 deletion public/src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<mat-toolbar color="primary">
<mat-toolbar-row>
<span>CMS4Partners</span>
<span>{{ title }}</span>
<span class="example-spacer"></span>

@if (isLoggedIn === true) {
Expand Down
2 changes: 1 addition & 1 deletion public/src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { environment } from '../environments/environment';
})
export class AppComponent {
isLoggedIn: boolean | undefined;

title = environment.title;
private auth: Auth = inject(Auth);
constructor() {
this.auth.onAuthStateChanged((state) => {
Expand Down
8 changes: 2 additions & 6 deletions public/src/app/model/company.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
import { Timestamp } from '@angular/fire/firestore';

export type Configuration = {
party: number;
bronze: number;
silver: number;
gold: number;
platinium: number;
export type SponsoringType = Record<string, number>;
export type Configuration = SponsoringType & {
next_value: string;
enabled: boolean;
};
Expand Down
10 changes: 10 additions & 0 deletions public/src/app/ui/admin-code/admin-code.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@
<input matInput type="text" [(ngModel)]="company.wldId" />
</mat-form-field>
</div>
<div class="inline-bloc">
<mat-form-field appearance="fill">
<mat-label>Activités sur le Stand</mat-label>
<textarea
[(ngModel)]="company.activities"
matInput
maxlength="280"
></textarea>
</mat-form-field>
</div>

<div class="inline-bloc">
<button color="primary" mat-raised-button (click)="updateBilletwebUrl()">
Expand Down
27 changes: 1 addition & 26 deletions public/src/app/ui/admin-validated/admin-validated.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,32 +49,7 @@ export class AdminValidatedComponent {
this.isAdmin =
state?.email?.endsWith('@' + environment.emailDomain) ?? false;

const options = [
{
value: 'Platinium',
label: 'Platinium',
},
{
value: 'Gold',
label: 'Gold',
},
{
value: 'Silver',
label: 'Silver',
},
{
value: 'Bronze',
label: 'Bronze',
},
{
value: 'Party',
label: 'Party',
},
{
value: 'Newsletter',
label: 'Etre notifié pour le Devfest Lille 2025',
},
];
const options = environment.sponsoringTypes;
if (this.isAdmin) {
this.options = options;
} else {
Expand Down
41 changes: 8 additions & 33 deletions public/src/app/ui/form/form.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { Emails } from './validators';
import { MatInputModule } from '@angular/material/input';
import { MatButtonModule } from '@angular/material/button';
import { MatFormFieldModule } from '@angular/material/form-field';
import { environment } from '../../../environments/environment';
const defaultCompany: Company = {
name: '',
officialName: '',
Expand All @@ -33,7 +34,7 @@ const defaultCompany: Company = {
interface Option {
value: string;
label: string;
enabled: boolean;
enabled?: boolean;
}
type Options = Option[];

Expand Down Expand Up @@ -75,38 +76,12 @@ export class FormComponent {

if (!!config) {
this.enabled = config.enabled;
this.options = [
{
value: 'Platinium',
label: 'Platinium',
enabled: config.platinium > 0,
},
{
value: 'Gold',
label: 'Gold',
enabled: config.gold > 0,
},
{
value: 'Silver',
label: 'Silver',
enabled: config.silver > 0,
},
{
value: 'Bronze',
label: 'Bronze',
enabled: config.bronze > 0,
},
{
value: 'Party',
label: 'Party',
enabled: config.party > 0,
},
{
value: 'Newsletter',
label: 'Etre notifié pour le Devfest Lille 2025',
enabled: true,
},
];
this.options = environment.sponsoringTypes.map((sponsoring) => {
return {
enable: config[sponsoring.value.toLocaleLowerCase()] > 0,
...sponsoring,
};
});
}

this.company.subscribe((c) => {
Expand Down
16 changes: 16 additions & 0 deletions public/src/environments/environment.cloudnord.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Environement } from './environment.type';

export const environment: Environement = {
title: 'CMS Cloud Nord',
firebase: {
apiKey: 'AIzaSyAEpVOFj8ciDs8tqYMCn669J12GXKdRSl4',
authDomain: 'cms4devfest.firebaseapp.com',
Expand All @@ -13,4 +14,19 @@ export const environment: Environement = {
files: {
'RIB de Cloud Nord': '/assets/RIB_Cloud_Nord.pdf',
},
sponsoringTypes: [
{
value: 'Digital',
label: 'Digital',
},
{
value: 'Physique',
label: 'Physique',
},
{
value: 'Newsletter',
label: 'Etre notifié la prochaine édition',
enabled: true,
},
],
};
27 changes: 27 additions & 0 deletions public/src/environments/environment.devfestlille.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,31 @@ export const environment: Environement = {
'Journal Officiel suite à la création du GDG Lille':
'/assets/JournalOfficiel.pdf',
},
sponsoringTypes: [
{
value: 'Platinium',
label: 'Platinium',
},
{
value: 'Gold',
label: 'Gold',
},
{
value: 'Silver',
label: 'Silver',
},
{
value: 'Bronze',
label: 'Bronze',
},
{
value: 'Party',
label: 'Party',
},
{
value: 'Newsletter',
label: 'Etre notifié la prochaine édition',
enabled: true,
},
],
};
2 changes: 2 additions & 0 deletions public/src/environments/environment.type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@ export type Environement = {
firebase?: Record<string, string>;
emailDomain: string;
files: Record<string, string>;
sponsoringTypes: { value: string; label: string; enabled?: boolean }[];
title: string;
};

0 comments on commit 638464c

Please sign in to comment.