diff --git a/atst/domain/workspaces.py b/atst/domain/workspaces.py index 29fe6d8f..dab03302 100644 --- a/atst/domain/workspaces.py +++ b/atst/domain/workspaces.py @@ -69,52 +69,3 @@ class Workspaces(object): ) db.session.add(workspace_role) return workspace_role - - -class Members(object): - def __init__(self): - pass - - @classmethod - def create(cls, creator_id, body): - pass - - @classmethod - def get(cls, request_id): - pass - - @classmethod - def get_many(cls, workspace_id): - return [ - { - "first_name": "Danny", - "last_name": "Knight", - "email": "dknight@thenavy.mil", - "dod_id": "1257892124", - "workspace_role": "Developer", - "status": "Pending", - "num_projects": "4", - }, - { - "first_name": "Mario", - "last_name": "Hudson", - "email": "mhudson@thearmy.mil", - "dod_id": "4357892125", - "workspace_role": "CCPO", - "status": "Active", - "num_projects": "0", - }, - { - "first_name": "Louise", - "last_name": "Greer", - "email": "lgreer@theairforce.mil", - "dod_id": "7257892125", - "workspace_role": "Admin", - "status": "Pending", - "num_projects": "43", - }, - ] - - @classmethod - def update(cls, request_id, request_delta): - pass diff --git a/atst/models/workspace.py b/atst/models/workspace.py index 0b36a7b6..fd8f981e 100644 --- a/atst/models/workspace.py +++ b/atst/models/workspace.py @@ -6,6 +6,37 @@ from atst.models.types import Id from atst.models.mixins import TimestampsMixin +MOCK_MEMBERS = [ + { + "first_name": "Danny", + "last_name": "Knight", + "email": "dknight@thenavy.mil", + "dod_id": "1257892124", + "workspace_role": "Developer", + "status": "Pending", + "num_projects": "4", + }, + { + "first_name": "Mario", + "last_name": "Hudson", + "email": "mhudson@thearmy.mil", + "dod_id": "4357892125", + "workspace_role": "CCPO", + "status": "Active", + "num_projects": "0", + }, + { + "first_name": "Louise", + "last_name": "Greer", + "email": "lgreer@theairforce.mil", + "dod_id": "7257892125", + "workspace_role": "Admin", + "status": "Pending", + "num_projects": "43", + }, +] + + class Workspace(Base, TimestampsMixin): __tablename__ = "workspaces" @@ -38,3 +69,7 @@ class Workspace(Base, TimestampsMixin): @property def task_order(self): return {"number": "task-order-number"} + + @property + def members(self): + return MOCK_MEMBERS diff --git a/atst/routes/workspaces.py b/atst/routes/workspaces.py index 23ec4f7a..6b25a04d 100644 --- a/atst/routes/workspaces.py +++ b/atst/routes/workspaces.py @@ -7,7 +7,7 @@ from flask import ( url_for, ) -from atst.domain.workspaces import Workspaces, Members +from atst.domain.workspaces import Workspaces from atst.domain.projects import Projects from atst.domain.environments import Environments from atst.forms.new_project import NewProjectForm @@ -45,11 +45,7 @@ def show_workspace(workspace_id): @bp.route("/workspaces//members") def workspace_members(workspace_id): workspace = Workspaces.get(g.current_user, workspace_id) - members_repo = Members() - members = members_repo.get_many(workspace_id) - return render_template( - "workspace_members.html", workspace=workspace, members=members - ) + return render_template("workspace_members.html", workspace=workspace) @bp.route("/workspaces//reports") diff --git a/templates/workspace_members.html b/templates/workspace_members.html index 19cb340f..099e53a0 100644 --- a/templates/workspace_members.html +++ b/templates/workspace_members.html @@ -4,7 +4,7 @@ {% block workspace_content %} -{% if not members %} +{% if not workspace.members %} {{ EmptyState( 'There are currently no members in this Workspace.', @@ -58,7 +58,7 @@ - {% for m in members %} + {% for m in workspace.members %} {{ m['first_name'] }} {{ m['last_name'] }} {% if m['num_projects'] == '0' %} No Project Access {% endif %}