Skip to content

Commit d62f908

Browse files
Merge branch 'dev' of github.com:mapswipe/python-mapswipe-workers into dev
2 parents 66f93fe + 5905ea5 commit d62f908

File tree

3 files changed

+26
-1
lines changed

3 files changed

+26
-1
lines changed

docs/source/configuration.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,14 @@ The python-mapswipe workers use a bunch of services provided by Google Cloud Pla
2020
* set API restrictions > Restrict Key > Identity Toolkit API and Cloud Functions API
2121
4. Also make sure to configure the API keys for the App side here.
2222

23+
Then set up a Service Account Key file:
24+
1. Open [Google Cloud Service Accounts](https://console.cloud.google.com/iam-admin/serviceaccounts)
25+
2. Create a new Service Account Key file:
26+
* set name (e.g. *dev-mapswipe-workers*)
27+
* add roles, (e.g. `Storage Admin` and `Firebase Admin`) or use pre-defined role instead (e.g. `Custom Firebase Developer`)
28+
3. Download Key as file:
29+
* select `.json` and save
30+
2331
## Firebase
2432
Firebase is a central part of MapSwipe. In our setup we use *Firebase Database*, *Firebase Database Rules* and *Firebase Functions*. In the documentation we will refer to two elements:
2533
1. `your_project_id`: This is the name of your Firebase project (e.g. *dev-mapswipe*)

manager_dashboard/manager_dashboard/js/project-management.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ function getProjects(status) {
8585
btn.innerHTML = "Activate"
8686
} else if (data.val().status == "active") {
8787
btn.innerHTML = "Deactivate"
88+
} else if (data.val().status == "new") {
89+
btn.innerHTML = "Activate"
8890
}
8991
td.appendChild(btn)
9092
tr.appendChild(td)
@@ -131,6 +133,11 @@ function updateIsFeatured(projectId, newStatus) {
131133
}
132134

133135
function updateTableView() {
136+
var newProjects = document.getElementById("new-projects")
137+
while (newProjects.firstChild) {
138+
newProjects.removeChild(newProjects.firstChild);
139+
}
140+
134141
var inactiveProjects = document.getElementById("inactive-projects")
135142
while (inactiveProjects.firstChild) {
136143
inactiveProjects.removeChild(inactiveProjects.firstChild);
@@ -141,6 +148,7 @@ function updateTableView() {
141148
activeProjects.removeChild(activeProjects.firstChild);
142149
}
143150

151+
getProjects("new")
144152
getProjects("active")
145153
getProjects("inactive")
146154
}
@@ -157,6 +165,10 @@ function changeProjectStatus() {
157165
console.log("current status: inactive")
158166
updateStatus(this.id, "active")
159167
console.log("new status: active")
168+
} else if (this.classList.contains("status-new")) {
169+
console.log("current status: new")
170+
updateStatus(this.id, "active")
171+
console.log("new status: active")
160172
}
161173
updateTableView()
162174
}
@@ -177,5 +189,6 @@ function changeProjectIsFeatured() {
177189
}
178190

179191

192+
getProjects("new")
180193
getProjects("active")
181194
getProjects("inactive")

manager_dashboard/manager_dashboard/manage.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,11 @@ <h3>Please <a href="index.html">log in</a> first.</h3>
6666
<!-- manage existing projects -->
6767
<div class="row justify-content-center" id="project-management" style="display: block">
6868
<div class="col-md-12">
69-
<h2>Active Projects</h2>
69+
<h2>New Projects</h2>
70+
<div id="new-projects">
71+
<div id="new-projects-table"></div>
72+
</div>
73+
<h2>Active Projects</h2>
7074
<div id="active-projects">
7175
<div id="active-projects-table"></div>
7276
</div>

0 commit comments

Comments
 (0)