Skip to content

Commit 7d3935a

Browse files
authored
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
1 parent a67f596 commit 7d3935a

5 files changed

Lines changed: 29 additions & 18 deletions

File tree

apps/frontend/src/layouts/default.vue

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1279,7 +1279,7 @@ const { cycle: changeTheme } = useTheme()
12791279
left: 0;
12801280
background-color: var(--color-raised-bg);
12811281
z-index: 11; // 20 = modals, 10 = svg icons
1282-
transform: translateY(100%);
1282+
transform: translateY(calc(100% + env(safe-area-inset-bottom)));
12831283
transition: transform 0.4s cubic-bezier(0.54, 0.84, 0.42, 1);
12841284
border-radius: var(--size-rounded-card) var(--size-rounded-card) 0 0;
12851285
box-shadow: 0 0 20px 2px rgba(0, 0, 0, 0);
@@ -1367,6 +1367,17 @@ const { cycle: changeTheme } = useTheme()
13671367
border-top: 2px solid rgba(0, 0, 0, 0);
13681368
box-sizing: border-box;
13691369
1370+
&::after {
1371+
content: '';
1372+
position: absolute;
1373+
bottom: 2px;
1374+
left: 0;
1375+
width: 100%;
1376+
height: 300px;
1377+
background-color: var(--color-raised-bg);
1378+
transform: translateY(100%);
1379+
}
1380+
13701381
&.expanded {
13711382
box-shadow: none;
13721383
border-radius: 0;

apps/frontend/src/pages/[type]/[id].vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2071,10 +2071,10 @@ const createGalleryItemMutation = useMutation({
20712071
file.type.split('/')[file.type.split('/').length - 1]
20722072
}&featured=${featured ?? false}`
20732073
2074-
if (title) {
2074+
if (title != null) {
20752075
url += `&title=${encodeURIComponent(title)}`
20762076
}
2077-
if (description) {
2077+
if (description != null) {
20782078
url += `&description=${encodeURIComponent(description)}`
20792079
}
20802080
if (ordering !== null && ordering !== undefined) {
@@ -2132,10 +2132,10 @@ const editGalleryItemMutation = useMutation({
21322132
mutationFn: async ({ projectId, imageUrl, title, description, featured, ordering }) => {
21332133
let url = `project/${projectId}/gallery?url=${encodeURIComponent(imageUrl)}&featured=${featured ?? false}`
21342134
2135-
if (title) {
2135+
if (title != null) {
21362136
url += `&title=${encodeURIComponent(title)}`
21372137
}
2138-
if (description) {
2138+
if (description != null) {
21392139
url += `&description=${encodeURIComponent(description)}`
21402140
}
21412141
if (ordering !== null && ordering !== undefined) {

apps/frontend/src/pages/[type]/[id]/gallery.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -484,8 +484,8 @@ async function editGalleryItem() {
484484
const imageUrl = filteredGallery.value[editIndex.value].url
485485
const success = await contextEditGalleryItem(
486486
imageUrl,
487-
editTitle.value || undefined,
488-
editDescription.value || undefined,
487+
editTitle.value,
488+
editDescription.value,
489489
editFeatured.value,
490490
editOrder.value ? Number(editOrder.value) : undefined,
491491
)
@@ -683,7 +683,7 @@ async function deleteGalleryImage() {
683683
margin-bottom: 0;
684684
border-radius: var(--size-rounded-card) var(--size-rounded-card) 0 0;
685685
686-
min-height: 10rem;
686+
aspect-ratio: 16 / 9;
687687
object-fit: cover;
688688
}
689689

apps/frontend/src/pages/[type]/[id]/settings/gallery.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -427,8 +427,8 @@ const editGalleryItem = async () => {
427427
428428
const success = await editGalleryItemMutation(
429429
filteredGallery.value[editIndex.value].url,
430-
editTitle.value || undefined,
431-
editDescription.value || undefined,
430+
editTitle.value,
431+
editDescription.value,
432432
editFeatured.value,
433433
editOrder.value ?? undefined,
434434
)
@@ -643,7 +643,7 @@ onUnmounted(() => {
643643
margin-bottom: 0;
644644
border-radius: var(--size-rounded-card) var(--size-rounded-card) 0 0;
645645
646-
min-height: 10rem;
646+
aspect-ratio: 16 / 9;
647647
object-fit: cover;
648648
}
649649

apps/frontend/src/pages/settings/pats.vue

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<Modal
1111
ref="patModal"
1212
:header="
13-
editPatIndex !== null
13+
editPatId !== null
1414
? formatMessage(createModalMessages.editTitle)
1515
: formatMessage(createModalMessages.createTitle)
1616
"
@@ -58,7 +58,7 @@
5858
{{ formatMessage(commonMessages.cancelButton) }}
5959
</button>
6060
<button
61-
v-if="editPatIndex !== null"
61+
v-if="editPatId !== null"
6262
:disabled="loading || !name || !expires"
6363
type="button"
6464
class="iconified-button brand-button"
@@ -92,7 +92,7 @@
9292
name = null
9393
scopesVal = 0
9494
expires = null
95-
editPatIndex = null
95+
editPatId = null
9696
$refs.patModal.show()
9797
}
9898
"
@@ -109,7 +109,7 @@
109109
</template>
110110
</IntlFormatted>
111111
</p>
112-
<div v-for="(pat, index) in displayPats" :key="pat.id" class="universal-card recessed token">
112+
<div v-for="pat in displayPats" :key="pat.id" class="universal-card recessed token">
113113
<div>
114114
<div>
115115
<strong>{{ pat.name }}</strong>
@@ -162,7 +162,7 @@
162162
class="iconified-button raised-button"
163163
@click="
164164
() => {
165-
editPatIndex = index
165+
editPatId = pat.id
166166
name = pat.name
167167
scopesVal = pat.scopes
168168
expires = $dayjs(pat.expires).format('YYYY-MM-DD')
@@ -316,7 +316,7 @@ const data = useNuxtApp()
316316
const { scopesToLabels } = useScopes()
317317
const patModal = ref()
318318
319-
const editPatIndex = ref(null)
319+
const editPatId = ref(null)
320320
321321
const name = ref(null)
322322
const scopesVal = ref(BigInt(0))
@@ -415,7 +415,7 @@ async function editPat() {
415415
startLoading()
416416
loading.value = true
417417
try {
418-
await useBaseFetch(`pat/${pats.value[editPatIndex.value].id}`, {
418+
await useBaseFetch(`pat/${editPatId.value}`, {
419419
method: 'PATCH',
420420
body: {
421421
name: name.value,

0 commit comments

Comments
 (0)