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

[GSoC19] Articles improvements #7

Open
wants to merge 15 commits into
base: articles
Choose a base branch
from
Open

Conversation

shubhsherl
Copy link
Owner

@shubhsherl shubhsherl commented Jul 17, 2019

This PR adds:

  • some code improvements.
  • Article icon to redirect to users public view of the article.
  • message Action to open room by id.

ff9eea8
NOTE: This PR contains commits from all the PRs, merge this after reviewing all the PRs.

@shubhsherl shubhsherl changed the title Articles tests Articles imrovements Jul 17, 2019
@shubhsherl shubhsherl changed the title Articles imrovements Articles improvements Jul 17, 2019
@shubhsherl shubhsherl changed the title Articles improvements [GSoC19] Articles improvements Jul 17, 2019
@kb0304
Copy link
Collaborator

kb0304 commented Jul 22, 2019

Can we remove the files articles/index.js and the directory articles/client as they are not being used as of now?

@kb0304
Copy link
Collaborator

kb0304 commented Jul 22, 2019

Can you please add i18n key-values corresponding to all the settings etc which you've used, at-least in English?

import { settings } from '../../settings';

const defaults = {
enable: false,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why is it kept inside a dict, and the dict a separate variable as we just this value at one place and directly? Can we directly use this value instead?

public: true,
});

this.add('Article_Site_title', 'Rocket.Chat', {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Article_Site_title > Article_Site_Title


Meteor.startup(() => {
settings.addGroup('Articles', function() {
this.add('Articles_enabled', defaults.enable, {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Articles_enabled > Articles_Enabled , here and in enableQuery below

public: true,
});

this.add('Articles_admin_panel', 'Articles_admin_panel', {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Articles_admin_panel > Articles_Admin_Panel
Also, if we can add some description for this and others above, it would be nice.

@@ -108,3 +108,4 @@ import '../app/ui-cached-collection';
import '../app/action-links';
import '../app/reactions/client';
import '../app/livechat/client';
import '../app/articles/client';
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we remove it as we are not using it?

@@ -111,6 +111,24 @@ export const getActions = ({ user, directActions, hideAdminControls }) => {
},
},

{
icon: 'articles',
Copy link
Collaborator

Choose a reason for hiding this comment

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

UX question, should we show this button is user's account is not on ghost?

Copy link
Collaborator

Choose a reason for hiding this comment

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

If we do this, and store and maintain a state in user objects > ghostAccountExists,,.. then this can simply be a link and the corresponding meteor method is not required.

@@ -33,7 +33,7 @@ const mentionMessage = (rid, { _id, username, name }, message_embedded) => {
return Messages.insert(welcomeMessage);
};

const create = ({ prid, pmid, t_name, reply, users }) => {
const create = ({ prid, pmid, t_name, reply, t, users }) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Discuss with the team and re-evaluate, weather to implement comments this way.
(allowing public child of a private parent room)


const api = new API();

export const triggerHandler = new class ArticlesSettingsHandler {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Refactor it to use ghostClient

enableCors: true,
apiPath: 'ghooks/',
auth: {
user() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Add rate-limiting, to prevent brute force

Copy link
Owner Author

Choose a reason for hiding this comment

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

Integrations also don't have any rate-limit, should I add it here. 🤔

import { settings } from '../../../settings';
import * as Models from '../../../models';

const Api = new Restivus({
Copy link
Collaborator

Choose a reason for hiding this comment

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

Note: Revisit the security

Copy link
Owner Author

Choose a reason for hiding this comment

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

Apart from token checking, what else I have to check?

@shubhsherl
Copy link
Owner Author

Changed as requested. @kb0304

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