Comments (10)
My initial idea for this task would be to parse the response from hitting /daily
through the API. It appears that response has all a list of all available Projects to the user, along with related client info, and associated Tasks. We could catch the 404 that happens when non-admin users attempt to call client.projects.all
and attempt a parse of /daily
.
from harvested.
Did this thing if you want to check it out: https://github.com/efatsi/harvested/compare/non-admin-projects. My test suite is blowing up today in all random directions so I haven't written any tests around this, but it gets the job done.
from harvested.
I implemented this as well: jvdp@3cfe6f7
See: #52
from harvested.
Cool. You both have the commit bit. Feel free to run with this.
from harvested.
@jvdp big fan of what you've implemented.
from harvested.
We could merge my changes and add a clearer error message (hinting at time.trackable_projects
) when requesting all projects as non-admin. This would model the Harvest API the most closely. Thoughts?
from harvested.
We could merge my changes and add a clearer error message (hinting at time.trackable_projects) when requesting all projects as non-admin. This would model the Harvest API the most closely. Thoughts?
I like this. I'm a fan of sending back a better error message and having them change their code vs detecting which resource they should hit and doing the appropriate request for them.
from harvested.
I've had to monkey patch this solution in on my project. Is this likely to see the light of day in the mainline soon? Seems like the problem has been solved already.
from harvested.
I'll have a look this week.
from harvested.
Version 1.2.0 with this functionality is now on rubygems.org.
from harvested.
Related Issues (20)
- time_by_user report broken HOT 1
- Remove non-SSL option HOT 2
- time_by_user hardcodes options HOT 2
- Getting a 404 on all tasks HOT 1
- 404 on time_by_user HOT 5
- Uninitialized constant Harvest::OAuthCredentials HOT 3
- Wrong number of arguments (1 for 3..4) HOT 3
- 500 Harvest Internal Server error HOT 1
- Loosen dependency on Hashie HOT 4
- Locking time entries via API? HOT 1
- Mark a time_entry as invoiced HOT 1
- Remove hashie HOT 3
- Duplicated key's in timezones.rb
- Company info HOT 2
- Unexpected results from filtering .all HOT 1
- Get expenses for a date range HOT 3
- csv_line_items not returned for invoice(s) HOT 2
- I am interested in maintaining harvested. HOT 1
- External Reference URL HOT 2
- Harvested and the V2 Harvest API HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from harvested.