-
Notifications
You must be signed in to change notification settings - Fork 6
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
feat: add basic page for namespaces #780
Conversation
Thanks @lorenzo-cavazzi ! I see a typo in
Other than that, looks good to me! |
fixed, thanks! (I didn't update the deployment on |
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.
Love the feature, but I have some some comments regarding the aesthetics and how it is presented.
src/namespace/Namespace.present.js
Outdated
let checking = null; | ||
if (props.user.fetching || props.group.fetching) | ||
checking = (<div> | ||
<p>We are checking if {namespace} is either a user or a group...</p> |
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.
Suggestion -- I think this can be a little simpler.
<p>Searching for {namespace}...</p>
src/namespace/Namespace.present.js
Outdated
<Container fluid> | ||
<Row> | ||
<Col> | ||
<h3>Projects for {props.namespace}</h3> |
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.
Suggestion: Say here if the namespace is a user or group.
<h3>{userOrGroup} <i>{props.namespace}</i></h3>
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 added <h3>{userOrGroup} {props.namespace}</h3>
since I tried the italics for the project name but it looked weird
src/namespace/Namespace.present.js
Outdated
|
||
const NamespaceUserActions = (props) => { | ||
return (<div> | ||
<p>We have found a user with name {props.namespace}.</p> |
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 line is unnecessary if you take the suggestion above.
src/namespace/Namespace.present.js
Outdated
return (<div> | ||
<p>We have found a user with name {props.namespace}.</p> | ||
|
||
<InfoAlert timeout={0}> |
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 don't really like the InfoAlert here. It makes the page feel more unfinished than it has to, and it makes no sense to close the InfoAlert, because then this page does not provide anything useful.
Couldn't we just do
<ul className="mb-0">
<li className="mb-1">
Browse user's <Link
className="btn btn-primary btn-sm" role="button" to={props.projectsUrl}>projects list
</Link>
</li>
<li>
Visit user's <ExternalLink url={props.gitlabUrl} size="sm" title="GitLab page" />
</li>
</ul>
And leave it at that (without the InfoAlert)?
src/namespace/Namespace.present.js
Outdated
|
||
const NamespaceGroupActions = (props) => { | ||
return (<div> | ||
<p>We have found a group with name {props.namespace}.</p> |
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.
See comments on NamespaceUserActions.
src/namespace/Namespace.present.js
Outdated
|
||
const NamespaceNotfoundActions = (props) => { | ||
return (<div> | ||
<p>We couldn't find any user nor group with name {props.namespace}.</p> |
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.
Wording:
<p>We could not find a user or group with name {props.namespace}.</p>
return (<div> | ||
<p>We couldn't find any user nor group with name {props.namespace}.</p> | ||
|
||
<InfoAlert timeout={0}> |
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 think the InfoAlert makes sense in this case, so this can be left as is.
@ciyer thanks for the suggestion, I implemented all of them apart from a minor difference (I commented on the change suggestion). I am nor sure if I prefer the version with or without |
IMHO it doesn't change too much from a usability standpoint, still seems good to me. (I do have some usability things with #771, which is only tangentially related but probably will involve updating some links here too?) |
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 like the feature in general and the code is really clean, I also like the implementation with hooks.
I think the previous reviews are fine but I still thing that there is a chance that the user end's up there and not to get user information... I think that it could be nicer to say something related to the users projects instead of just the user since we are in "/projects" and i think in the future we should make a difference between /user/username and /projects/username
You can dismiss this comment if you don' t agree with me, it's ok.
src/api-client/instance.js
Outdated
|
||
client.getUserByPath = (path) => { | ||
const headers = client.getBasicHeaders(); | ||
const queryParams = { username: encodeURIComponent(path) }; | ||
return client.clientFetch(`${client.baseUrl}/users`, { | ||
method: 'GET', | ||
headers, | ||
queryParams | ||
}) | ||
} | ||
} | ||
|
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.
Shouldn't this be in user.js ?
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 makes definitely sense, let me move it
@vfried you are right, in the future it makes sense to treat users and groups as first entity citizens and this should go under a different path. We could open another issue to keep track of that (probably an epic would me more appropriate) |
I agree with both vfried and lorenzo-cavazzi . I think the |
Users and groups are not first class citizens yet. Since users may try to reach /projects/namespaces, this PR adds useful information when hitting that route, checking for namespace existence and offering meaningful interactions to users fix #750
dc5bfec
to
3afe997
Compare
Users and groups are not first-class citizens yet. Since users may try to reach the
/projects/<namespace>
url anyway, we want to provide useful information when hitting that route.With this PR, the existence of the
<namespace>
is tested and, according to the result (user, group or non-existing), actions are suggested to the user.fix #750
Preview: https://lorenzotest.dev.renku.ch/
How to test
Try to reach a few
/projects/<namespace>
URLs, at least one for each of the 3 following types