fix: misc fixes (#5584)
* fix: PATs editing bug #4908 * fix: gallery edit do not do falsy check on title and description * feat: add aspect ratio on gallery images * change aspect ratio to 16:9 * fix: mobile nav bar #5580 * use css::after instead for navbar fix * adjust after content to fix thin line * add save area inset for transform
This commit is contained in:
@@ -1279,7 +1279,7 @@ const { cycle: changeTheme } = useTheme()
|
|||||||
left: 0;
|
left: 0;
|
||||||
background-color: var(--color-raised-bg);
|
background-color: var(--color-raised-bg);
|
||||||
z-index: 11; // 20 = modals, 10 = svg icons
|
z-index: 11; // 20 = modals, 10 = svg icons
|
||||||
transform: translateY(100%);
|
transform: translateY(calc(100% + env(safe-area-inset-bottom)));
|
||||||
transition: transform 0.4s cubic-bezier(0.54, 0.84, 0.42, 1);
|
transition: transform 0.4s cubic-bezier(0.54, 0.84, 0.42, 1);
|
||||||
border-radius: var(--size-rounded-card) var(--size-rounded-card) 0 0;
|
border-radius: var(--size-rounded-card) var(--size-rounded-card) 0 0;
|
||||||
box-shadow: 0 0 20px 2px rgba(0, 0, 0, 0);
|
box-shadow: 0 0 20px 2px rgba(0, 0, 0, 0);
|
||||||
@@ -1367,6 +1367,17 @@ const { cycle: changeTheme } = useTheme()
|
|||||||
border-top: 2px solid rgba(0, 0, 0, 0);
|
border-top: 2px solid rgba(0, 0, 0, 0);
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
|
||||||
|
&::after {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
bottom: 2px;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 300px;
|
||||||
|
background-color: var(--color-raised-bg);
|
||||||
|
transform: translateY(100%);
|
||||||
|
}
|
||||||
|
|
||||||
&.expanded {
|
&.expanded {
|
||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
border-radius: 0;
|
border-radius: 0;
|
||||||
|
|||||||
@@ -2071,10 +2071,10 @@ const createGalleryItemMutation = useMutation({
|
|||||||
file.type.split('/')[file.type.split('/').length - 1]
|
file.type.split('/')[file.type.split('/').length - 1]
|
||||||
}&featured=${featured ?? false}`
|
}&featured=${featured ?? false}`
|
||||||
|
|
||||||
if (title) {
|
if (title != null) {
|
||||||
url += `&title=${encodeURIComponent(title)}`
|
url += `&title=${encodeURIComponent(title)}`
|
||||||
}
|
}
|
||||||
if (description) {
|
if (description != null) {
|
||||||
url += `&description=${encodeURIComponent(description)}`
|
url += `&description=${encodeURIComponent(description)}`
|
||||||
}
|
}
|
||||||
if (ordering !== null && ordering !== undefined) {
|
if (ordering !== null && ordering !== undefined) {
|
||||||
@@ -2132,10 +2132,10 @@ const editGalleryItemMutation = useMutation({
|
|||||||
mutationFn: async ({ projectId, imageUrl, title, description, featured, ordering }) => {
|
mutationFn: async ({ projectId, imageUrl, title, description, featured, ordering }) => {
|
||||||
let url = `project/${projectId}/gallery?url=${encodeURIComponent(imageUrl)}&featured=${featured ?? false}`
|
let url = `project/${projectId}/gallery?url=${encodeURIComponent(imageUrl)}&featured=${featured ?? false}`
|
||||||
|
|
||||||
if (title) {
|
if (title != null) {
|
||||||
url += `&title=${encodeURIComponent(title)}`
|
url += `&title=${encodeURIComponent(title)}`
|
||||||
}
|
}
|
||||||
if (description) {
|
if (description != null) {
|
||||||
url += `&description=${encodeURIComponent(description)}`
|
url += `&description=${encodeURIComponent(description)}`
|
||||||
}
|
}
|
||||||
if (ordering !== null && ordering !== undefined) {
|
if (ordering !== null && ordering !== undefined) {
|
||||||
|
|||||||
@@ -484,8 +484,8 @@ async function editGalleryItem() {
|
|||||||
const imageUrl = filteredGallery.value[editIndex.value].url
|
const imageUrl = filteredGallery.value[editIndex.value].url
|
||||||
const success = await contextEditGalleryItem(
|
const success = await contextEditGalleryItem(
|
||||||
imageUrl,
|
imageUrl,
|
||||||
editTitle.value || undefined,
|
editTitle.value,
|
||||||
editDescription.value || undefined,
|
editDescription.value,
|
||||||
editFeatured.value,
|
editFeatured.value,
|
||||||
editOrder.value ? Number(editOrder.value) : undefined,
|
editOrder.value ? Number(editOrder.value) : undefined,
|
||||||
)
|
)
|
||||||
@@ -683,7 +683,7 @@ async function deleteGalleryImage() {
|
|||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
border-radius: var(--size-rounded-card) var(--size-rounded-card) 0 0;
|
border-radius: var(--size-rounded-card) var(--size-rounded-card) 0 0;
|
||||||
|
|
||||||
min-height: 10rem;
|
aspect-ratio: 16 / 9;
|
||||||
object-fit: cover;
|
object-fit: cover;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -427,8 +427,8 @@ const editGalleryItem = async () => {
|
|||||||
|
|
||||||
const success = await editGalleryItemMutation(
|
const success = await editGalleryItemMutation(
|
||||||
filteredGallery.value[editIndex.value].url,
|
filteredGallery.value[editIndex.value].url,
|
||||||
editTitle.value || undefined,
|
editTitle.value,
|
||||||
editDescription.value || undefined,
|
editDescription.value,
|
||||||
editFeatured.value,
|
editFeatured.value,
|
||||||
editOrder.value ?? undefined,
|
editOrder.value ?? undefined,
|
||||||
)
|
)
|
||||||
@@ -643,7 +643,7 @@ onUnmounted(() => {
|
|||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
border-radius: var(--size-rounded-card) var(--size-rounded-card) 0 0;
|
border-radius: var(--size-rounded-card) var(--size-rounded-card) 0 0;
|
||||||
|
|
||||||
min-height: 10rem;
|
aspect-ratio: 16 / 9;
|
||||||
object-fit: cover;
|
object-fit: cover;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
<Modal
|
<Modal
|
||||||
ref="patModal"
|
ref="patModal"
|
||||||
:header="
|
:header="
|
||||||
editPatIndex !== null
|
editPatId !== null
|
||||||
? formatMessage(createModalMessages.editTitle)
|
? formatMessage(createModalMessages.editTitle)
|
||||||
: formatMessage(createModalMessages.createTitle)
|
: formatMessage(createModalMessages.createTitle)
|
||||||
"
|
"
|
||||||
@@ -58,7 +58,7 @@
|
|||||||
{{ formatMessage(commonMessages.cancelButton) }}
|
{{ formatMessage(commonMessages.cancelButton) }}
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
v-if="editPatIndex !== null"
|
v-if="editPatId !== null"
|
||||||
:disabled="loading || !name || !expires"
|
:disabled="loading || !name || !expires"
|
||||||
type="button"
|
type="button"
|
||||||
class="iconified-button brand-button"
|
class="iconified-button brand-button"
|
||||||
@@ -92,7 +92,7 @@
|
|||||||
name = null
|
name = null
|
||||||
scopesVal = 0
|
scopesVal = 0
|
||||||
expires = null
|
expires = null
|
||||||
editPatIndex = null
|
editPatId = null
|
||||||
$refs.patModal.show()
|
$refs.patModal.show()
|
||||||
}
|
}
|
||||||
"
|
"
|
||||||
@@ -109,7 +109,7 @@
|
|||||||
</template>
|
</template>
|
||||||
</IntlFormatted>
|
</IntlFormatted>
|
||||||
</p>
|
</p>
|
||||||
<div v-for="(pat, index) in displayPats" :key="pat.id" class="universal-card recessed token">
|
<div v-for="pat in displayPats" :key="pat.id" class="universal-card recessed token">
|
||||||
<div>
|
<div>
|
||||||
<div>
|
<div>
|
||||||
<strong>{{ pat.name }}</strong>
|
<strong>{{ pat.name }}</strong>
|
||||||
@@ -162,7 +162,7 @@
|
|||||||
class="iconified-button raised-button"
|
class="iconified-button raised-button"
|
||||||
@click="
|
@click="
|
||||||
() => {
|
() => {
|
||||||
editPatIndex = index
|
editPatId = pat.id
|
||||||
name = pat.name
|
name = pat.name
|
||||||
scopesVal = pat.scopes
|
scopesVal = pat.scopes
|
||||||
expires = $dayjs(pat.expires).format('YYYY-MM-DD')
|
expires = $dayjs(pat.expires).format('YYYY-MM-DD')
|
||||||
@@ -316,7 +316,7 @@ const data = useNuxtApp()
|
|||||||
const { scopesToLabels } = useScopes()
|
const { scopesToLabels } = useScopes()
|
||||||
const patModal = ref()
|
const patModal = ref()
|
||||||
|
|
||||||
const editPatIndex = ref(null)
|
const editPatId = ref(null)
|
||||||
|
|
||||||
const name = ref(null)
|
const name = ref(null)
|
||||||
const scopesVal = ref(BigInt(0))
|
const scopesVal = ref(BigInt(0))
|
||||||
@@ -415,7 +415,7 @@ async function editPat() {
|
|||||||
startLoading()
|
startLoading()
|
||||||
loading.value = true
|
loading.value = true
|
||||||
try {
|
try {
|
||||||
await useBaseFetch(`pat/${pats.value[editPatIndex.value].id}`, {
|
await useBaseFetch(`pat/${editPatId.value}`, {
|
||||||
method: 'PATCH',
|
method: 'PATCH',
|
||||||
body: {
|
body: {
|
||||||
name: name.value,
|
name: name.value,
|
||||||
|
|||||||
Reference in New Issue
Block a user