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

Add an organisation Talk page #5415

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Generalise projectSection
Update the projectSection helper to include organisations. Update main Talk page and recent comments to use projectSection.
eatyourgreens committed Aug 27, 2022
commit 4d8643663dcbedc1c5abf4f53cec419ae894b578
4 changes: 2 additions & 2 deletions app/pages/organization/talk/index.jsx
Original file line number Diff line number Diff line change
@@ -2,14 +2,14 @@ import React from 'react';
import { Helmet } from 'react-helmet';
import { Link } from 'react-router';
import counterpart from 'counterpart';
import projectSection from '../../../talk/lib/project-section'
import TalkBreadcrumbs from '../../../talk/breadcrumbs';
import TalkSearchInput from '../../../talk/search-input';
import TalkFootnote from '../../../talk/footnote';

export default function OrgTalkPage(props) {
const { organization, user } = props;
const section = `org-${organization.id}`;
const project = organization
const section = projectSection(organization);
const pageTitle = `${organization.display_name} » ${counterpart('orgTalk.title')}`;
return (
<div className="project-text-content talk project">
6 changes: 5 additions & 1 deletion app/talk/lib/project-section.coffee
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# takes in a project id and returns a correctly formatted talk section for that project

module.exports = (project) -> "project-#{project.id}"
module.exports = (project) ->
type = project._type._name
switch type
when 'organizations' then "org-#{project.id}"
when 'projects' then "project-#{project.id}"
3 changes: 2 additions & 1 deletion app/talk/recents.cjsx
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@ Comment = require './comment'
apiClient = require 'panoptes-client/lib/api-client'
talkClient = require 'panoptes-client/lib/talk-client'
Paginator = require './lib/paginator'
projectSection = require './lib/project-section'
updateQueryParams = require './lib/update-query-params'
Loading = require('../components/loading-indicator').default
talkConfig = require './config'
@@ -52,7 +53,7 @@ module.exports = createReactClass
if @props.params.board
params.board_id = @props.params.board if @props.params.board
else if @props.project
params.section = "project-#{ @props.project.id }"
params.section = projectSection(@props.project)
else
params.section = 'zooniverse'
params