Skip to content

Commit

Permalink
Adjust nomenclature for CMS content (#275)
Browse files Browse the repository at this point in the history
Moves Teaser typing to global scale, as Teasers can be relative and used by any page and context. Continue to cast Teasers as SimpleProjects within the context of the Projects feature
  • Loading branch information
amaisano authored Nov 19, 2019
1 parent 65ef755 commit 3b5be55
Show file tree
Hide file tree
Showing 14 changed files with 14 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export interface SimpleProject {
export interface Teaser {
date: string;
id: number;
image: Image | null;
Expand Down
4 changes: 2 additions & 2 deletions apps/site/assets/ts/projects/__tests__/BannerTest.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import React from "react";
import renderer from "react-test-renderer";
import { mount } from "enzyme";
import { createReactRoot } from "../../app/helpers/testUtils";
import { SimpleProject } from "../components/__projects";
import { Teaser as Project } from "../../__cms";
import Banner, { cmsRouteToClass } from "../components/Banner";

const bannerTeaser: SimpleProject = {
const bannerTeaser: Project = {
title: "Better Bus Project",
text:
"Too many of our bus routes still fail to live up to our own standards. Through the Better Bus Project, we are changing that.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from "react";
import renderer from "react-test-renderer";
import { mount } from "enzyme";
import { createReactRoot } from "../../app/helpers/testUtils";
import { SimpleProject as Project } from "../components/__projects";
import { Teaser as Project } from "../../__cms";
import MoreProjectsTable, {
tableHeaderText
} from "../components/MoreProjectsTable";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react";
import renderer from "react-test-renderer";
import { SimpleProject as Project } from "../components/__projects";
import { Teaser as Project } from "../../__cms";
import { createReactRoot } from "../../app/helpers/testUtils";
import ProjectUpdateList from "../components/ProjectUpdateList";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react";
import renderer from "react-test-renderer";
import { createReactRoot } from "../../app/helpers/testUtils";
import { SimpleProject as Project } from "../components/__projects";
import { Teaser as Project } from "../../__cms";
import ProjectsPage, {
fetchMoreProjects,
updateSelectedMode
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from "react";
import renderer from "react-test-renderer";
import { createReactRoot } from "../../app/helpers/testUtils";
import { SimpleProject as Project } from "../components/__projects";
import SubwayFilter from "../components/SubwayFilter";

import {
Expand Down
2 changes: 1 addition & 1 deletion apps/site/assets/ts/projects/components/Banner.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { ReactElement } from "react";
import { SimpleProject as Project, Route } from "./__projects";
import { Teaser as Project, Route } from "../../__cms";
import { formattedDate } from "../../helpers/date";
import { routeToCSSClass } from "../../helpers/css";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { ReactElement } from "react";
import RoutePillList from "./RoutePillList";
import { SimpleProject as Project } from "./__projects";
import { Teaser as Project } from "../../__cms";
import { formattedDate } from "../../helpers/date";

interface Props {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { ReactElement } from "react";
import { SimpleProject as Project } from "./__projects";
import { Teaser as Project } from "../../__cms";
import FeaturedProjectsRow from "./FeaturedProjectsRow";

interface Props {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { ReactElement } from "react";
import { SimpleProject as Project } from "./__projects";
import { Teaser as Project } from "../../__cms";
import FeaturedProject from "./FeaturedProject";

interface Props {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { ReactElement } from "react";
import { isSilverLine } from "../../helpers/silver-line";
import formattedDate from "../../helpers/date";
import { SimpleProject as Project, Route } from "./__projects";
import { Teaser as Project, Route } from "../../__cms";
import RouteIcon from "./RouteIcon";

interface Props extends Project {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { ReactElement } from "react";
import { SimpleProject as Project } from "./__projects";
import { Teaser as Project } from "../../__cms";
import formattedDate from "../../helpers/date";
import RoutePillList from "./RoutePillList";

Expand Down
2 changes: 1 addition & 1 deletion apps/site/assets/ts/projects/components/ProjectsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import FilterAndSearch from "./FilterAndSearch";
import MoreProjectsTable from "./MoreProjectsTable";
import ProjectUpdateList from "./ProjectUpdateList";
import { Mode } from "../../__v3api";
import { SimpleProject as Project } from "./__projects";
import { Teaser as Project } from "../../__cms";

interface Props {
initialBanner: Project | null;
Expand Down
2 changes: 1 addition & 1 deletion apps/site/assets/ts/projects/components/RoutePillList.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { ReactElement } from "react";
import RouteIcon from "./RouteIcon";
import RoutePill from "./RoutePill";
import { Route } from "./__projects";
import { Route } from "../../__cms";
import { isSilverLine } from "../../helpers/silver-line";

interface Props {
Expand Down

0 comments on commit 3b5be55

Please sign in to comment.