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

UI: Add allocation directory rendering #5873

Merged
merged 104 commits into from
Jul 2, 2019

Conversation

backspace
Copy link
Contributor

@backspace backspace commented Jun 21, 2019

a GIF showing the navigation of an allocation filesystem

You can try it out with this direct link to the deployment preview.

@backspace backspace changed the base branch from f-ui/alloc-fs to master June 21, 2019 21:51
@backspace
Copy link
Contributor Author

backspace commented Jun 21, 2019

I changed the base branch to master and now there’s a Netlify deploy 😐 sooooo that’s annoying. I haven’t gotten a response yet but I’ll follow up to ask if there’s a workaround.

ETA the Netlify deploy won’t work to check out this work because there’s no Mirage response for it yet.

This doesn’t work in every instance; sometimes when I refresh
there’s a failure. I’ll have to tune the models created to
eliminate these occasional problems.
@backspace backspace changed the base branch from master to f-ui/alloc-fs June 24, 2019 14:17
@backspace backspace changed the title Add allocation directory rendering UI: Add allocation directory rendering Jun 24, 2019
@backspace backspace marked this pull request as ready for review June 28, 2019 15:38
const statusIs500 = response.status === 500;
const bodyIncludes404Text = body.includes('no such file or directory');

const translatedCode = statusIs500 && bodyIncludes404Text ? 404 : response.status;
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’m awaiting feedback on whether 500-as-404 works similarly across platforms, so this may not be quite ready, but everything else is apart from the custom Mirage scenario that I can remove later.

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 changed this to a TODO as I think it’s fine to leave in for now and return to if the API changes.

@backspace backspace requested review from DingoEatingFuzz and a team June 28, 2019 17:05
Copy link
Contributor

@DingoEatingFuzz DingoEatingFuzz left a comment

Choose a reason for hiding this comment

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

This is gonna be awesome!! 🤩

Generally speaking, this is great work. I had a lot of nits, but all the big stuff is good and in place.

Also apologies for being such a stickler when it comes to CSS, but that's the only way to keep that stuff under control, you know?

import FSRoute from './fs';

export default FSRoute.extend({
templateName: 'allocations/allocation/task/fs',
Copy link
Contributor

Choose a reason for hiding this comment

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

It personally trips me up when there is a route that has no template due to something like this, but I'm willing to try it out.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah, I don’t love it either 😐

ui/app/routes/allocations/allocation/task/fs.js Outdated Show resolved Hide resolved
return {
path: decodedPath,
task,
isFile: true,
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you think it's worth adding a directoryEntries: [] here just to ensure that the controller prop is always an array?

I'm on the fence about it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hmm… I don’t really even like this giant-conditional-in-the-template situation but I feel like isFile adequately protects against any attempt to iterate through directoryEntries. I’d be fine adding it though if you think it’s helpful!

Copy link
Contributor

Choose a reason for hiding this comment

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

Nah, no need.

ui/app/styles/components/allocation-fs.scss Outdated Show resolved Hide resolved

assert.equal(FS.breadcrumbs.length, 1);
assert.ok(FS.breadcrumbs[0].isActive);
assert.equal(FS.breadcrumbs[0].text, 'task-name');
Copy link
Contributor

Choose a reason for hiding this comment

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

A pretty clear downside to the data-in-the-mirage-handler approach is that you can't reach into the mirage db to get the task-name value out.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

agreed. Hard-coding irks me somewhat but feels okay to me for this minimal case. It’s still possible to convert to a more ORMy setup if you think that’s important though!

ui/tests/acceptance/task-fs-test.js Outdated Show resolved Hide resolved
ui/tests/acceptance/task-fs-test.js Show resolved Hide resolved
ui/tests/pages/allocations/task/fs.js Show resolved Hide resolved
ui/app/templates/components/fs-directory-entry.hbs Outdated Show resolved Hide resolved
@backspace
Copy link
Contributor Author

I appreciate the nits, especially with CSS, which definitely needs a firm hand 😆

I think I’ve addressed your suggestions etc.

Copy link
Contributor

@DingoEatingFuzz DingoEatingFuzz left a comment

Choose a reason for hiding this comment

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

Looks good! :shipit:

I'm still not sure how I feel about the fixtures for the fs endpoints, but no need to delay on that. Maybe I'll have stronger feelings after I write my own fs tests.

@backspace
Copy link
Contributor Author

I’ll leave the Mirage scenario FIXMEs when merging, as they’ll still be useful for other PRs and can be removed before the feature branch is merged.

I noticed that the breadcrumb indentation is off now, as related to the first column of the table:
image

I’ll address that in a separate PR.

@backspace backspace merged commit ee07bab into f-ui/alloc-fs Jul 2, 2019
@backspace backspace deleted the f-ui/alloc-fs-directories branch July 2, 2019 21:42
@github-actions
Copy link

github-actions bot commented Feb 7, 2023

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants