Skip to content

Commit 3c39cfc

Browse files
authored
Merge branch 'proxy' into server-migration
2 parents d734f8c + d3df955 commit 3c39cfc

File tree

13 files changed

+67
-44
lines changed

13 files changed

+67
-44
lines changed

public/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<!-- built files will be auto injected -->
1717
<script id="config-remote" async>
1818
window.configScript = document.createElement('script')
19-
window.configScript.src = '<%= process.env.VUE_APP_BACKEND_URL%>/config.js'
19+
window.configScript.src = '<%= process.env.VUE_APP_BACKEND_URL || "$VUE_APP_BACKEND_URL"%>/config.js'
2020
window.configScript.type = 'text/javascript'
2121

2222
// Try to append config from backend

src/api/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export const $axios = axios.create({
1111
})
1212
export const $axios2 = axios.create({
1313
baseURL: process.env.VUE_APP_BACKEND_URL || config.VUE_APP_BACKEND_URL,
14-
timeout: 3000,
14+
timeout: 15000,
1515
crossDomain: true
1616
})
1717

@@ -208,7 +208,7 @@ export const usersApi = {
208208
memberSearch: params => $http('/api/search/users', { params }),
209209
lookup: (username, params) => $http(`/api/users/lookup/${username}`, { params }),
210210
update: (userId, data) => $http(`/api/users/${userId}`, { method: 'PUT', data }),
211-
find: username => $http2(`/api/users/${username}`),
211+
find: id => $http2(`/api/users/byid?id=${id}`),
212212
delete: userId => $http(`/api/users/${userId}`, { method: 'DELETE' }),
213213
deactivate: userId => $http(`/api/users/${userId}/deactivate`, { method: 'POST' }),
214214
reactivate: userId => $http(`/api/users/${userId}/reactivate`, { method: 'POST' }),

src/components/layout/HeaderComponent.vue

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,15 @@
8484
<!-- Login Section -->
8585
<ul class="signed-out" v-if="!loggedIn">
8686
<li>
87-
<a href="" @click.prevent="showRegister = true">REGISTER</a>
87+
<!-- <a href="" @click.prevent="showRegister = true" disabled="true">REGISTER</a> -->
88+
<span>REGISTER</span>
8889
</li>
8990
<li>
90-
<a href="" id="login-link" @click.prevent="showLogin = true">LOGIN</a>
91+
<!-- <a href="" id="login-link" @click.prevent="showLogin = true" disabled="true">LOGIN</a> -->
92+
<span>LOGIN</span>
93+
</li>
94+
<li>
95+
<a href="https://forms.clickup.com/57751/f/1rcq-791/HNWSBPWCDSRMDMS9TF" target="_blank">REPORT A BUG</a>
9196
</li>
9297
</ul>
9398

@@ -659,11 +664,16 @@ header {
659664
cursor: pointer;
660665
}
661666
&.signed-out li { padding-left: 1.25rem; }
662-
&.signed-out li a {
667+
&.signed-out li a, &.signed-out li span {
663668
display: table-cell;
664669
height: inherit;
665670
vertical-align: middle;
666671
}
672+
li span {
673+
cursor: not-allowed;
674+
color: $secondary-font-color;
675+
font-size: $header-login-font-size;
676+
}
667677
li a {
668678
color: $header-login-font-color;
669679
font-size: $header-login-font-size;

src/components/threads/RecentThreads.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
<router-link v-if="thread?.board" class="thread-board" :title="decode(thread.board.name)" :to="{ name: 'Threads', params: { boardSlug: thread.board.slug } }" onclick="event.stopPropagation()"><span v-html="decode(thread.board.name)"></span></router-link>
5353
by
5454
<span v-if="thread.deleted">deleted</span>
55-
<router-link onclick="event.stopPropagation()" v-if="!thread.deleted" :to="{ path: '/profile/' + thread?.user?.username.toLowerCase() }">{{thread?.user?.username}}</router-link>
55+
<router-link onclick="event.stopPropagation()" v-if="!thread.deleted" :to="{ path: '/profile/' + thread?.user?.username.toLowerCase(), query: { id: thread?.user?.id } }">{{thread?.user?.username}}</router-link>
5656
</div>
5757
<div class="last-reply">
5858
<div>{{humanDate(thread?.post?.created_at)}}</div>

src/components/users/RankDisplay.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ export default {
1616
const init = u => {
1717
const rankMap = u.metadata.ranks
1818
const metricToRankMaps = u.metadata.rank_metric_maps
19-
let ranks = Object.keys(metricToRankMaps).reduce((mappedRanks, metricName) => {
19+
if (metricToRankMaps) {
20+
let ranks = Object.keys(metricToRankMaps).reduce((mappedRanks, metricName) => {
2021
let rank = -1
2122
for (let i = 0; i < metricToRankMaps[metricName].length; i++) {
2223
if (u[metricName] >= metricToRankMaps[metricName][i]) rank = i
@@ -31,6 +32,7 @@ export default {
3132
3233
if (lowestRankNumber >= 0) v.userRank = rankMap[lowestRankNumber].name
3334
else v.userRank = ''
35+
} else v.userRank = ''
3436
}
3537
3638
init(v.user)

src/components/users/UserPosts.vue

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ export default {
115115
next(vm => {
116116
const params = {
117117
username: to.params.username,
118+
id: to.query.id,
118119
limit: localStoragePrefs().data.posts_per_page,
119120
page: to.query.page || 1,
120121
field: to.query.field,
@@ -131,6 +132,7 @@ export default {
131132
beforeRouteUpdate(to, from, next) {
132133
const params = {
133134
username: to.params.username,
135+
id: to.query.id,
134136
limit: localStoragePrefs().data.posts_per_page,
135137
page: to.query.page || 1,
136138
field: to.query.field,
@@ -158,6 +160,7 @@ export default {
158160
const refresh = () => {
159161
const params = {
160162
username: $route.params.username,
163+
id: $route.query.id,
161164
limit: v.prefs.posts_per_page,
162165
page: $route.query.page || 1,
163166
field: $route.query.field,
@@ -169,8 +172,8 @@ export default {
169172
170173
const toggleThreads = threads => {
171174
const params = { ...$route.params, saveScrollPos: true }
172-
if (threads) $router.replace({ name: $route.name, params: params, query: { threads }})
173-
else $router.replace({ name: $route.name, params: params })
175+
if (threads) $router.replace({ name: $route.name, params: params, query: { threads: threads, id: $route.query.id }})
176+
else $router.replace({ name: $route.name, params: params, query: { id: $route.query.id }})
174177
v.threads = threads
175178
}
176179

src/composables/stores/prefs.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ const AUTH_KEY = 'auth'
88

99
const appCache = localStorageCache(0, 'app')
1010
const emtpyPrefs = {
11-
posts_per_page: 25,
12-
threads_per_page: 25,
11+
posts_per_page: 10,
12+
threads_per_page: 10,
1313
timezone_offset: {
1414
sign: '',
1515
hours: '',

src/composables/utils/boardUtils.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ const buildLastPostData = data => {
66
last_post_created_at: data.last_post_created_at,
77
last_post_position: data.last_post_position,
88
last_post_username: data.last_post_username,
9+
last_post_user_id: data.last_post_user_id,
910
last_post_avatar: data.last_post_avatar,
1011
last_thread_id: data.last_thread_id,
1112
last_thread_slug: data.last_thread_slug,

src/views/Boards.vue

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33
<recent-threads v-if="boardData && boardData.data && boardData.data.threads" :threads="boardData.data.threads"></recent-threads>
44

55
<div v-if="!loggedIn" class="dashboard-actions">
6-
<a href="" class="button" @click.prevent="showRegister = true">Create an Account</a>
7-
<a href="" class="button" @click.prevent="showLogin = true">Log In</a>
6+
<!-- <a href="" class="button" @click.prevent="showRegister = true">Create an Account</a> -->
7+
<a href="" class="button disabled" @click.stop.prevent="">Create an Account</a>
8+
<!-- <a href="" class="button" @click.prevent="showLogin = true">Log In</a> -->
9+
<a href="" class="button disabled" @click.stop.prevent="">Log In</a>
810
</div>
911
<div v-if="loggedIn" class="dashboard-actions">
1012
<router-link :to="{ name: 'Watchlist' }" class="button">Watchlist</router-link>
@@ -67,7 +69,7 @@
6769
<div v-if="board.last_post_username">
6870
<span v-if="board.user_deleted || board.post_deleted">deleted</span>
6971
<img v-if="!board.user_deleted && !board.post_deleted" class="avatar-small" :class="defaultAvatarShape" :src="board.last_post_avatar || defaultAvatar" @error="$event.target.src=defaultAvatar" />
70-
<router-link v-if="!board.user_deleted && !board.post_deleted" :to="{ path: '/profile/' + board.last_post_username.toLowerCase() }">{{board.last_post_username}}</router-link> posted in
72+
<router-link v-if="!board.user_deleted && !board.post_deleted" :to="{ path: '/profile/' + board.last_post_username.toLowerCase(), query: { id: board.last_post_user_id }}">{{board.last_post_username}}</router-link> posted in
7173
<span v-if="board.last_thread_title">
7274
<router-link :to="{ name: 'Posts', params: { threadSlug: board.last_thread_slug }, query: { start: board.last_post_position} }">
7375
<span v-html="board.last_thread_title"></span>
@@ -350,6 +352,7 @@ img.avatar-small {
350352
margin: 0 1rem;
351353
min-width: 160px;
352354
&:last-child { margin-left: 0; }
355+
&.disabled { cursor: not-allowed; }
353356
}
354357
355358
@include break-mobile-sm {

src/views/Posts.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,19 +123,19 @@
123123
<div v-if="!post._deleted && !post.user.ignored" class="post-block-grid">
124124
<!-- Post Profile Section -->
125125
<div class="post-user">
126-
<router-link :to="{ path: '/profile/' + post.user.username.toLowerCase() }">
126+
<router-link :to="{ path: '/profile/' + post.user.username.toLowerCase(), query: { id: post.user.id }}">
127127
<div class="user-avatar" :class="defaultAvatarShape">
128128
<span v-if="post.user.online" class="online green" :data-balloon="post.user.username + ' is online'">
129129
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48">
130130
<title></title>
131131
<circle cx="24" cy="24" r="16" />
132132
</svg>
133133
</span>
134-
<router-link :to="{ path: '/profile/' + post.user.username.toLowerCase() }">
134+
<router-link :to="{ path: '/profile/' + post.user.username.toLowerCase(), query: { id: post.user.id } }">
135135
<img :src="post.avatar || defaultAvatar" @error="$event.target.src=defaultAvatar" />
136136
</router-link>
137137
</div>
138-
<router-link class="hide-mobile" :to="{ path: '/profile/' + post.user.username.toLowerCase() }">
138+
<router-link :to="{ path: '/profile/' + post.user.username.toLowerCase(), query: { id: post.user.id } }" class="hide-mobile">
139139
<div class="original-poster" v-if="post.user.original_poster">OP</div>
140140
<div v-if="post.user.title" :title="('Title: ' + post.user.title)" class="user-activity"><span class="user-activity-value">{{post.user.title}}</span></div>
141141
<div v-if="post.user.merit > -1" :title="('Merit: ' + post.user.merit)" class="user-activity">Merit: <span class="user-activity-value">{{post.user.merit}}</span></div>
@@ -166,7 +166,7 @@
166166
</div>
167167
<div :title="post.user.role_name || 'user'" class="user-role" :style="userRoleHighlight(post.user.highlight_color)">{{post.user.role_name || 'user'}}</div>
168168
</div>
169-
<router-link :to="{ path: '/profile/' + post.user.username.toLowerCase() }" class="user-activity-mobile">
169+
<router-link :to="{ path: '/profile/' + post.user.username.toLowerCase(), query: { id: post.user.id } }" class="user-activity-mobile">
170170
<div class="original-poster" v-if="post.user.original_poster">OP</div>
171171
<div v-if="post.user.title" :title="('Title: ' + post.user.title)" class="user-activity"><span class="user-activity-value">{{post.user.title}}</span></div>
172172
<div v-if="post.user.merit > -1" :title="('Merit: ' + post.user.merit)" class="user-activity">Merit: <span class="user-activity-value">{{post.user.merit}}</span></div>
@@ -188,7 +188,7 @@
188188
<!-- Post Title -->
189189
<div class="hide-mobile post-title">
190190
<div class="post-title-user">
191-
<span class="username" :data-balloon="post.user.role_name || 'User'"><router-link :to="{ path: '/profile/' + post.user.username.toLowerCase() }">
191+
<span class="username" :data-balloon="post.user.role_name || 'User'"><router-link :to="{ path: '/profile/' + post.user.username.toLowerCase(), query: { id: post.user.id } }">
192192
<span v-html="post.user.username"></span>
193193
</router-link></span>
194194
<div :title="post.user.name" v-if="post.user.name" class="display-name">

0 commit comments

Comments
 (0)