Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: syntax error when running prettier on blade files (resolves #2338) #2339

Merged
merged 5 commits into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion resources/css/_tokens.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* VARIABLES GENERATED WITH TAILWIND CONFIG ON 2024-10-22.
/* VARIABLES GENERATED WITH TAILWIND CONFIG ON 2024-10-29.
Tokens location: ./tailwind.config.js */
:root {
--space-0: 0;
Expand Down
24 changes: 16 additions & 8 deletions resources/css/components/_input.css
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,10 @@ select:hover {
input:focus,
textarea:focus,
select:focus {
box-shadow: 0 0 0 var(--border-2) var(--input-border-focus) inset,
0 0 0 var(--border-2) var(--bg, var(--body-background)), 0 0 0 var(--border-4) var(--input-border-focus);
box-shadow:
0 0 0 var(--border-2) var(--input-border-focus) inset,
0 0 0 var(--border-2) var(--bg, var(--body-background)),
0 0 0 var(--border-4) var(--input-border-focus);
outline: transparent;
}

Expand Down Expand Up @@ -135,8 +137,10 @@ input[type="radio"]:hover {

input[type="checkbox"]:focus,
input[type="radio"]:focus {
box-shadow: 0 0 0 var(--border-2) var(--input-border-focus) inset,
0 0 0 var(--border-2) var(--bg, var(--body-background)), 0 0 0 var(--border-4) var(--input-border-focus);
box-shadow:
0 0 0 var(--border-2) var(--input-border-focus) inset,
0 0 0 var(--border-2) var(--bg, var(--body-background)),
0 0 0 var(--border-4) var(--input-border-focus);
outline: transparent;
}

Expand Down Expand Up @@ -174,7 +178,8 @@ input[type="checkbox"]:checked {
}

input[type="checkbox"]:checked:focus {
box-shadow: 0 0 0 var(--border-2) var(--bg, var(--body-background)),
box-shadow:
0 0 0 var(--border-2) var(--bg, var(--body-background)),
0 0 0 var(--border-4) var(--checkbox-checked-border);
}

Expand All @@ -183,14 +188,17 @@ input[type="radio"]:checked {
background-position: center;
background-repeat: no-repeat;
border-color: var(--bg, var(--body-background));
box-shadow: 0 0 0 var(--border-3) var(--bg, var(--body-background)) inset,
box-shadow:
0 0 0 var(--border-3) var(--bg, var(--body-background)) inset,
0 0 0 var(--border-2) var(--radio-checked-border);
}

input[type="radio"]:checked:focus {
border-color: var(--bg, var(--body-background));
box-shadow: 0 0 0 var(--border-3) var(--bg, var(--body-background)) inset,
0 0 0 var(--border-2) var(--radio-checked-border), 0 0 0 var(--border-4) var(--bg, var(--body-background)),
box-shadow:
0 0 0 var(--border-3) var(--bg, var(--body-background)) inset,
0 0 0 var(--border-2) var(--radio-checked-border),
0 0 0 var(--border-4) var(--bg, var(--body-background)),
0 0 0 var(--border-6) var(--radio-checked-border);
}

Expand Down
31 changes: 17 additions & 14 deletions resources/js/confirmPassword.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default (confirmedPasswordStatusRoute = false, confirmPasswordRoute = fal
showingModal: false,
validationError: false,
init() {
axios.get(this.routes.confirmedPasswordStatus).then(response => {
axios.get(this.routes.confirmedPasswordStatus).then((response) => {
if (response.data.confirmed) {
this.confirmedPassword = true;
}
Expand All @@ -32,7 +32,7 @@ export default (confirmedPasswordStatusRoute = false, confirmPasswordRoute = fal
document.body.style.top = `-${scrollY}px`;
this.$nextTick(() => {
const elems = document.querySelectorAll("a, button, input, select, textarea, [contenteditable]");
Array.prototype.forEach.call(elems, elem => {
Array.prototype.forEach.call(elems, (elem) => {
if (!elem.closest(".modal")) {
elem.setAttribute("tabindex", "-1");
}
Expand All @@ -47,24 +47,27 @@ export default (confirmedPasswordStatusRoute = false, confirmPasswordRoute = fal
document.body.style.top = "";
window.scrollTo(0, parseInt(scrollY || "0") * -1);
const elems = document.querySelectorAll("a, button, input, select, textarea, [contenteditable]");
Array.prototype.forEach.call(elems, elem => {
Array.prototype.forEach.call(elems, (elem) => {
if (!elem.closest(".modal")) {
elem.removeAttribute("tabindex", "-1");
}
});
},
confirmPassword: function () {
axios.post(this.routes.confirmPassword, {
password: this.$refs.password.value
}).then(() => {
this.hideModal();
this.confirmPassword = true;
this.validationError = false;
this.targetForm.submit();
})["catch"](() => {
this.$refs.password.focus();
this.validationError = true;
});
axios
.post(this.routes.confirmPassword, {
password: this.$refs.password.value
})
.then(() => {
this.hideModal();
this.confirmPassword = true;
this.validationError = false;
this.targetForm.submit();
})
["catch"](() => {
this.$refs.password.focus();
this.validationError = true;
});
},
cancel: function () {
this.hideModal();
Expand Down
4 changes: 2 additions & 2 deletions resources/js/enhancedCheckboxes.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ export default () => ({
this.checkboxes = this.$el.querySelectorAll("input[type='checkbox']");
},
selectAll() {
[...this.checkboxes].forEach(el => {
[...this.checkboxes].forEach((el) => {
el.checked = true;
});
},
selectNone() {
[...this.checkboxes].forEach(el => {
[...this.checkboxes].forEach((el) => {
el.checked = false;
});
}
Expand Down
4 changes: 2 additions & 2 deletions resources/views/components/block-modal.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

@if (Auth::user()->individual)
@if (Auth::user()->individual->isConsultant() ||
Auth::user()->individual->isConnector() ||
Auth::user()->individual->isParticipant())
Auth::user()->individual->isConnector() ||
Auth::user()->individual->isParticipant())
<p>{{ __('They will not be able to:') }}</p>

<ul>
Expand Down
2 changes: 1 addition & 1 deletion resources/views/components/card/project.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<strong>{{ __('Project by :projectable', ['projectable' => $model->projectable->name]) }}</strong><br />
@if ($model->projectable->sectors()->count())
<span class="font-semibold">{{ __('Sector:') }}</span>
{{ implode(', ',$model->projectable->sectors()->pluck('name')->toArray()) }}
{{ implode(', ', $model->projectable->sectors()->pluck('name')->toArray()) }}
@endif
</p>
<p class="flex flex-wrap gap-3">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<p>
@if ($model->sectors()->count())
<span class="font-semibold">{{ __('Sector:') }}</span>
{{ implode(', ',$model->sectors()->pluck('name')->toArray()) }}<br />
{{ implode(', ', $model->sectors()->pluck('name')->toArray()) }}<br />
@endif
@isset($model->locality)
<span class="font-semibold">{{ __('Location') }}:</span> {{ $model->locality }},
Expand Down
3 changes: 1 addition & 2 deletions resources/views/components/progress-icon.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
stroke-dashoffset="{{ 7 * 2 * pi() - 7 * 2 * pi() * $progress ?? 0 }}" fill="transparent" r="7"
cx="12" cy="12" />
@else
<circle fill="transparent" stroke="currentColor" stroke-width="2" r="9" cx="12"
cy="12" />
<circle fill="transparent" stroke="currentColor" stroke-width="2" r="9" cx="12" cy="12" />
@endif
</svg>
14 changes: 5 additions & 9 deletions resources/views/engagements/edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -288,15 +288,11 @@ class="field @error('accepted_formats') field--error @enderror @error('other_acc
<x-interpretation name="{{ __('Sign up deadline', [], 'en') }}" />

<div class="field @error('signup_by_date') field--error @enderror">
<x-date-picker name="signup_by_date" :label="$engagement->recruitment === 'open'
? __('Participants must sign up for this engagement by the following date') .
' ' .
__('(required)') .
':'
: __('Participants must respond to their invitation by the following date') .
' ' .
__('(required)') .
':'" :value="old('signup_by_date', $engagement->signup_by_date?->format('Y-m-d') ?? '')" />
<x-date-picker name="signup_by_date"
label="{{ $engagement->recruitment === 'open'
? __('Participants must sign up for this engagement by the following date') . ' ' . __('(required)') . ':'
: __('Participants must respond to their invitation by the following date') . ' ' . __('(required)') . ':' }}"
:value="old('signup_by_date', $engagement->signup_by_date?->format('Y-m-d') ?? '')" />
</div>
@endif
<hr class="divider--thick" />
Expand Down
20 changes: 12 additions & 8 deletions resources/views/engagements/leave.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,26 +19,30 @@
'support_person_name' => $engagement->connector->user->support_person_name,
]) }}</strong><br />
@if ($engagement->connector->contact_email)
<x-contact-point type='email' :value="$engagement->connector->contact_email" :preferred="$engagement->connector->preferred_contact_method === 'email' &&
$engagement->connector->contact_phone" />
<x-contact-point type='email' :value="$engagement->connector->contact_email"
preferred="{{ $engagement->connector->preferred_contact_method === 'email' && $engagement->connector->contact_phone }}" />
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we sure this works? I think I remember there being a distinction where Blade components couldn't use this syntax but can't find documentation on it now.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have tried to test all these types of changes and I believe they are working. For example I was able to get the appended (preferred) to flip between email and phone by changing the related setting. It's worth testing out at least one of these changes again though. I think maybe org or fro contact might be easier.

@endif
@if ($engagement->connector->contact_phone)
<x-contact-point type='phone' :value="$engagement->connector->contact_phone" :preferred="$engagement->connector->preferred_contact_method === 'phone' &&
$engagement->connector->contact_email" :vrs="$engagement->connector->contact_vrs" />
<x-contact-point type='phone' :value="$engagement->connector->contact_phone"
preferred="{{ $engagement->connector->preferred_contact_method === 'phone' && $engagement->connector->contact_email }}"
:vrs="$engagement->connector->contact_vrs" />
@endif
</p>
@elseif($engagement->organizationalConnector)
<p>
<strong>{{ $engagement->organizationalConnector->contact_person_name ? $engagement->organizationalConnector->contact_person_name . ' (' . $engagement->organizationalConnector->name . ')' : $engagement->organizationalConnector->name }}</strong><br />
@if ($engagement->organizationalConnector->contact_person_email)
<x-contact-point type="email" :value="$engagement->organizationalConnector->contact_person_email" :preferred="$engagement->organizationalConnector->preferred_contact_method === 'email' &&
$engagement->organizationalConnector->contact_person_phone" />
<x-contact-point type="email" :value="$engagement->organizationalConnector->contact_person_email"
preferred="{{ $engagement->organizationalConnector->preferred_contact_method === 'email' &&
$engagement->organizationalConnector->contact_person_phone }}" />
@endif
@if ($engagement->organizationalConnector->contact_person_phone)
<x-contact-point type="phone" :value="$engagement->organizationalConnector->contact_person_phone->formatForCountry(
'CA',
)" :preferred="$engagement->organizationalConnector->preferred_contact_method === 'phone' &&
$engagement->organizationalConnector->contact_person_email" :vrs="$engagement->organizationalConnector->contact_person_vrs" />
)"
preferred="{{ $engagement->organizationalConnector->preferred_contact_method === 'phone' &&
$engagement->organizationalConnector->contact_person_email }}"
:vrs="$engagement->organizationalConnector->contact_person_vrs" />
@endif
</p>
@endif
Expand Down
3 changes: 2 additions & 1 deletion resources/views/engagements/show-format-selection.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
<!-- Form Validation Errors -->
@include('partials.validation-errors')

<form class="stack" action="{{ localized_route('engagements.store-format', $engagement) }}" method="post" novalidate>
<form class="stack" action="{{ localized_route('engagements.store-format', $engagement) }}" method="post"
novalidate>
@csrf
@method('put')

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,11 @@ class="field @error('disability_and_deaf') field--error @enderror @error('lived_
)"
required />
<div class="field">
<x-hearth-checkbox name="has_other_disability_connection" :checked="old(
'has_other_disability_connection',
!is_null($individual->other_disability_connection) &&
$individual->other_disability_connection !== '',
)"
<x-hearth-checkbox name="has_other_disability_connection"
checked="{{ old(
'has_other_disability_connection',
!is_null($individual->other_disability_connection) && $individual->other_disability_connection !== '',
) }}"
x-model="otherDisability" />
<x-hearth-label
for='has_other_disability_connection'>{{ __('Something else') }}</x-hearth-label>
Expand Down
4 changes: 1 addition & 3 deletions resources/views/individuals/show.blade.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
<x-app-layout page-width="wide">
<x-slot name="title">{{ $individual->name }}</x-slot>
<x-slot name="header">
@if (auth()->hasUser() &&
auth()->user()->isAdministrator() &&
$individual->user->checkStatus('suspended'))
@if (auth()->hasUser() && auth()->user()->isAdministrator() && $individual->user->checkStatus('suspended'))
@push('banners')
<x-banner type="error" icon="heroicon-s-ban">{{ __('This account has been suspended.') }}</x-banner>
@endpush
Expand Down
5 changes: 2 additions & 3 deletions resources/views/layouts/header.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
</nav>
@endif
{{-- Don't show if no session available (i.e on error pages like 404) --}}
@unless(session()->missing('_token'))
@unless (session()->missing('_token'))
@include('components.navigation')
@endunless
</div>
Expand All @@ -29,8 +29,7 @@
{{ safe_inlineMarkdown('**CAUTION!** This website is under active development. The database is reset nightly, and data you enter will not be preserved.') }}
</x-banner>
@endenv
@if (auth()->hasUser() &&
auth()->user()->checkStatus('suspended'))
@if (auth()->hasUser() && auth()->user()->checkStatus('suspended'))
<x-banner type="error">
{{ safe_inlineMarkdown(
'Your account has been suspended. Please [contact](:url) us if you need further assistance.',
Expand Down
5 changes: 4 additions & 1 deletion resources/views/organizations/create.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@
@if ($message === __('A :type with this name already exists.', ['type' => App\Enums\OrganizationType::labels()[$type]]))
<div class="stack">
@php
$organization = App\Models\Organization::where('name->' . $locale, old('name.' . $locale))->first();
$organization = App\Models\Organization::where(
'name->' . $locale,
old('name.' . $locale),
)->first();
@endphp
<x-live-region>
<x-hearth-alert type="error">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@ class="field box @error('disability_and_deaf_constituencies') field--error @ende
$organization->disabilityAndDeafConstituencies->pluck('id')->toArray() ?? [],
)" required />
<div class="field">
<x-hearth-checkbox name="has_other_disability_constituency" :checked="old(
'has_other_disability_constituency',
!is_null($organization->other_disability_constituency) &&
$organization->other_disability_constituency !== '',
)" x-model="otherDisability" />
<x-hearth-checkbox name="has_other_disability_constituency"
checked="{{ old(
'has_other_disability_constituency',
!is_null($organization->other_disability_constituency) && $organization->other_disability_constituency !== '',
) }}"
x-model="otherDisability" />
<x-hearth-label for='has_other_disability_constituency'>{{ __('Something else') }}</x-hearth-label>
</div>

Expand Down
14 changes: 7 additions & 7 deletions resources/views/organizations/show.blade.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
<x-app-layout page-width="wide">
<x-slot name="title">{{ $organization->getTranslation('name', $language) }}</x-slot>
<x-slot name="header">
@if (auth()->hasUser() &&
auth()->user()->isAdministrator() &&
$organization->checkStatus('suspended'))
@if (auth()->hasUser() && auth()->user()->isAdministrator() && $organization->checkStatus('suspended'))
@push('banners')
<x-banner type="error" icon="heroicon-s-ban">{{ __('This account has been suspended.') }}</x-banner>
@endpush
Expand Down Expand Up @@ -131,10 +129,12 @@
<x-interpretation name="{{ __('About', [], 'en') }}" />
@include('organizations.partials.about')
@elseif(request()->localizedRouteIs('organizations.show-constituencies'))
<x-section-heading :name="__('Communities we :represent_or_serve_and_support', [
'represent_or_serve_and_support' =>
$organization->type === 'representative' ? __('represent') : __('serve and support'),
])" :model="$organization" :href="localized_route('organizations.edit', ['organization' => $organization, 'step' => 2])" />
<x-section-heading
name="{{ __('Communities we :represent_or_serve_and_support', [
'represent_or_serve_and_support' =>
$organization->type === 'representative' ? __('represent') : __('serve and support'),
]) }}"
:model="$organization" :href="localized_route('organizations.edit', ['organization' => $organization, 'step' => 2])" />
<x-interpretation
name="{{ __(
'Communities we :represent_or_serve_and_support',
Expand Down
9 changes: 5 additions & 4 deletions resources/views/projects/edit/1.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,11 @@
</legend>
<x-hearth-checkboxes name="outcome_analysis" :options="\Spatie\LaravelOptions\Options::forEnum(App\Enums\OutcomeAnalyzer::class)->toArray()" :checked="old('outcome_analysis', $project->outcome_analysis ?? [])" required />
<div class="field">
<x-hearth-checkbox name="has_other_outcome_analysis" :checked="old(
'has_other_outcome_analysis',
!is_null($project->outcome_analysis_other) && $project->outcome_analysis_other !== '',
)"
<x-hearth-checkbox name="has_other_outcome_analysis"
checked="{{ old(
'has_other_outcome_analysis',
!is_null($project->outcome_analysis_other) && $project->outcome_analysis_other !== '',
) }}"
x-model="otherOutcomeAnalysis" />
<x-hearth-label for='has_other_outcome_analysis'>{{ __('Other') }}</x-hearth-label>
</div>
Expand Down
Loading
Loading