wmgeolab / scope

5 stars 3 forks source link

Map out API routes for workspaces - #173

Open sigaloid opened 1 year ago

sigaloid commented 1 year ago

It might be helpful for backend to have like a list of possible fetches that anything worskpace related

for example, we probably need one endpoint to get all the queries in a given workspace

sigaloid commented 1 year ago

Front end, please add on to this if necessary!

ts2002 commented 1 year ago

For rendering workspaces here is some of the information that would need to be passed back -> front for each individual workspace:

  1. ID. integer
  2. Owner. String
  3. Name. String
  4. Tags. List of strings?

We might want to talk about what exactly we want security looks like - what does it means when a user successfully joins a workspace?

ts2002 commented 1 year ago

For rendering individual workspaces, here is what is needed for each article:

  1. Article ID (int)
  2. Name (string)
  3. URL (string)

Just in general for frontend people, there is a set up for how this could be done on lines 118-135 in Results.jsx

ts2002 commented 1 year ago

The skeleton fetch requests in place right now (please feel free to add to this!)

Workspaces.jsx:

  1. getAllWorkspaces: Responsible for getting all workspaces a user can access -- theirs and others they have accessed.

Right now I have it passing in the user name of the current user in the header. I am not sure if that would be needed. Needs to return information detailed above.

  1. executeView: Responsible for someone trying to "log in" to a workspace with a workspace name and password.

Right now: I have it passing in the workspace name and password.

3.executeCreate: Responsible for sending information about a workspace someone is trying to create. Guaranteed through validation to always have a name and password set by the user.

Right now: I have it passing in the workspace name and password.

indvidualWorkspacePage.jsx: Responsible for getting the information about each articles in an individual workspace.

Right now I have it sending the workspace name and the user name (?) in the header. Needs to return information detailed above.

Results.jsx:

  1. handleGetWorkspaces: responsible for getting the list of workspaces the user has (edit) access to.

    • not sure what to put for the header/authorization yet
    • is the json object the list or will it have an attribute workspaces that is the list (like queries, which also has an attribute count for the datagrid)?
    • the data returned is used for a dropdown
  2. handleAddtoWorkspace: responsible for adding the array of selected article ids to the selected workspace (workspace-id in the url)

    • not sure what to put for the header/authorization yet

Workspaces.jsx:

  1. handleGetWorkspaces: responsible for getting the list of workspaces the user has access to. (dupe functionality of getAllWorkspaces listed above)
    • assumes (like in queries) it receives a JSON with attributes "count" and "list of workspaces", sets the corresponding "RowCount" and "Workspaces" to be used by the DataGrid
    • not sure what to put for the header/authorization yet
turtlu commented 1 year ago

GET */workspaces -> Return all workspaces Something I need to know is whether this returns JSONobj.workspaces (all workspaces) and JSONobj.count (number of workspaces) like in queries (count is used in the DataGrid), or is the JSONobj itself the array/list of all workspaces?

I don't think count is needed, so either way is fine.