Skip to content

Commit e1c7689

Browse files
author
Peter Jaros
committed
Projects page has an Add Project button
1 parent 6e439dd commit e1c7689

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

src-cljs/frontend/components/app.cljs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@
4646
{:build build/page
4747
:project-settings project-settings/page
4848
:project-insights project-insights/page
49-
:add-projects add-projects/page}
49+
:add-projects add-projects/page
50+
:projects projects/page}
5051
;; Old-World dominant component functions which need to be wrapped in the `main` template.
5152
;; As we migrate these, we'll move them into the map above.
5253
(into {}
@@ -56,7 +57,6 @@
5657
:invite-teammates invites/teammates-invites
5758
:org-settings org-settings/org-settings
5859
:account account/account
59-
:projects projects/page
6060

6161
:admin-settings admin/admin-settings
6262
:build-state admin/build-state

src-cljs/frontend/components/pages/projects.cljs

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
[frontend.components.pieces.org-picker :as org-picker]
55
[frontend.routes :as routes]
66
[frontend.utils.vcs-url :as vcs-url]
7-
[om.core :as om :include-macros true])
7+
[om.core :as om :include-macros true]
8+
[frontend.components.templates.main :as main-template])
89
(:require-macros [frontend.utils :refer [html]]))
910

1011
(defn- table [projects owner]
@@ -37,7 +38,7 @@
3738
[:organization/by-vcs-type-and-name
3839
[(:vcs_type org) (:login org)]])
3940

40-
(defn page [app owner]
41+
(defn- main-content [app owner]
4142
(reify
4243
om/IInitState
4344
(init-state [_]
@@ -93,3 +94,15 @@
9394
(if (:projects selected-org)
9495
(om/build table (:projects selected-org))
9596
[:div.loading-spinner common/spinner])])]])))))
97+
98+
(defn page [app owner]
99+
(reify
100+
om/IRender
101+
(render [_]
102+
(om/build main-template/template
103+
{:app app
104+
:main-content (om/build main-content app)
105+
:header-actions (html
106+
[:a.btn.btn-primary
107+
{:href (routes/v1-add-projects)}
108+
"Add Project"])}))))

0 commit comments

Comments
 (0)