Skip to content

Commit

Permalink
Fix add venue patching bug
Browse files Browse the repository at this point in the history
  • Loading branch information
CatboyEngineering committed Jan 5, 2025
1 parent 5a2f9c3 commit 3c26e4a
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 17 deletions.
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,5 @@

<body class="bg-mmSand dark:bg-mmClubBlack">
<app-root></app-root>
<script src="polyfills-FFHMD2TL.js" type="module"></script><script src="main-S2EXODNF.js" type="module"></script></body>
<script src="polyfills-FFHMD2TL.js" type="module"></script><script src="main-XJ5KXQMA.js" type="module"></script></body>
</html>
28 changes: 14 additions & 14 deletions docs/main-S2EXODNF.js → docs/main-XJ5KXQMA.js

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ <h2 class="text-3xl text-mmRust dark:text-mmSand my-2 mt-5 font-FFXIV uppercase"
<select
#dataCenter
formControlName="datacenter"
class="flex-initial self-center border-b border-gray-800 dark:border-gray-500 px-2 py-1 bg-mmDarkSand dark:bg-mmClubBlue shadow-none hover:cursor-pointer outline-none focus:rounded-md focus:outline-mmRust dark:focus:outline-mmSand focus:outline-1 placeholder:text-gray-500 text-mmRust dark:text-mmSand">
class="flex-initial self-center border-b border-gray-800 dark:border-gray-500 px-2 py-1 bg-mmDarkSand dark:bg-mmClubBlue shadow-none hover:cursor-pointer outline-none focus:rounded-md focus:outline-mmRust dark:focus:outline-mmSand focus:outline-1 placeholder:text-gray-500 text-mmRust dark:text-mmSand"
(change)="mintIsSassy()">
<option>Aether</option>
<option>Crystal</option>
<option>Dynamis</option>
Expand All @@ -86,6 +87,7 @@ <h2 class="text-3xl text-mmRust dark:text-mmSand my-2 mt-5 font-FFXIV uppercase"
<i class="flex-initial self-center mx-1 text-2xl fa-solid fa-globe w-8 text-mmRust dark:text-mmSand"></i>

<select
#venueWorld
formControlName="world"
class="flex-initial self-center border-b border-gray-800 dark:border-gray-500 px-2 py-1 bg-mmDarkSand dark:bg-mmClubBlue shadow-none hover:cursor-pointer outline-none focus:rounded-md focus:outline-mmRust dark:focus:outline-mmSand focus:outline-1 placeholder:text-gray-500 text-mmRust dark:text-mmSand">
<optgroup *ngIf="dataCenter.value === 'Aether'" label="Aether">
Expand Down Expand Up @@ -205,6 +207,7 @@ <h2 class="text-3xl text-mmRust dark:text-mmSand my-2 mt-5 font-FFXIV uppercase"

<!-- Times -->
<h2 class="text-3xl text-mmRust dark:text-mmSand my-2 mt-5 font-FFXIV uppercase">Times</h2>
<ui-form-field-error [form]="form" [errorFor]="'hours'" [errorType]="'required'">Venue times are required</ui-form-field-error>
<div class="border border-mmDarkRust p-3 rounded-md">
<div class="flex mb-4 mx-2 text-gray-700 dark:text-gray-400">
<i class="text-lg self-center flex-initial fa-solid fa-circle-info"></i>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { CommonModule } from '@angular/common';
import { Component, Input, OnInit } from '@angular/core';
import { Component, ElementRef, Input, OnInit, ViewChild } from '@angular/core';
import { FormBuilder, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms';
import { RouterLink } from '@angular/router';
import { VenueChangeRequest } from '../../../models/API/request/venue-change-request.interface';
Expand Down Expand Up @@ -30,6 +30,7 @@ import { HoursFormComponent } from '../hours-form/hours-form.component';
styleUrl: './venue-info-form.component.css'
})
export class VenueInfoFormComponent implements OnInit {
@ViewChild('venueWorld') venueWorld: ElementRef;
@Input() venue?: CombinedVenue;

venueInfoForm: FormGroup<VenueInfoForm>;
Expand Down Expand Up @@ -92,6 +93,14 @@ export class VenueInfoFormComponent implements OnInit {
}
}

mintIsSassy() {
setTimeout(() => {
var ele = this.venueWorld.nativeElement.options;

this.venueInfoForm.controls.world.patchValue(ele[0].value);
}, 50);
}

onHoursAdded(hours: any) {
var existingHours = structuredClone(this.venueInfoForm.controls.hours.value);

Expand Down
2 changes: 2 additions & 0 deletions src/app/components/pages/edit-venue/edit-venue.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ export class EditVenueComponent implements OnInit {
constructor(private route: ActivatedRoute, private authStateService: AuthStateService, private venueStateService: VenueStateService) {}

ngOnInit(): void {
this.authStateService.onHeartbeat();

this.venue$ = this.route.queryParamMap.pipe(
filter(params => !!params.get('id')),
withLatestFrom(this.venueStateService.venues$, this.authStateService.accountID$, this.authStateService.isAdmin$),
Expand Down

0 comments on commit 3c26e4a

Please sign in to comment.