You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@whimsical.apache.org by Craig Russell <ap...@gmail.com> on 2020/06/04 00:16:39 UTC
How to get the url for emeritus directories in the front end
I'm trying to replace the calculation of the url for emeritus from 'private/documents/emeritus' to ASF::SVN.svnurl('emeritus') but nothing is returned. The code is in the browser www/roster/views/person/forms.js.rb. Is this intended to be used in the browser or only in the back end?
The form is intended to display a clickable URL which is composed of the svn url plus the file name. Previous code used a string concatenation https://svn.apache.org/repos/private/documents plus emeritus plus file name.
I suspect that this code needs to remain as is, because ASF::SVN is not even available in the browser. So should I try to pass the urls as elements of the Person class?
Thanks,
Craig
Craig L Russell
clr@apache.org
Re: How to get the url for emeritus directories in the front end
Posted by Sam Ruby <ru...@intertwingly.net>.
On Wed, Jun 3, 2020 at 8:16 PM Craig Russell <ap...@gmail.com> wrote:
>
> I'm trying to replace the calculation of the url for emeritus from 'private/documents/emeritus' to ASF::SVN.svnurl('emeritus') but nothing is returned. The code is in the browser www/roster/views/person/forms.js.rb. Is this intended to be used in the browser or only in the back end?
Only in the back end.
> The form is intended to display a clickable URL which is composed of the svn url plus the file name. Previous code used a string concatenation https://svn.apache.org/repos/private/documents plus emeritus plus file name.
>
> I suspect that this code needs to remain as is, because ASF::SVN is not even available in the browser. So should I try to pass the urls as elements of the Person class?
General approach:
Add the code to extract that data (preferably including the
concatenation) to:the serialize method:
https://github.com/apache/whimsy/blob/master/www/roster/models/committer.rb
My recommendation would be to change the line that sets
response[:forms][:emeritus_request] to not just provide the file but
the full URL.
Verify the data is correct by looking at the JSON for an individual
that is emeritus:
https://whimsy.apache.org/roster/committer/stefano.json
Once that is complete, this data will be available in
committer.forms['emeritus_request'].
Looking at that code, it might be best to make this change for all
forms, but this could be done incrementally.
- Sam Ruby
> Thanks,
> Craig
>
> Craig L Russell
> clr@apache.org
>