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

Make additional info attribute configureable #1588

Merged
merged 5 commits into from
Mar 30, 2021

Conversation

ishank011
Copy link
Contributor

No description provided.

@ishank011 ishank011 requested a review from labkode as a code owner March 26, 2021 13:23
@update-docs
Copy link

update-docs bot commented Mar 26, 2021

Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes.

refs
refs previously approved these changes Mar 29, 2021
Copy link
Member

@refs refs left a comment

Choose a reason for hiding this comment

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

👍

@labkode
Copy link
Member

labkode commented Mar 29, 2021

@ishank011 can you make it configurable with a layout like we do for the home configuration, for example: {{.Username - .Mail}}

@ishank011
Copy link
Contributor Author

@labkode done

@@ -73,6 +76,8 @@ func (h *Handler) Init(c *config.Config) error {
h.sharePrefix = c.SharePrefix
h.homeNamespace = c.HomeNamespace

h.additionalInfoTemplate, _ = template.New("additionalInfo").Parse(c.AdditionalInfoAttribute)
Copy link
Member

Choose a reason for hiding this comment

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

Are you not checking the error here because the only way it could fail is if the template has already been parsed? Otherwise, I think there is some value in error checking here, at least for debugging purposes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@refs I thought that we shouldn't fatal if the parsing fails. Similarly, in case executing the template fails, I didn't report an error but returned an empty string. I'll add a warning there

@labkode labkode merged commit cf22565 into cs3org:master Mar 30, 2021
@ishank011 ishank011 deleted the share-additional-info branch March 30, 2021 17:30
ffurano pushed a commit to ffurano/reva that referenced this pull request Apr 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants