Skip to content

Commit

Permalink
Merge pull request #4 from ipimpat/develop
Browse files Browse the repository at this point in the history
Fix user page property change in Jetstream 3.x
  • Loading branch information
ipimpat authored Feb 16, 2023
2 parents 77c4635 + a79e631 commit e7b2fb9
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 15 deletions.
14 changes: 7 additions & 7 deletions stubs/resources/js/Layouts/AppLayout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const logout = () => {
<Dropdown v-if="$page.props.jetstream.hasTeamFeatures" align="end">
<template #trigger>
<div class="d-flex justify-content-between align-items-center">
{{ $page.props.user.current_team.name }}
{{ $page.props.auth.user.current_team.name }}
<i class="bi bi-chevron-expand ms-2 pt-1"></i>
</div>
</template>
Expand All @@ -67,7 +67,7 @@ const logout = () => {
</li>

<!-- Team Settings -->
<DropdownLink :href="route('teams.show', $page.props.user.current_team)" :active="route().current('teams.show', $page.props.user.current_team)">
<DropdownLink :href="route('teams.show', $page.props.auth.user.current_team)" :active="route().current('teams.show', $page.props.auth.user.current_team)">
Team Settings
</DropdownLink>

Expand All @@ -82,11 +82,11 @@ const logout = () => {
<div class="dropdown-header">Switch Teams</div>
</li>

<template v-for="team in $page.props.user.all_teams" :key="team.id">
<template v-for="team in $page.props.auth.user.all_teams" :key="team.id">
<form @submit.prevent="switchToTeam(team)">
<DropdownLink as="button">
<div class="d-flex align-items-center">
<i v-if="team.id == $page.props.user.current_team_id" class="bi bi-check-circle me-2 text-success"></i>
<i v-if="team.id == $page.props.auth.user.current_team_id" class="bi bi-check-circle me-2 text-success"></i>
{{ team.name }}
</div>
</DropdownLink>
Expand All @@ -103,11 +103,11 @@ const logout = () => {
v-if="$page.props.jetstream.managesProfilePhotos"
class="rounded-circle pb-1"
style="width:2rem; height:2rem"
:src="$page.props.user.profile_photo_url"
:alt="$page.props.user.name"
:src="$page.props.auth.user.profile_photo_url"
:alt="$page.props.auth.user.name"
/>
<div v-else class="d-flex justify-content-between align-items-center">
{{ $page.props.user.name }}
{{ $page.props.auth.user.name }}
<i class="bi bi-chevron-down ms-2 pt-1"></i>
</div>
</template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const confirmationForm = useForm({
});
const twoFactorEnabled = computed(
() => ! enabling.value && usePage().props.user?.two_factor_enabled,
() => ! enabling.value && usePage().props.auth.user?.two_factor_enabled,
);
watch(twoFactorEnabled, () => {
Expand Down
2 changes: 1 addition & 1 deletion stubs/resources/js/Pages/Profile/Show.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ defineProps({
</template>

<div v-if="$page.props.jetstream.canUpdateProfileInformation">
<UpdateProfileInformationForm :user="$page.props.user" />
<UpdateProfileInformationForm :user="$page.props.auth.user" />

<SectionBorder />
</div>
Expand Down
6 changes: 3 additions & 3 deletions stubs/resources/js/Pages/Teams/Partials/CreateTeamForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ const createTeam = () => {
<InputLabel value="Team Owner" />

<div class="d-flex align-items-center mt-2">
<img class="rounded-circle" style="width: 3rem; height: 3rem;" :src="$page.props.user.profile_photo_url" :alt="$page.props.user.name">
<img class="rounded-circle" style="width: 3rem; height: 3rem;" :src="$page.props.auth.user.profile_photo_url" :alt="$page.props.auth.user.name">

<div class="ms-3 lh-sm">
<div class="lead">{{ $page.props.user.name }}</div>
<div class="lead">{{ $page.props.auth.user.name }}</div>
<div class="text-muted">
{{ $page.props.user.email }}
{{ $page.props.auth.user.email }}
</div>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions stubs/resources/js/Pages/Teams/Partials/TeamMemberManager.vue
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const confirmLeavingTeam = () => {
};
const leaveTeam = () => {
leaveTeamForm.delete(route('team-members.destroy', [props.team, usePage().props.user]));
leaveTeamForm.delete(route('team-members.destroy', [props.team, usePage().props.auth.user]));
};
const confirmTeamMemberRemoval = (teamMember) => {
Expand Down Expand Up @@ -263,7 +263,7 @@ const displayableRole = (role) => {

<!-- Leave Team -->
<button
v-if="$page.props.user.id === user.id"
v-if="$page.props.auth.user.id === user.id"
class="btn btn-link text-danger text-decoration-none ms-5"
@click="confirmLeavingTeam"
>
Expand Down
2 changes: 1 addition & 1 deletion stubs/resources/js/Pages/Welcome.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ defineProps({
<div class="col-12">
<div class="d-flex justify-content-end">
<div>
<Link v-if="$page.props.user" :href="route('dashboard')" class="text-muted">Dashboard</Link>
<Link v-if="$page.props.auth.user" :href="route('dashboard')" class="text-muted">Dashboard</Link>

<template v-else>
<Link :href="route('login')" class="text-muted">Log in</Link>
Expand Down

0 comments on commit e7b2fb9

Please sign in to comment.