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

Correctly use and display user's name and projects #435

Merged
merged 12 commits into from
Mar 14, 2017

Conversation

benjamingeer
Copy link

@benjamingeer benjamingeer commented Feb 28, 2017

User-visible changes in SALSAH:

  • Display the user's first and last name instead of their username.
  • Allow the user to select the active project.

Internal changes:

  • Include details of the user's projects in userProfile, instead of just the project IRIs.
  • Have SALSAH get userProfile on login, rather than just userData, and store it.
  • Remove userData from API responses, since SALSAH no longer needs it.

Note: To get the GUI tests to work, I had to change them so the user is logged in at the beginning of each test, and logged out at the end of each test. Otherwise reloading the page seemed to make SALSAH forget that the user was logged in. I had this problem only with Selenium, not in real life.

Fixes #118.
Fixes #415.

@benjamingeer benjamingeer changed the title Display user’s real name in Salsah Fix display of user's name and projects Mar 1, 2017
@benjamingeer benjamingeer changed the title Fix display of user's name and projects Correctly use and display user's name and projects Mar 1, 2017
Copy link
Contributor

@tobiasschweizer tobiasschweizer left a comment

Choose a reason for hiding this comment

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

Hell yeah, I like the multiuser!

Could you possibly add a test to ResoureCreationSpec that logs in as the multisuer and creates resources in two different projects by changing another project after the first resource creation?

/**
* The current user's data
*/
userdata:userdata;
Copy link
Contributor

Choose a reason for hiding this comment

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

Did you also mean to remove the whole interface userdata?

Copy link
Author

Choose a reason for hiding this comment

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

Now I've moved it to sessionResponseFormats.ts, which has the whole login response format. There's a sample in sampleLoginResponse.ts.

@benjamingeer
Copy link
Author

I found a nice service that generates TypeScript interfaces from sample data: http://json2ts.com/

@benjamingeer
Copy link
Author

OK I changed ResourceCreationSpec so the multi-project user creates two resources in different projects. Could you check this again now?

/**
* The IRIs of the groups that the user belongs to.
*/
groups: Array<string>;
Copy link
Contributor

Choose a reason for hiding this comment

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

You could use the KnoraIri pseudo type here just to make it more clear that is is an Knora IRI: https://github.com/dhlab-basel/Knora/blob/wip/salsah-username/salsah/src/typescript_interfaces/basicMessageComponents.ts#L245

@tobiasschweizer
Copy link
Contributor

go on, genius

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants