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

Implement new dashboard APIs #4474

Merged
merged 3 commits into from
Oct 17, 2022
Merged

Conversation

julien-nc
Copy link
Member

@julien-nc julien-nc commented Sep 7, 2022

closes #4451

requires nextcloud/server#33658

In progress

@julien-nc julien-nc added 2. developing Work in progress enhancement New feature request Feature: Dashboard labels Sep 7, 2022
@julien-nc julien-nc added this to the v4.0.0 milestone Sep 7, 2022
@julien-nc julien-nc self-assigned this Sep 7, 2022
@codecov
Copy link

codecov bot commented Sep 7, 2022

Codecov Report

Base: 41.74% // Head: 41.86% // Increases project coverage by +0.11% 🎉

Coverage data is based on head (00f337e) compared to base (f76f274).
Patch has no changes to coverable lines.

❗ Current head 00f337e differs from pull request most recent head 9768191. Consider uploading reports for the commit 9768191 to get more accurate results

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #4474      +/-   ##
============================================
+ Coverage     41.74%   41.86%   +0.11%     
- Complexity      338      348      +10     
============================================
  Files           226      226              
  Lines          5603     5659      +56     
  Branches        738      738              
============================================
+ Hits           2339     2369      +30     
- Misses         3264     3290      +26     
Flag Coverage Δ
javascript 31.42% <ø> (ø)
php 69.18% <ø> (-0.58%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...oud/apps/calendar/lib/Dashboard/CalendarWidget.php 80.64% <0.00%> (-19.36%) ⬇️
...ud/apps/calendar/lib/Controller/ViewController.php 82.50% <0.00%> (-17.50%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@julien-nc julien-nc force-pushed the enh/4451/implement-new-dashboard-apis branch from 6213a1d to 0e36cd7 Compare September 7, 2022 15:47
@julien-nc
Copy link
Member Author

@ChristophWurst I just realized Calendar supports NC >= 22. The new APIs will only be there from 25. How do you wanna deal with that? Bump the min NC version to 25?

@tcitworld
Copy link
Member

Needed for #4459 anyway

@julien-nc
Copy link
Member Author

@ChristophWurst I'm stuck in getting the next occurrence of the events instead of DTSTART. I don't want to implement an overkill method when something simple might already exist 😁. Could you point me to places to understand how it's done by the frontend widget? Do I have to compute it from the event repetition rules?

@julien-nc
Copy link
Member Author

@tcitworld True that, thanks for the remark.

@miaulalala miaulalala modified the milestones: v4.0.0, v4.0.1 Oct 11, 2022
@miaulalala

This comment was marked as outdated.

@miaulalala miaulalala force-pushed the enh/4451/implement-new-dashboard-apis branch from b4442cd to 0a1fc97 Compare October 13, 2022 21:27
@miaulalala miaulalala marked this pull request as ready for review October 13, 2022 21:27
@miaulalala

This comment was marked as outdated.

@tobiasKaminsky

This comment was marked as outdated.

@tobiasKaminsky

This comment was marked as outdated.

@miaulalala
Copy link
Contributor

Testing is possible with:
curl -k -H 'OCS-APIRequest: true' -u username:password http://your_base_url/ocs/v2.php/apps/dashboard/api/v1/widget-items -v

@ChristophWurst

This comment was marked as resolved.

@miaulalala

This comment was marked as off-topic.

@miaulalala
Copy link
Contributor

For my user bob who is not an admin it works well.

  <calendar>
   <element>
    <subtitle>in 4 days</subtitle>
    <title>fdsddsf</title>
    <link>http://nextcloud.local/index.php/apps/calendar/?objectId=e68c5668-c777-4069-bfc4-186113621b0d</link>
    <iconUrl>http://nextcloud.local/index.php/apps/calendar/public/getCalendarDotSvg/%230082c9</iconUrl>
    <sinceId>1666051200</sinceId>
   </element>
   <element>
    <subtitle>in 7 days</subtitle>
    <title>dsfdfsdfs</title>
    <link>http://nextcloud.local/index.php/apps/calendar/?objectId=fb1883be-abad-4b3e-ba4a-df92180d5fab</link>
    <iconUrl>http://nextcloud.local/index.php/apps/calendar/public/getCalendarDotSvg/%230082c9</iconUrl>
    <sinceId>1666310400</sinceId>
   </element>
   <element>
    <subtitle>in 10 days</subtitle>
    <title>fdsfddsffdsdfssdsdfsdfsfddsf</title>
    <link>http://nextcloud.local/index.php/apps/calendar/?objectId=48ec3b78-68f4-4278-be9d-799715fb04f1</link>
    <iconUrl>http://nextcloud.local/index.php/apps/calendar/public/getCalendarDotSvg/%230082c9</iconUrl>
    <sinceId>1666569600</sinceId>
   </element>
   <element>
    <subtitle>in 11 days</subtitle>
    <title>dssdadsasadasd</title>
    <link>http://nextcloud.local/index.php/apps/calendar/?objectId=f2980c2e-5f8f-4153-9a41-9f90f55c6d8a</link>
    <iconUrl>http://nextcloud.local/index.php/apps/calendar/public/getCalendarDotSvg/%23499AA2</iconUrl>
    <sinceId>1666656000</sinceId>
   </element>
   <element>
    <subtitle>in 12 days</subtitle>
    <title>dsadsasdasadsad</title>
    <link>http://nextcloud.local/index.php/apps/calendar/?objectId=bbd0e106-1473-4f0f-97ef-6270695616dc</link>
    <iconUrl>http://nextcloud.local/index.php/apps/calendar/public/getCalendarDotSvg/%23499AA2</iconUrl>
    <sinceId>1666742400</sinceId>
   </element>
  </calendar>

and the icons work and are in the right colour.

@miaulalala

This comment was marked as resolved.

lib/Controller/ViewController.php Outdated Show resolved Hide resolved
lib/Dashboard/CalendarWidget.php Outdated Show resolved Hide resolved
css/dashboard.css Outdated Show resolved Hide resolved
lib/Dashboard/CalendarWidget.php Show resolved Hide resolved
tests/php/unit/Controller/ViewControllerTest.php Outdated Show resolved Hide resolved
tests/php/unit/Dashbaord/CalendarWidgetTest.php Outdated Show resolved Hide resolved
@miaulalala miaulalala force-pushed the enh/4451/implement-new-dashboard-apis branch from 084fa0a to 62f2962 Compare October 14, 2022 16:38
@miaulalala
Copy link
Contributor

@tobiasKaminsky pls review!

@miaulalala miaulalala force-pushed the enh/4451/implement-new-dashboard-apis branch from 00f337e to 5463bf5 Compare October 17, 2022 09:56
Julien Veyssier added 3 commits October 17, 2022 13:02
@miaulalala miaulalala force-pushed the enh/4451/implement-new-dashboard-apis branch from 5463bf5 to 9768191 Compare October 17, 2022 11:03
@miaulalala miaulalala merged commit 946f6ed into main Oct 17, 2022
@miaulalala miaulalala deleted the enh/4451/implement-new-dashboard-apis branch October 17, 2022 11:44
@ChristophWurst ChristophWurst modified the milestones: v4.0.1, v4.1.0 Oct 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2. developing Work in progress enhancement New feature request Feature: Dashboard
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Adapt upcoming events widget for mobile clients
5 participants