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

[CMS] Everything is a Multi-lingual Topic #431

Merged
merged 49 commits into from
Feb 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
e4cfd0b
refactors db structure
jhmullen Jan 15, 2019
e030c7b
removes sections from cms and mortar route
jhmullen Jan 15, 2019
c6ca4cb
removes sections from profilebuilder
jhmullen Jan 15, 2019
f5288b8
removes sectioneditor and old profile stats
jhmullen Jan 15, 2019
5016f74
removes section from profile scaffold
jhmullen Jan 15, 2019
ac3b684
adds content tables to db
jhmullen Jan 30, 2019
bbe1a28
moves unnecessary props from story_content
jhmullen Jan 30, 2019
2aca743
updates cms/mortar routes to respect content
jhmullen Jan 30, 2019
2e81be7
removes parent_id from content tables, using regular id instead
jhmullen Jan 30, 2019
a1a7b1e
fixes associations and broken topic title content
jhmullen Jan 30, 2019
cff3519
enables textcard to accept locales and write to the proper db
jhmullen Jan 31, 2019
aee55df
adds visual split and locale dropdown to builder
jhmullen Jan 31, 2019
75c32ed
updates story and storytopic editors to match new structure
jhmullen Feb 1, 2019
b3920bd
streamlines control flow in profile editor
jhmullen Feb 1, 2019
534b98d
uses actual canon vars for dropdown, hides entire lang interface if n…
jhmullen Feb 1, 2019
55755f3
checks that an update has content before updating language table
jhmullen Feb 1, 2019
532113a
fixes ordering bug by returning correct payload for create route
jhmullen Feb 1, 2019
7c112a4
updates mortar front-end to respect locale requests
jhmullen Feb 4, 2019
f40914c
adds locale to mortareval
jhmullen Feb 4, 2019
efd3e35
splits out variables into locale-specfic blocks
jhmullen Feb 6, 2019
eeb60ab
fixes topic endpoint to respect locale
jhmullen Feb 6, 2019
71aba51
updates vizes to respect locale, performs urlswap by locale
jhmullen Feb 6, 2019
a04f978
adds localeDefault to outer Builder
jhmullen Feb 6, 2019
90b6f14
adds locale default to profile builder and editor
jhmullen Feb 6, 2019
b8713f5
adds defaults to top-level editors so we know which keys to iterate o…
jhmullen Feb 6, 2019
5c3873c
refactors routes and front-end so that defaultlang can be anything, n…
jhmullen Feb 7, 2019
10a8cd2
removes english defaults, fixes locale switching bug
jhmullen Feb 7, 2019
662f03e
fixes bug with saving stories in storyeditor
jhmullen Feb 7, 2019
d1ee5c1
removes console log
jhmullen Feb 7, 2019
f3b0422
adds locale toggle, fixes topic naming bug, fixes control flow for ed…
jhmullen Feb 7, 2019
fafddf5
fixes bug with title changes in profilebuilder
jhmullen Feb 7, 2019
a737b54
removes references to hard coded english from stories
jhmullen Feb 7, 2019
5a3f2d3
fixes bug in storytopic saving
jhmullen Feb 7, 2019
c6e9e13
fixes bug with renaming slugs in profiles
jhmullen Feb 7, 2019
c18235b
adds single lang switch
jhmullen Feb 7, 2019
612ff4a
updates to canon-core 17.4
jhmullen Feb 8, 2019
eb7dd61
fixes bugs with creating new topics
jhmullen Feb 11, 2019
d5923e5
fixes storytopic bugs and linting errors
jhmullen Feb 11, 2019
1ac6e00
adds keys to comps in generatoreditor to address react16 key-unique w…
jhmullen Feb 11, 2019
fde90fe
fixes blueprint portal nesting to inherit css properly
jhmullen Feb 11, 2019
09b1833
removes unnecessary object pruning that was causing input warning
jhmullen Feb 11, 2019
dd321c6
adds is-dirty? functionality to all cards, skipping confirm prompt if…
jhmullen Feb 11, 2019
26a725b
fixes bug where topic titles would regress when secondary locale was …
jhmullen Feb 11, 2019
2591dfb
adds framework for possible path setting, commented out
jhmullen Feb 11, 2019
60cbe1d
pulls in master
jhmullen Feb 12, 2019
daf4419
updates package lock
jhmullen Feb 12, 2019
4e3f659
updates css path in Options.jsx for bp3
jhmullen Feb 12, 2019
49542de
updates pt- prefix to bp3- on non-updated classnames
jhmullen Feb 12, 2019
2953709
adds formatter seed content to model
davelandry Feb 13, 2019
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
6 changes: 3 additions & 3 deletions packages/cms/app/components/Loading.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
top: 0;
width: 100%;
z-index: 100;
& .pt-non-ideal-state-visual {
& .bp3-non-ideal-state-visual {
max-width: 200px;
width: 100%;
& .pt-progress-meter {
& .bp3-progress-meter {
background-color: var(--accent);
}
}
& .pt-non-ideal-state-title {
& .bp3-non-ideal-state-title {
color: var(--foreground);
}
}
20 changes: 10 additions & 10 deletions packages/cms/app/pages/Profile.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import libs from "../../src/utils/libs";
class Profile extends Component {

getChildContext() {
const {formatters, profile, router} = this.props;
const {formatters, locale, profile, router} = this.props;
const {variables} = profile;
return {
formatters: formatters.reduce((acc, d) => {
Expand All @@ -18,21 +18,19 @@ class Profile extends Component {
return acc;
}, {}),
router,
variables
variables,
locale
};
}

render() {
const {sections, title} = this.props.profile;
const {topics, title} = this.props.profile;
return (
<div id="Profile">
<h1 dangerouslySetInnerHTML={{__html: title}} />
{sections.map(section => {
const {id, topics} = section;
return <div key={id}>
<h2 dangerouslySetInnerHTML={{__html: section.title}} />
{ topics.map(topic => <Topic key={topic.slug} contents={topic} />) }
</div>;
{topics.map(topic => {
const {slug} = topic;
return <Topic key={slug} contents={topic} />;
})}
</div>
);
Expand All @@ -42,16 +40,18 @@ class Profile extends Component {

Profile.childContextTypes = {
formatters: PropTypes.object,
locale: PropTypes.string,
router: PropTypes.object,
variables: PropTypes.object
};

Profile.need = [
fetchData("profile", "/api/profile/<pslug>/<pid>"),
fetchData("profile", "/api/profile/<pslug>/<pid>?locale=<i18n.locale>"),
fetchData("formatters", "/api/formatters")
];

export default connect(state => ({
formatters: state.data.formatters,
locale: state.i18n.locale,
profile: state.data.profile
}))(Profile);
10 changes: 8 additions & 2 deletions packages/cms/app/routes.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,15 @@ import Bar from "./pages/Bar";
export default function RouteCreate() {
return (
<Route path="/" component={App} history={browserHistory}>
<IndexRoute component={Search} />
<IndexRoute component={Builder} />
{/*
<Route path="/cms-profile/:profileSlug" component={Builder} />
<Route path="/cms-profile/:profileSlug/:topicSlug" component={Builder} />
<Route path="/cms-story/:storySlug" component={Builder} />
<Route path="/cms-story/:storySlug/:storytopicSlug" component={Builder} />
*/}
<Route path="/profile/:pslug/:pid" component={Profile} />
<Route path="/cms" component={Builder} />
<Route path="/search" component={Search} />
<Route path="/bar" component={Bar} />
</Route>
);
Expand Down
1 change: 1 addition & 0 deletions packages/cms/db/author_content.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require("../src/db/author_content");
1 change: 1 addition & 0 deletions packages/cms/db/profile_content.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require("../src/db/profile_content");
1 change: 0 additions & 1 deletion packages/cms/db/profile_footnote.js

This file was deleted.

1 change: 0 additions & 1 deletion packages/cms/db/profile_stat.js

This file was deleted.

1 change: 0 additions & 1 deletion packages/cms/db/section.js

This file was deleted.

1 change: 0 additions & 1 deletion packages/cms/db/section_description.js

This file was deleted.

1 change: 0 additions & 1 deletion packages/cms/db/section_subtitle.js

This file was deleted.

1 change: 1 addition & 0 deletions packages/cms/db/story_content.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require("../src/db/story_content");
1 change: 1 addition & 0 deletions packages/cms/db/story_description_content.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require("../src/db/story_description_content");
1 change: 1 addition & 0 deletions packages/cms/db/story_footnote_content.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require("../src/db/story_footnote_content");
1 change: 1 addition & 0 deletions packages/cms/db/storytopic_content.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require("../src/db/storytopic_content");
1 change: 1 addition & 0 deletions packages/cms/db/storytopic_description_content.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require("../src/db/storytopic_description_content");
1 change: 1 addition & 0 deletions packages/cms/db/storytopic_stat_content.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require("../src/db/storytopic_stat_content");
1 change: 1 addition & 0 deletions packages/cms/db/storytopic_subtitle_content.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require("../src/db/storytopic_subtitle_content");
1 change: 1 addition & 0 deletions packages/cms/db/topic_content.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require("../src/db/topic_content");
1 change: 1 addition & 0 deletions packages/cms/db/topic_description_content.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require("../src/db/topic_description_content");
1 change: 1 addition & 0 deletions packages/cms/db/topic_stat_content.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require("../src/db/topic_stat_content");
1 change: 1 addition & 0 deletions packages/cms/db/topic_subtitle_content.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require("../src/db/topic_subtitle_content");
Loading