Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#10969] Search form for audit logs page #11006

Merged

Conversation

t-cheepeng
Copy link
Contributor

@t-cheepeng t-cheepeng commented Mar 4, 2021

Part of #10969

Outline of solution

Current Page
image

@t-cheepeng t-cheepeng added the s.ToReview The PR is waiting for review(s) label Mar 4, 2021
Comment on lines 42 to 64
<div class="col-5">
<div class="col-12">
<label for="course-id-dropdown">Course ID</label>
</div>
<div class="col-12">
<select id="course-id-dropdown" class="form-control col-6" [(ngModel)]="formModel.courseId">
<option *ngFor="let course of courses">
{{course.courseId}}
</option>
</select>
</div>
</div>
<div class="col-6">
<div class="col-12">
<label for="student-name-input">Student Name (Optional)</label>
</div>
<div class="col-12">
<input id="student-name-input" class="form-control col-6" type="text" [(ngModel)]="formModel.studentName" placeholder="Student Name"/>
</div>
</div>
<div class="col-1">
<button class="btn btn-primary mt-4" (click)="search()">Search</button>
</div>
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a way to align these with the row above? Currently the 5/6/1 column split in the bottom row looks a bit off compared to the 6/6 in the top row

Copy link
Contributor

@halfwhole halfwhole left a comment

Choose a reason for hiding this comment

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

LGTM

@AdithyaNarayan
Copy link
Contributor

Do we need to also add a Feedback Session Name dropdown that is generated after the Course ID is chosen?

@t-cheepeng
Copy link
Contributor Author

Do we need to also add a Feedback Session Name dropdown that is generated after the Course ID is chosen?

I think the plan is to fetch the logs for the whole of the courseid. possibly include the advanced filtering in a future PR

Copy link
Contributor

@AdithyaNarayan AdithyaNarayan left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@madanalogy madanalogy left a comment

Choose a reason for hiding this comment

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

UI looks good, just some comments below

@@ -0,0 +1,73 @@
<h1>Student Activity Logs</h1>
<p>This page allows you to find when your students have accessed or submitted a particular feedback session.</p>
Copy link
Contributor

Choose a reason for hiding this comment

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

Are there plans to include filtering based on feedback session after selecting / filling in the course ID? If yes, then you might want to include a skeleton template for that. If no, then maybe reword this prompt to include "for a given course"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will reword it

* Search for logs of student activity
*/
search(): void {
// TODO: Call endpoint to retrieve logs
Copy link
Contributor

Choose a reason for hiding this comment

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

Might be more worthwhile to have this PR on hold until the API endpoint and data formats are finalised

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The endpoint return type is specified in #10978 but should not really matter for this PR since the PR only deals with the search form for now

</div>
<div class="col-12">
<select id="course-id-dropdown" class="form-control col-6" [(ngModel)]="formModel.courseId">
<option *ngFor="let course of courses">
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure how this would work out for instructors with lots of courses. Any possibility of having the courses sorted by date or allowing filtering based on text input? Or is that already a built in function of the select field?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

How about sort by alphabetical order? I would think that most instructors don't really have that many courses that the dropdown will impede the UX?

Copy link
Contributor

Choose a reason for hiding this comment

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

I would think that most instructors don't really have that many courses that the dropdown will impede the UX?

Best to check UI/UX matters with @damithc

@damithc
Copy link
Contributor

damithc commented Mar 13, 2021

Regrading the UI:
Better term for Logs from? e.g., Search period: from, until
The drop-down for the time is too wide?
I'm interested to see how the search results will be displayed.

On a separate note, is the backend capable of searching the full period within the 1-minute window given to each request?

@t-cheepeng
Copy link
Contributor Author

@damithc
Have shortened the time picker and bolded/changed the form names. Is the search form okay?
image

I'm interested to see how the search results will be displayed.

That should be coming in a separate PR from this, but shouldn't look too dissimilar from the wireframe

On a separate note, is the backend capable of searching the full period within the 1-minute window given to each request?

From some preliminary testing on the staging server, retrieving 2000 log entries without filtering (about 2 days worth) from request logs took about 1 minute. With more conditions on the retrieval, the period of time searched for can be longer. But it is unlikely that we are able to stay below 1 minute beyond 5 days worth of logs (from a rough estimate). Will need more testing on this

@damithc
Copy link
Contributor

damithc commented Mar 14, 2021

Have shortened the time picker and bolded/changed the form names. Is the search form okay?

It's better now. Note that layout (i.e., alignment, spacing) can be used to convey additional information about the meaning of the fields.
image
The current layout suggests two main groups of inputs but that grouping is not aligned with the actual meaning of the inputs.
Also, the submit button is a bit out of place.

From some preliminary testing on the staging server, retrieving 2000 log entries without filtering (about 2 days worth) from request logs took about 1 minute. With more conditions on the retrieval, the period of time searched for can be longer. But it is unlikely that we are able to stay below 1 minute beyond 5 days worth of logs (from a rough estimate). Will need more testing on this

Got it. That means the output could be up to a certain end time which is earlier than the actual end time specified by the user. The UI for the results should indicate that clearly.

@t-cheepeng
Copy link
Contributor Author

@damithc
Two different groupings shown below. Which one would be clearer?

Grouping 1:
image

Grouping 2:
Screenshot 2021-03-15 111246

@damithc
Copy link
Contributor

damithc commented Mar 15, 2021

Two different groupings shown below. Which one would be clearer?

Of these two, I prefer the latter. You can also get some ideas from the form used to create a session.

  • If you think it is more natural for the user to choose the course first, that should be on the left half.
  • Is the user expected to enter the student name exactly as it is in the database? that's not very realistic. Perhaps it should be a dropdown instead?

@t-cheepeng
Copy link
Contributor Author

@damithc Swapped the course id and student to the left side. definitely makes more sense there. Also, the student is a dropdown now
image

@damithc
Copy link
Contributor

damithc commented Mar 16, 2021

@damithc Swapped the course id and student to the left side. definitely makes more sense there. Also, the student is a dropdown now
image

Looks good enough to me. 👍

@t-cheepeng t-cheepeng requested review from madanalogy and removed request for madanalogy March 19, 2021 03:57
Copy link
Contributor

@rrtheonlyone rrtheonlyone left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@rrtheonlyone rrtheonlyone merged commit cfedb58 into TEAMMATES:audit-logs Mar 21, 2021
madanalogy pushed a commit that referenced this pull request Mar 22, 2021
* Add routing to audit logs page

* Add search form for audit logs page

* Restructure form for search button

* Reword message and add sort for courses

* Restructure form and change input to dropdown
halfwhole pushed a commit that referenced this pull request Mar 30, 2021
* Add routing to audit logs page

* Add search form for audit logs page

* Restructure form for search button

* Reword message and add sort for courses

* Restructure form and change input to dropdown
wkurniawan07 pushed a commit that referenced this pull request Mar 30, 2021
* Add routing to audit logs page

* Add search form for audit logs page

* Restructure form for search button

* Reword message and add sort for courses

* Restructure form and change input to dropdown
madanalogy pushed a commit that referenced this pull request Apr 5, 2021
* Add routing to audit logs page

* Add search form for audit logs page

* Restructure form for search button

* Reword message and add sort for courses

* Restructure form and change input to dropdown
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
s.ToReview The PR is waiting for review(s)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants