Skip to content
This repository has been archived by the owner on Jul 12, 2023. It is now read-only.

Create empty page for user import. #539

Merged
merged 9 commits into from
Sep 16, 2020
Merged

Conversation

whaught
Copy link
Contributor

@whaught whaught commented Sep 14, 2020

Issue #517

Proposed Changes

  • Create empty pages for user import
  • Fix up users page card, put in an import button
  • Fix a few back-links
    users

importplaceholder

@google-cla google-cla bot added the cla: yes Auto: added by CLA bot when all committers have signed a CLA. label Sep 14, 2020
@@ -20,7 +20,7 @@ <h1>Realm stats</h1>
The data below shows realm statistics.
</p>

<div class="card mb-3 shadow-sm">
<div class="card mb-3 shadow-sm" style="min-width:950px;">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be a follow-up, but it'd be good to make this a class.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually I think I've fixed it. we have table-responsive which (on purpose) is for tables that should scroll as the div around them collapses. To your point, I think that is weird (especially on mobile), so I've just removed that and it seems to display properly.

We might want to remove responsive tables elsewhere too

cmd/server/assets/users/index.html Show resolved Hide resolved
cmd/server/assets/users/index.html Outdated Show resolved Hide resolved
cmd/server/assets/users/index.html Outdated Show resolved Hide resolved
cmd/server/assets/users/index.html Outdated Show resolved Hide resolved
cmd/server/assets/users/index.html Outdated Show resolved Hide resolved
</a>
</tbody>
</table>
{{if .pages}}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We shouldn't do it in this PR, but I wonder if this makes sense to be a function of the renderer instead? Then the HTML just becomes:

{{ paginate $pages }}

and the renderer builds this HTML. Then we can make it portable across any pages that need pagination.

@@ -311,6 +311,7 @@ func realMain(ctx context.Context) error {
userSub.Handle("", userController.HandleIndex()).Queries("offset", "{[0-9]*?}").Methods("GET")
userSub.Handle("", userController.HandleCreate()).Methods("POST")
userSub.Handle("/new", userController.HandleCreate()).Methods("GET")
userSub.Handle("/import", userController.HandleImport()).Methods("GET")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you'll want to handle GET and POST here, then switch inside the function to determine whether you want to render the form or process the input.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll add that in the PR that implements the import functionality for-reals

Copy link
Member

@sethvargo sethvargo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
/hold

Feel free to remove the hold when you want to merge

@google-oss-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sethvargo, whaught

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@whaught
Copy link
Contributor Author

whaught commented Sep 16, 2020

/unhold

@google-oss-robot google-oss-robot merged commit 67b12ea into google:main Sep 16, 2020
@whaught whaught deleted the bulkimport branch September 16, 2020 21:30
@google google locked and limited conversation to collaborators Oct 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes Auto: added by CLA bot when all committers have signed a CLA.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants