Skip to content

Commit 704e274

Browse files
committed
Merge branch 'app' into app-publish
2 parents 9ab2460 + 066abd9 commit 704e274

File tree

12 files changed

+122
-18
lines changed

12 files changed

+122
-18
lines changed

Dockerfile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
FROM node:14-alpine3.15
2+
3+
WORKDIR /app
4+
5+
ENV IZNIK_API=http://apiv1.localhost \
6+
API=http://apiv1.localhost/api \
7+
IMAGE_SITE=http://apiv1.localhost
8+
9+
RUN apk update && apk add git python2 \
10+
&& git clone https://github.com/Freegle/iznik-nuxt.git
11+
12+
CMD cd iznik-nuxt \
13+
&& git pull \
14+
&& yes | npm install -y --legacy-peer-deps \
15+
&& export NODE_OPTIONS=--max-old-space-size=8192;export HOST=0; npm run dev

components/LoginModal.vue

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@
5959
<b-img src="~/static/signinbuttons/yahoo-logo.svg" class="social-button__image" />
6060
<span class="p-2 text--medium font-weight-bold">Continue with Yahoo</span>
6161
</b-btn>
62+
<p v-if="modtools" class="text-center">
63+
You can't log in to ModTools using Facebook, I'm afraid. If that's how you log in to Freegle, use email/password
64+
and trigger a lost password request.
65+
</p>
6266
<notice-message v-if="socialblocked" variant="warning">
6367
Social log in blocked - check your privacy settings, including any ad blockers such as
6468
Adblock Plus.
@@ -255,6 +259,10 @@ export default {
255259
// Use of this.bump means we will recompute when we need to, i.e. when the modal is shown. This is overriding
256260
// normal reactivity but that's because the SDKs we use aren't written in Vue.
257261
facebookDisabled() {
262+
if (process.env.IS_MTAPP) {
263+
console.log("facebookDisabled true")
264+
return true // MT app disabled
265+
}
258266
if (process.env.IS_APP) { // CC
259267
console.log("facebookDisabled false")
260268
return false // MT app enabled now

components/ModAdmin.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@
129129
<b-btn v-if="!admin.heldby" variant="warning" @click="deleteIt">
130130
<v-icon name="trash-alt" /> Delete
131131
</b-btn>
132-
<b-btn v-if="!admin.heldby" variant="white" @click="save">
132+
<b-btn v-if="!admin.heldby || admin.heldby === myid" variant="white" @click="save">
133133
<v-icon v-if="saving" name="sync" class="text-success fa-spin" />
134134
<v-icon v-else-if="saved" name="check" class="text-success" />
135135
<v-icon v-else name="save" />

components/ModLog.vue

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,14 @@
1919
<span v-if="log.user && log.byuser && log.byuser.id !== log.user.id">
2020
(added by <ModLogUser :user="log.byuser" />)
2121
</span>
22+
<span v-if="log.text">
23+
<span v-if="log.text === 'Manual'">
24+
Clicked on Join button
25+
</span>
26+
<span v-else>
27+
Joined automatically when posting/replying
28+
</span>
29+
</span>
2230
</span>
2331
<span v-else-if="log.subtype === 'Applied'">
2432
Applied to <ModLogGroup :log="log" />

components/ModMessage.vue

Lines changed: 62 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,15 @@
171171
</span>
172172
</div>
173173
<div v-if="attachments.length" class="w-100 d-flex flex-wrap">
174-
<ModPhoto v-for="attachment in attachments" :key="'attachment-' + attachment.id" :message="message" :attachment="attachment" class="d-inline pr-1" />
174+
<div v-for="attachment in attachments" :key="'attachment-' + attachment.id" :class="{'d-inline':true, 'pr-1': true, addedImage: imageAdded(attachment.id), removeImage: imageRemoved(attachment.id)}">
175+
<div class="addedMessage pl-2 font-weight-bold text-success">
176+
Added
177+
</div>
178+
<div class="removedMessage pl-2 font-weight-bold text-warning">
179+
Removed
180+
</div>
181+
<ModPhoto :message="message" :attachment="attachment" />
182+
</div>
175183
</div>
176184
<MessageReplyInfo v-if="!pending || message.replies && message.replies.length" :message="message" class="d-inline" />
177185
</div>
@@ -194,7 +202,7 @@
194202
Sender only available to mods.
195203
</NoticeMessage>
196204
<NoticeMessage v-else variant="danger">
197-
Can't identify sender. Could have been purged but probably a bug.
205+
Can't identify sender. Could have been purged but perhaps a bug.
198206
</NoticeMessage>
199207
</div>
200208
</div>
@@ -641,6 +649,36 @@ export default {
641649
this.$emit('destroy', this.message.id, this.next)
642650
},
643651
methods: {
652+
imageAdded(id) {
653+
let ret = false
654+
655+
if (this.editreview && this.message && this.message.edits) {
656+
this.message.edits.forEach(edit => {
657+
const n = edit.newimages ? JSON.parse(edit.newimages) : []
658+
const o = edit.oldimages ? JSON.parse(edit.oldimages) : []
659+
if (n.includes(id) && !o.includes(id)) {
660+
ret = true
661+
}
662+
})
663+
}
664+
665+
return ret
666+
},
667+
imageRemoved(id) {
668+
let ret = false
669+
670+
if (this.editreview && this.message && this.message.edits) {
671+
this.message.edits.forEach(edit => {
672+
const n = edit.newimages ? JSON.parse(edit.newimages) : []
673+
const o = edit.oldimages ? JSON.parse(edit.oldimages) : []
674+
if (!n.includes(id) && o.includes(id)) {
675+
ret = true
676+
}
677+
})
678+
}
679+
680+
return ret
681+
},
644682
hasCollection(coll) {
645683
let ret = false
646684
@@ -850,6 +888,7 @@ export default {
850888
@import '~bootstrap/scss/functions';
851889
@import '~bootstrap/scss/variables';
852890
@import '~bootstrap/scss/mixins/_breakpoints';
891+
@import 'color-vars';
853892
854893
.type {
855894
max-width: 150px;
@@ -873,4 +912,25 @@ export default {
873912
grid-template-columns: 1fr;
874913
}
875914
}
915+
916+
.addedMessage,
917+
.removedMessage {
918+
display: none;
919+
}
920+
921+
.addedImage {
922+
border: 1px solid $color-green--dark !important;
923+
924+
.addedMessage {
925+
display: block !important;
926+
}
927+
}
928+
929+
.removedImage {
930+
border: 1px solid $color-red--dark !important;
931+
932+
.removedMessage {
933+
display: block !important;
934+
}
935+
}
876936
</style>

components/ModRelatedMember.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,9 @@ export default {
166166
},
167167
findLongest(s1, s2) {
168168
// From https://codereview.stackexchange.com/questions/210940/find-longest-common-string-subsequence
169+
s1 = s1 + ''
170+
s2 = s2 + ''
171+
169172
const removeDistinct = (s1, s2) =>
170173
s1
171174
.split('')

components/ModSupportUser.vue

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
target="_blank"
6161
rel="noopener noreferrer"
6262
>
63-
<v-icon name="user" /> Impersonate (localhost:3000)
63+
<v-icon name="user" /> Impersonate (localhost:3002)
6464
</b-btn>
6565
<ModMergeButton class="mr-2 mb-1" />
6666
<b-btn variant="white" class="mr-2 mb-1" @click="logs">
@@ -194,6 +194,9 @@
194194
<SpinButton variant="white" name="save" label="Add Email" :handler="addEmail" />
195195
</b-input-group-append>
196196
</b-input-group>
197+
<NoticeMessage v-if="emailAddError" variant="danger" class="mt-2">
198+
{{ emailAddError }}
199+
</NoticeMessage>
197200
</div>
198201
<h3 class="mt-2">
199202
Notifications
@@ -408,7 +411,8 @@ export default {
408411
newpassword: null,
409412
newemail: null,
410413
newEmailAs: 1,
411-
addComment: false
414+
addComment: false,
415+
emailAddError: null
412416
}
413417
},
414418
computed: {
@@ -569,12 +573,18 @@ export default {
569573
}
570574
},
571575
async addEmail() {
576+
this.emailAddError = null
577+
572578
if (this.newemail) {
573-
await this.$store.dispatch('user/addEmail', {
574-
id: this.user.id,
575-
email: this.newemail,
576-
primary: parseInt(this.newEmailAs) === 1
577-
})
579+
try {
580+
await this.$store.dispatch('user/addEmail', {
581+
id: this.user.id,
582+
email: this.newemail,
583+
primary: parseInt(this.newEmailAs) === 1
584+
})
585+
} catch (e) {
586+
this.emailAddError = e.message
587+
}
578588
}
579589
},
580590
maybeExpand() {

mobile/modtools/android/config.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version='1.0' encoding='utf-8'?>
2-
<widget android-versionCode="407" id="org.ilovefreegle.modtools" version="0.3.96" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
2+
<widget android-versionCode="408" id="org.ilovefreegle.modtools" version="0.3.97" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
33
<name>ModTools</name>
44
<description>Tool to help moderators of Freegle groups</description>
55
<author email="geeks@ilovefreegle.org" href="https://ilovefreegle.org">Chris Cant, Freegle Ltd</author>

mobile/modtools/ios/config.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version='1.0' encoding='utf-8'?>
2-
<widget id="org.ilovefreegle.modtools" ios-CFBundleVersion="401" version="0.3.96" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
2+
<widget id="org.ilovefreegle.modtools" ios-CFBundleVersion="402" version="0.3.97" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
33
<name>ModTools</name>
44
<description>Tool to help moderators of Freegle and similar groups</description>
55
<author email="geeks@ilovefreegle.org" href="https://ilovefreegle.org">

nuxt.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const SENTRY_DSN = 'https://b68903e730034a4ba3b8b2358331389e@o118493.ingest.sent
88
const YAHOO_CLIENTID =
99
'dj0yJmk9N245WTRqaDd2dnA4JmQ9WVdrOWIzTlZNMU01TjJjbWNHbzlNQS0tJnM9Y29uc3VtZXJzZWNyZXQmc3Y9MCZ4PWRh'
1010
const MOBILE_VERSION = '2.0.120'
11-
const MODTOOLS_VERSION = '0.3.96'
11+
const MODTOOLS_VERSION = '0.3.97'
1212

1313
require('dotenv').config()
1414

@@ -39,7 +39,7 @@ const IZNIK_API = process.env.IZNIK_API || 'https://fdapilive.ilovefreegle.org'
3939
const USER_SITE = 'https://www.ilovefreegle.org'
4040

4141
// This is where images are served from.
42-
const IMAGE_SITE = 'https://images.ilovefreegle.org'
42+
const IMAGE_SITE = process.env.IMAGE_SITE || 'https://images.ilovefreegle.org'
4343

4444
// Long polls interact badly with per-host connection limits so send to here instead.
4545
const CHAT_HOST = 'https://users.ilovefreegle.org:555'

0 commit comments

Comments
 (0)