Skip to content

Commit

Permalink
Merge branch 'app' into app-publish
Browse files Browse the repository at this point in the history
  • Loading branch information
chriscant committed Jul 29, 2023
2 parents d8b2a3c + 157a297 commit e21c9d3
Show file tree
Hide file tree
Showing 87 changed files with 564 additions and 445 deletions.
15 changes: 15 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM node:18-alpine

WORKDIR /app

ENV IZNIK_API_V1=http://apiv1/api \
IZNIK_API_V2=http://apiv2:8192/api

RUN apk update && apk add git \
&& git clone https://github.com/Freegle/iznik-nuxt3.git

CMD cd iznik-nuxt3 \
&& git pull \
&& yes | npm install -y --legacy-peer-deps \
&& export NODE_OPTIONS=--max-old-space-size=8192;npm run build \
&& npm run start
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ android {
applicationId "org.ilovefreegle.direct"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1209
versionName "3.0.7"
versionCode 1212
versionName "3.0.10"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
aaptOptions {
// Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.
Expand Down

This file was deleted.

This file was deleted.

17 changes: 17 additions & 0 deletions api/BaseAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,23 @@ export default class BaseAPI {
)
}

$postv2(path, data, logError = true) {
const authStore = useAuthStore()

return this.$requestv2(
'POST',
path,
{
headers: {
'Content-Type': 'application/json',
Authorization: 'Iznik ' + JSON.stringify(authStore.auth?.persistent),
},
data,
},
logError
)
}

$postForm(path, data, logError = true) {
// Don't set Content-Type - see https://stackoverflow.com/questions/39280438/fetch-missing-boundary-in-multipart-form-data-post
return this.$request(
Expand Down
15 changes: 4 additions & 11 deletions api/ChatAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ export default class ChatAPI extends BaseAPI {
return this.$getv2(`/chat/${chatid}/message`)
}

async listChats(since, search, logError, empty) {
async listChats(since, search, keepChat, logError) {
return await this.$getv2(
'/chat',
{
since,
search,
empty,
keepChat,
},
logError
)
Expand All @@ -33,15 +33,8 @@ export default class ChatAPI extends BaseAPI {
return this.$put('/chat/rooms', params, logError)
}

send(data) {
return this.$post('/chatmessages', data, function (data) {
if (data && data.ret === 4) {
// Don't log errors for banned users - handled elsewhere.
return false
} else {
return true
}
})
async send(data) {
return await this.$postv2('/chat/' + data.roomid + '/message', data)
}

nudge(chatid) {
Expand Down
3 changes: 2 additions & 1 deletion capacitor.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ const config: CapacitorConfig = {
},
plugins: {
PushNotifications: {
presentationOptions: ["badge", "sound", "alert"],
//presentationOptions: ["badge", "sound", "alert"],
presentationOptions: ["badge", "alert"],
},
Badge: {
"persist": true,
Expand Down
73 changes: 65 additions & 8 deletions components/AdTest.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,80 @@
can use an ad blocker. Plus you could donate to us at https://www.ilovefreegle.org/donate - if we got
enough donations we would be delighted not to show ads.
-->
<div :ref="uniqueid" class="d-flex justify-content-end pb-2">
<div :id="uniqueid" style="min-width: 300px; min-height: 250px" />
</div>
<div
v-if="square"
:id="uniqueid"
:ref="uniqueid"
class="d-flex justify-content-end pb-2 w-100"
/>
<VisibleWhen :not="['sm', 'md', 'lg', 'xl']">
<div
v-if="banner"
:id="uniqueid"
:ref="uniqueid"
class="d-flex justify-content-around pb-2 w-100"
style="width: 320px; height: 50px"
/>
</VisibleWhen>
<VisibleWhen :not="['xs', 'sm']">
<div
v-if="banner"
:id="uniqueid"
:ref="uniqueid"
class="d-none d-md-flex justify-content-around pb-2 w-100"
style="width: 728px; height: 90px"
/>
</VisibleWhen>
</template>
<script setup>
import { useMiscStore } from '../stores/misc'
import VisibleWhen from './VisibleWhen'
import { ref, onMounted, onBeforeUnmount } from '#imports'
import { waitForRef } from '~/composables/useWaitForRef'
const miscStore = useMiscStore()
const props = defineProps({
square: {
type: Boolean,
required: false,
default: false,
},
banner: {
type: Boolean,
required: false,
default: false,
},
})
// This must match what has been set up in GPT admin.
const uniqueid = ref('div-gpt-ad-1610613658342-0')
let tagId, slotId, dims
if (props.square) {
tagId = 'div-gpt-ad-1610613658342-0'
slotId = '/22794232631/freegle_test1'
dims = [300, 250]
} else if (props.banner) {
if (miscStore.breakpoint === 'xs') {
tagId = 'div-gpt-ad-1688753114006-0'
slotId = '/22794232631/freegle_test4'
dims = [320, 50]
} else if (miscStore.breakpoint === 'sm') {
tagId = 'div-gpt-ad-1688724132439-0'
slotId = '/22794232631/freegle_test3'
dims = [468, 60]
} else {
tagId = 'div-gpt-ad-1688724072018-0'
slotId = '/22794232631/freegle_test2'
dims = [728, 90]
}
}
const uniqueid = ref(tagId)
const p = new Promise((resolve, reject) => {
const already = document.getElementById('gpt-script')
if (already) {
console.log('Script already there')
resolve()
} else {
const s = document.createElement('script')
Expand All @@ -42,20 +101,18 @@ onMounted(async () => {
window.googletag = window.googletag || { cmd: [] }
window.googletag.cmd.push(function () {
slot = window.googletag
.defineSlot('/22794232631/freegle_test1', [300, 250], uniqueid.value)
.defineSlot(slotId, dims, uniqueid.value)
.addService(window.googletag.pubads())
window.googletag.pubads().enableSingleRequest()
window.googletag.enableServices()
})
window.googletag.cmd.push(function () {
window.googletag.display(uniqueid.value)
console.log('Displayed slot', uniqueid.value)
})
})
onBeforeUnmount(() => {
console.log('Destroy slot', uniqueid.value)
if (window.googletag?.destroySlots) {
window.googletag.destroySlots([slot])
}
Expand Down
1 change: 1 addition & 0 deletions components/AdaptiveMap.vue
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,7 @@ export default {
selectedGroup: 0,
context: null,
none: false,
noneFound: false,
}
},
computed: {
Expand Down
8 changes: 4 additions & 4 deletions components/ChatFooter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ export default {
},
async nudge() {
await this.waitForRef('nudgewarning')
this.$refs.nudgewarning.show()
this.$refs.nudgewarning?.show()
},
newline() {
const p = this.$refs.chatarea.selectionStart
Expand All @@ -405,7 +405,7 @@ export default {
this.showAddress = true
await this.waitForRef('addressModal')
this.$refs.addressModal.show()
this.$refs.addressModal?.show()
},
photoAdd() {
// Flag that we're uploading. This will trigger the render of the filepond instance and subsequently the
Expand Down Expand Up @@ -445,7 +445,7 @@ export default {
async showInfo() {
this.showProfile = true
await this.waitForRef('profile')
this.$refs.profile.show()
this.$refs.profile?.show()
},
async send() {
let msg = this.sendmessage
Expand Down Expand Up @@ -477,7 +477,7 @@ export default {
if (RSVP) {
this.RSVP = true
await this.waitForRef('rsvp')
this.$refs.rsvp.show()
this.$refs.rsvp?.show()
} else {
// We've sent a message. This would be a good time to do some microvolunteering.
this.showMicrovolunteering = true
Expand Down
15 changes: 10 additions & 5 deletions components/ChatHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,12 @@
:chatid="chat.id"
@confirm="hide"
/>
<ProfileModal v-if="showProfile" :id="otheruser.id" ref="profile" />
<ProfileModal
v-if="showProfile"
:id="otheruser.id"
ref="profile"
close-on-message
/>
</div>
<ChatHideModal
v-if="
Expand Down Expand Up @@ -341,22 +346,22 @@ export default {
async showhide() {
this.showChatHide = true
await this.waitForRef('chathide')
this.$refs.chathide.show()
this.$refs.chathide?.show()
},
async showblock() {
this.showChatBlock = true
await this.waitForRef('chatblock')
this.$refs.chatblock.show()
this.$refs.chatblock?.show()
},
async showInfo() {
this.showProfile = true
await this.waitForRef('profile')
this.$refs.profile.show()
this.$refs.profile?.show()
},
async report() {
this.showChatReport = true
await this.waitForRef('chatreport')
this.$refs.chatreport.show()
this.$refs.chatreport?.show()
},
async markRead() {
await this.chatStore.markRead(this.id)
Expand Down
2 changes: 1 addition & 1 deletion components/ChatMessageDateRead.vue
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ export default {
async viewOriginal() {
this.showOriginal = true
await this.waitForRef('original')
this.$refs.original.show()
this.$refs.original?.show()
},
},
}
Expand Down
2 changes: 1 addition & 1 deletion components/ChatMessageInterested.vue
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ export default {
this.showPromise = true
await this.waitForRef('promiseModal')
this.$refs.promiseModal.show()
this.$refs.promiseModal?.show()
},
async outcome(type, e) {
if (e) {
Expand Down
4 changes: 2 additions & 2 deletions components/ChatMessagePromised.vue
Original file line number Diff line number Diff line change
Expand Up @@ -294,13 +294,13 @@ export default {
async unpromise() {
this.showRenege = true
await this.waitForRef('renege')
this.$refs.renege.show()
this.$refs.renege?.show()
fetchOurOffers()
},
async changeTime() {
this.showPromise = true
await this.waitForRef('promise')
this.$refs.promise.show()
this.$refs.promise?.show()
},
fetchMessages() {
this.chatStore.fetchMessages(this.chatmessage.chatid)
Expand Down
1 change: 1 addition & 0 deletions components/ChatRSVPModal.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<template>
<b-modal
v-if="user"
id="chatrsvpmodal"
v-model="showModal"
:title="chaseup ? 'Shall we chase them up?' : 'Do you expect a reply?'"
Expand Down
2 changes: 1 addition & 1 deletion components/CommunityEvent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ export default {
async showEventModal() {
this.showModal = true
await this.waitForRef('eventmodal')
this.$refs.eventmodal.show()
this.$refs.eventmodal?.show()
},
},
}
Expand Down
2 changes: 1 addition & 1 deletion components/CommunityFeature.vue
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ const modal = ref(null)
const showModal = async () => {
showAdd.value = true
await waitForRef(modal.value)
modal.value.show()
modal.value?.show()
}
</script>
<style scoped lang="scss">
Expand Down
Loading

0 comments on commit e21c9d3

Please sign in to comment.