Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blacklist content of user #218

Open
wants to merge 21 commits into
base: develop
Choose a base branch
from
Open

Blacklist content of user #218

wants to merge 21 commits into from

Conversation

roschaefer
Copy link
Contributor

@roschaefer roschaefer commented Jul 25, 2018

close #211

@roschaefer roschaefer force-pushed the blacklist_feature branch 2 times, most recently from 76900db to b27da6b Compare August 23, 2018 14:43
import Cookie from 'cookie-universal'

const authKey = 'feathers-jwt'
const endpoint = urlHelper.buildEndpointURL(process.env.API_HOST, { port: process.env.API_PORT })
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@appinteractive help! After merging/rebasing on fix-docker-setup I'm facing the problem again, that process.env is set at build time. I cannot see a solution here. 😿

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@roschaefer
Try adding the variables you need at runtime from env in the webpack.EnvironmentPlugin like so (the second parameter is the 'default' value in case the env variable isn't set):

diff --git a/nuxt.config.js b/nuxt.config.js
index 6e88623..e4be132 100644
--- a/nuxt.config.js
+++ b/nuxt.config.js
@@ -1,5 +1,6 @@
 require('dotenv').config()
 const path = require('path')
+const webpack = require('webpack')
 
 module.exports = {
   env: {
@@ -90,6 +91,7 @@ module.exports = {
       // Mapbox-gl throws error after being uglified
       // https://github.com/mapbox/mapbox-gl-js/issues/4359
       config.module.noParse = /(mapbox-gl)\.js$/
+      config.plugins.unshift(new webpack.EnvironmentPlugin({API_HOST: 'localhost'}))
     }
   },
   plugins: [

@frankgerhardt
Copy link

What is the status of this, still WIP? Or DONE?

@appinteractive
Copy link
Member

What is the status of this, still WIP? Or DONE?

Definitely a WIP as the branch that was merged into it is also not ready for develop.

@roschaefer roschaefer force-pushed the blacklist_feature branch 4 times, most recently from 0fbd106 to 2414f0a Compare September 26, 2018 13:53
@roschaefer roschaefer force-pushed the blacklist_feature branch 3 times, most recently from 51d8030 to 82bc7a5 Compare October 8, 2018 18:25
@roschaefer roschaefer changed the title [WIP] Blacklist content of user Blacklist content of user Oct 8, 2018
@Lulalaby
Copy link
Contributor

@appinteractive ^^

Copy link
Member

@appinteractive appinteractive left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some minor things that I coughed.

@click="toggleFollow"
:disabled="follow.isPending"
:disabled="follow.isPending || this.isBlacklisted()"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dont use this inside Templates.
Also is it possible to use a computed property instead of a method?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@appinteractive I find it odd that this comment is still visible although the code has been altered a long time ago 🤔

Copy link
Member

@appinteractive appinteractive Nov 13, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to be a Microsoft Bug 😅

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤣 🤣 🤣

:disabled="isPending || isFollowing"
:isLoading="isPending"
@click="toggleBlacklist">
<template v-if="isBlacklisted()">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use computed properties

store/services/usersettings.js Show resolved Hide resolved
```
session on the server side (SSR) is not destroyed which leads to the following
scenario:

1. login as admin ([email protected])
2. logout
3. login as regular user ([email protected])
4. refresh page after you are logged in
5. see that you are logged in again as the last user (admin) instead of your
   last loggin (user)
You need to remove that session also on the server side, maybe there is a cookie
still flying around in the browser which is then send on SSR and the backend
responds with the logged in user from the token in the cookie.
```

This is not possible now, as the lazy-loading happens with `app.$api` and
not the socket.
Thus ava and jest can be used in combination
on blacklist settings. This button was requested by a couple of users.
Show it on initial request for the entire box but if you click on the
block button just rely on the block button's own loading behaviour.
@roschaefer
Copy link
Contributor Author

@appinteractive can you give me another review please?

@roschaefer
Copy link
Contributor Author

Things to fix:

  • After a reload, comments are still visible
  • Comments are replyable
  • Balcklist settings should reuse existing table components

@roschaefer
Copy link
Contributor Author

roschaefer commented Nov 12, 2018

  • comments should not be replyable
  • comments are still visible after reload
  • comments should not be votable
  • await dispatch in store
  • use computed properties when possible

Only if comment.isBlacklisted is set by the backend
@roschaefer
Copy link
Contributor Author

this PR assumes Human-Connection/API#180 has been merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Blacklist - Hide content of user
5 participants