-
Notifications
You must be signed in to change notification settings - Fork 20
Conversation
Well this is what we have so far @luap42 |
Reviewing this now. I think the seed script is nice, but we'll need some "set up a community" script later, when we come closer to deploying it live. |
Something more complete, yes. Also pull since I added category handling |
f32cbcd
to
e7c7468
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fine now. Running the tests and then this should be ready for merge.
src/WebApp/Pages/Questions.cshtml
Outdated
|
||
<div class="grid has-margin-4"> | ||
<div class="grid--cell is-flexible"> | ||
<h1 class="has-margin-0">Q&A posts</h1> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Q&A posts sounds strange. Here should be the category name and/or the post type. So something like "Questions" or "Main Questions".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I fixed this by adding to the query result the category but ideally I should have an area/component/whatever that does this separately from the questions query like some community data.
Also added a short explanation below the category name.
<div class="grid--cell is-flexible">
<h1 class="has-margin-0">@Model.Result.Category.DisplayName Questions</h1>
<h3>@Model.Result.Category.ShortExplanation</h3>
</div>
Running the tests fails with this message:
|
Updated to handle categories |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is mostly a syntax/style review, rather than techniques. Couple of minor changes, but mostly good to go.
src/Application/Questions/Queries/QuestionsQuery/QuestionsQuery.cs
Outdated
Show resolved
Hide resolved
src/WebApp/Pages/Questions.cshtml
Outdated
</div> | ||
</div> | ||
<div class="button-list is-gutterless has-margin-top-4 has-float-right"> | ||
<a asp-page="questions" asp-route-sort="@QuestionsQuerySortType.Best" class="button is-muted is-outlined @(query.Sort == QuestionsQuerySortType.Best?"is-active":"")">best</a> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're missing some spacing in the ternary expression in the class
attribute here (and likewise in the next two lines).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could've been something like:
@foreach (var sortType in (QuestionsQuerySortType[]) Enum.GetValues(typeof(QuestionsQuerySortType)))
{
<a asp-page="questions" asp-route-sort="@sortType" class="button is-muted is-outlined @(query.Sort == sortType ? "is-active" : "")">@sortType</a>
}
But for now just formatted the condition
@@ -124,5 +133,137 @@ private void ApplyDatabaseMigrations(IApplicationBuilder app, ILogger logger) | |||
} | |||
} | |||
} | |||
|
|||
private void SeedDatabase(IApplicationBuilder app, ILogger logger) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DB seed should probably be split off into a separate file/task at some point. Not one for this PR, though.
* Utilities to handle dates | ||
*/ | ||
function utcDateTimeToLocalDisplay(date) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have we got Babel preprocessing set up yet? If not, we should make that a priority. If we do, this file should be reviewed and updated to ES6 - notably, const
and () => { }
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not yet basically. Keeping it ES3 so far
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works for now. Just bear in mind that the longer it takes to get it set up, the more JS there'll be to rewrite when it's ready :)
@misha130 please merge develop into this PR and resolve the conflicts, theb we can merge this PR. |
Ok done |
Pull Request summary
Link to Project Card/Issue
#78
Pull Request Tasklist
develop
branch