Skip to content

Commit

Permalink
lMerge branch 'app' into app-publish
Browse files Browse the repository at this point in the history
  • Loading branch information
chriscant committed Oct 11, 2023
2 parents ad5c2df + c4ebf91 commit 7384617
Show file tree
Hide file tree
Showing 13 changed files with 110 additions and 44 deletions.
14 changes: 14 additions & 0 deletions components/ChatMessageInterested.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
<div class="chatMessage forcebreak chatMessage__owner">
<div v-if="chatmessage.userid != myid">
<ChatMessageSummary v-if="refmsg" :message="refmsg" class="mt-1 mb-2" />
<div v-if="modtools">
<b-button variant="white" :to="modtoolsLink">
View message on ModTools
</b-button>
</div>
<div>
<!-- eslint-disable-next-line -->
<span v-if="(chatmessage.secondsago < 60) || (chatmessage.id > chat.lastmsgseen)" class="prewrap font-weight-bold" v-html="emessage" />
Expand Down Expand Up @@ -113,6 +118,15 @@ export default {
}
return ret
},
modtoolsLink() {
if (!this.modtools || !this.refmsg || !this.refmsg.id) {
return null
}
const url = '/modtools/message/' + this.refmsg.id
return url
}
},
methods: {
Expand Down
10 changes: 5 additions & 5 deletions components/LoginModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@
<p v-if="signUp" class="font-weight-bold">
Using one of these buttons is the easiest way to create an account:
</p>
<b-btn class="social-button social-button--facebook" :disabled="facebookDisabled" @click="loginFacebook">
<!--b-btn class="social-button social-button--facebook" :disabled="facebookDisabled" @click="loginFacebook">
<b-img src="~/static/signinbuttons/facebook-logo.png" class="social-button__image" />
<span class="p-2 text--medium font-weight-bold">Continue with Facebook</span>
</b-btn>
</b-btn-->
<b-btn v-if="isiOSapp" class="social-button social-button--apple" :disabled="appleDisabled" @click="loginApple">
<b-img src="~/static/signinbuttons/Apple_logo_white.svg" class="social-button__image" style="padding: 0px;" />
<span class="p-2 social-button__text font-weight-bold">Sign in with Apple</span>
Expand All @@ -59,10 +59,10 @@
<b-img src="~/static/signinbuttons/yahoo-logo.svg" class="social-button__image" />
<span class="p-2 text--medium font-weight-bold">Continue with Yahoo</span>
</b-btn>
<p v-if="modtools" class="text-center">
<!--p v-if="modtools" class="text-center">
You can't log in to ModTools using Facebook, I'm afraid. If that's how you log in to Freegle, use email/password
and trigger a lost password request.
</p>
</p--->
<notice-message v-if="socialblocked" variant="warning">
Social log in blocked - check your privacy settings, including any ad blockers such as
Adblock Plus.
Expand Down Expand Up @@ -890,7 +890,7 @@ export default {
}
Vue.use(VueFB, {
appId: process.env.FACEBOOK_APPID,
// appId: process.env.FACEBOOK_APPID,
autoLogAppEvents: true,
xfbml: true,
version: 'v4.0'
Expand Down
4 changes: 2 additions & 2 deletions components/MessageHistory.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@
Approved by {{ group.approvedby.displayname }}
</span>
</div>
<div v-if="modinfo && message.groups && message.groups.length && message.groups[0].arrival !== message.date" class="small">
<div v-if="modinfo && message.postings && message.postings.length && message.postings[0].date !== message.date" class="small">
<span v-if="!today">
First posted on {{ message.groups[0].namedisplay }} on {{ datetime(message.date) }}
First posted on {{ message.postings[0].namedisplay }} on {{ datetime(message.postings[0].date) }}
</span>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion components/ModGroupPostVisibility.vue
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ export default {
const CGA = this.CGA
if (CGA) {
return turfbuffer(CGA, this.scale, { units: 'meters' })
return turfbuffer(CGA, this.scale, 'meters')
} else {
return null
}
Expand Down
32 changes: 28 additions & 4 deletions components/ModMember.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@
<b-card bg-variant="white" no-body>
<b-card-header class="d-flex justify-content-between flex-wrap">
<div>
<!-- eslint-disable-next-line -->
<v-icon name="envelope" /> <ExternalLink :href="'mailto:' + email">{{ email }}</ExternalLink>
<div v-if="isLJ">
LoveJunk user #{{ user.ljuserid }}
</div>
<div v-else>
<!-- eslint-disable-next-line -->
<v-icon name="envelope" /> <ExternalLink :href="'mailto:' + email">{{ email }}</ExternalLink>
</div>
</div>
<div>
<ProfileImage :image="member.profile.turl" class="ml-1 mb-1 inline" is-thumbnail size="sm" />
Expand Down Expand Up @@ -112,7 +117,7 @@
</div>
</div>
</div>
<div v-if="user && user.id && !isTN">
<div v-if="user && user.id && !isTN && !isLJ">
<hr>
<div class="d-flex justify-content-between flex-wrap">
<OurToggle
Expand Down Expand Up @@ -165,6 +170,15 @@
color="#61AE24"
@change="changeNewsletter"
/>
<OurToggle
v-model="autorepost"
:height="30"
:width="200"
:font-size="14"
:sync="true"
:labels="{checked: 'Autorepost On', unchecked: 'Autorepost Off'}"
color="#61AE24"
/>
</div>
</div>
</b-card-body>
Expand Down Expand Up @@ -315,7 +329,6 @@ export default {
if (this.user) {
if (this.user.emails) {
this.user.emails.forEach(e => {
console.log('Check email', e.email)
if (e.email && e.email.indexOf('@user.trashnothing.com') !== -1) {
ret = true
}
Expand All @@ -325,6 +338,9 @@ export default {
return ret
},
isLJ() {
return this.user && this.user.ljuserid
},
settings() {
if (this.user && this.user.settings && this.user.settings) {
return this.user.settings
Expand Down Expand Up @@ -364,6 +380,14 @@ export default {
set(newval) {
this.user.newslettersallowed = newval
}
},
autorepost: {
get() {
return (
this.member && !this.isTN && Boolean(!this.member.autorepostsdisable)
)
},
setnewval() {}
}
},
mounted() {
Expand Down
2 changes: 1 addition & 1 deletion components/ModMessage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@
</div>
</div>
<div class="d-flex justify-content-between flex-wrap">
<b-btn variant="link" @click="toggleMail">
<b-btn v-if="message.fromuser && !message.fromuser.ljuserid && !message.fromuser.tnuserid" variant="link" @click="toggleMail">
<span v-if="showMailSettings">
<v-icon name="cog" />
<span class="d-inline d-sm-none">
Expand Down
47 changes: 32 additions & 15 deletions components/ModSupportListGroups.vue
Original file line number Diff line number Diff line change
Expand Up @@ -246,24 +246,41 @@ export default {
)
},
autoApproves(hotInstance, td, row, column, prop, value, cellProperties) {
let auto = parseInt(value)
// We don't want to highlight the colour for unpublished groups, because they're not actually causing any
// issues.
const publish = cellProperties.instance.getDataAtRow(row)[7]
if (auto > 50) {
td.style.backgroundColor = 'orange'
}
if (publish) {
let auto = parseInt(value)
auto = Math.abs(auto)
if (auto > 50) {
td.style.backgroundColor = 'orange'
}
Handsontable.renderers.NumericRenderer.call(
this,
hotInstance,
td,
row,
column,
prop,
auto,
cellProperties
)
auto = Math.abs(auto)
Handsontable.renderers.NumericRenderer.call(
this,
hotInstance,
td,
row,
column,
prop,
auto,
cellProperties
)
} else {
Handsontable.renderers.TextRenderer.call(
this,
hotInstance,
td,
row,
column,
prop,
'-',
cellProperties
)
}
},
forceDate(hotInstance, td, row, column, prop, value, cellProperties) {
let val = '-'
Expand Down
2 changes: 1 addition & 1 deletion mobile/modtools/android/config.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<widget android-versionCode="409" id="org.ilovefreegle.modtools" version="0.3.98" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<widget android-versionCode="410" id="org.ilovefreegle.modtools" version="0.3.99" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>ModTools</name>
<description>Tool to help moderators of Freegle groups</description>
<author email="[email protected]" href="https://ilovefreegle.org">Chris Cant, Freegle Ltd</author>
Expand Down
2 changes: 1 addition & 1 deletion mobile/modtools/ios/config.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<widget id="org.ilovefreegle.modtools" ios-CFBundleVersion="403" version="0.3.98" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<widget id="org.ilovefreegle.modtools" ios-CFBundleVersion="404" version="0.3.99" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>ModTools</name>
<description>Tool to help moderators of Freegle and similar groups</description>
<author email="[email protected]" href="https://ilovefreegle.org">
Expand Down
24 changes: 12 additions & 12 deletions nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import Sentry from '@nuxtjs/sentry'
import { Dedupe as DedupeIntegration } from '@sentry/integrations'
import sitemap from './utils/sitemap.js'

const FACEBOOK_APPID = '134980666550322'
// const FACEBOOK_APPID = '134980666550322'
const SENTRY_DSN = 'https://[email protected]/4504362603184128' // Cordova
const YAHOO_CLIENTID =
'dj0yJmk9N245WTRqaDd2dnA4JmQ9WVdrOWIzTlZNMU01TjJjbWNHbzlNQS0tJnM9Y29uc3VtZXJzZWNyZXQmc3Y9MCZ4PWRh'
const MOBILE_VERSION = '2.0.120'
const MODTOOLS_VERSION = '0.3.98'
const MODTOOLS_VERSION = '0.3.99'

require('dotenv').config()

Expand Down Expand Up @@ -85,10 +85,10 @@ const config = {
{ hid: 'author', name: 'author', content: 'Freegle' },
{ name: 'supported-color-schemes', content: 'light' },
{ name: 'color-scheme', content: 'light' },
{
name: 'facebook-domain-verification',
content: 'zld0jt8mvf06rt1c3fnxvls3zntxj6'
},
// {
// name: 'facebook-domain-verification',
// content: 'zld0jt8mvf06rt1c3fnxvls3zntxj6'
// },
{ hid: 'og:type', property: 'og:type', content: 'website' },
{
hid: 'description',
Expand Down Expand Up @@ -120,14 +120,14 @@ const config = {
property: 'og:url',
content: 'https://www.ilovefreegle.org'
},
{ hid: 'fb:app_id', property: 'fb:app_id', content: FACEBOOK_APPID },
// { hid: 'fb:app_id', property: 'fb:app_id', content: FACEBOOK_APPID },
{
hid: 'og:description',
property: 'og:description',
content:
"Give and get stuff for free in your local community. Don't just recycle - reuse, freecycle and freegle!"
},
{ hid: 'fb:app_id', property: 'og:site_name', content: FACEBOOK_APPID },
// { hid: 'fb:app_id', property: 'og:site_name', content: FACEBOOK_APPID },

{
hid: 'twitter:title',
Expand Down Expand Up @@ -164,8 +164,8 @@ const config = {
{ rel: 'preconnect', href: 'https://www.youtube.com' },
{ rel: 'preconnect', href: 'https://fonts.gstatic.com' },
{ rel: 'preconnect', href: 'https://storage.googleapis.com' },
{ rel: 'preconnect', href: 'https://www.facebook.com' },
{ rel: 'preconnect', href: 'https://connect.facebook.com' },
// { rel: 'preconnect', href: 'https://www.facebook.com' },
// { rel: 'preconnect', href: 'https://connect.facebook.com' },
{ rel: 'preconnect', href: 'https://apis.google.com' }
]
},
Expand Down Expand Up @@ -220,7 +220,7 @@ const config = {
{ src: '~/plugins/vue-lazy-youtube-video', ssr: false },
{ src: '~/plugins/inspectlet', ssr: false },
{ src: '~/plugins/app-init-push.js', mode: 'client' },
{ src: '~/plugins/app-facebook.js', mode: 'client' },
// { src: '~/plugins/app-facebook.js', mode: 'client' },
{ src: '~/plugins/app-google.js', mode: 'client' },
{ src: '~/plugins/app-yahoo.js', mode: 'client' },
{ src: '~/plugins/app-apple.js', mode: 'client' },
Expand Down Expand Up @@ -658,7 +658,7 @@ const config = {
CHAT_HOST: CHAT_HOST,
OSM_TILE: OSM_TILE,
GEOCODE: GEOCODE,
FACEBOOK_APPID: FACEBOOK_APPID,
// FACEBOOK_APPID: FACEBOOK_APPID,
YAHOO_CLIENTID: YAHOO_CLIENTID,
GOOGLE_MAPS_KEY: 'AIzaSyCdTSJKGWJUOx2pq1Y0f5in5g4kKAO5dgg',
GOOGLE_API_KEY: 'AIzaSyArVxoX781qdcbmQZi1PKHX-qa0bPbboH4',
Expand Down
11 changes: 11 additions & 0 deletions pages/index.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
<template>
<div v-if="!me" class="grid m-0 pl-1 pr-1 pl-sm-0 pr-sm-0 mt-0 mt-lg-5 ml-2 mr-2">
<div v-if="isMTApp">
<div id="serverloader" class="bg-white">
<b-img src="~/static/loader.gif" alt="Loading..." />
</div>
</div>
<div v-else>
<client-only>
<Visible :not="['xs']" class="map justify-content-start flex-column d-flex">
<VisualiseMap v-if="type === 'Map'" class="shadow flex-grow-1" />
Expand Down Expand Up @@ -57,6 +63,7 @@
</a>
</div>
<main-footer class="thefooter" />
</div>
</div>
</template>
<script>
Expand All @@ -73,6 +80,7 @@ export default {
MainFooter
},
layout: 'modtools',
data: function() {
return {
userWatch: null,
Expand Down Expand Up @@ -131,6 +139,9 @@ export default {
computed: {
isApp() {
return process.env.IS_APP
},
isMTApp() {
return process.env.IS_MTAPP
}
},
beforeDestroy() {
Expand Down
2 changes: 1 addition & 1 deletion plugins/app-facebook.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const CordovaOauthRedirectURL = 'https://www.facebook.com/connect/login_success.

class openFB {
constructor() {
this.fbAppId = process.env.FACEBOOK_APPID
// this.fbAppId = process.env.FACEBOOK_APPID
this.tokenStore = window.sessionStorage // or could be window.localStorage
this.loginCallback = false
this.loginWindow = false
Expand Down
2 changes: 1 addition & 1 deletion plugins/facebook-sdk.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ VueFB.install = function install(Vue, options) {
}

Vue.use(VueFB, {
appId: process.env.FACEBOOK_APPID,
// appId: process.env.FACEBOOK_APPID,
autoLogAppEvents: true,
xfbml: true,
version: 'v4.0'
Expand Down

0 comments on commit 7384617

Please sign in to comment.