-
Notifications
You must be signed in to change notification settings - Fork 19
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
Javascript wrapper for collectives API #988
Conversation
72fb510
to
de2be62
Compare
This comment was marked as outdated.
This comment was marked as outdated.
de2be62
to
322f989
Compare
beae1fa
to
2eab339
Compare
a3ef90a
to
ea9fb8a
Compare
ea9fb8a
to
18d10d4
Compare
@mejo- I still have some more ideas here but i feel like this could already go in and I can open a new PR for the next steps. I'd be happy about a review if you can spare some time. If you're busy with other things that's also fine. 🙂 |
e697fe1
to
6f719ff
Compare
4028334
to
282a272
Compare
075c0de
to
9fe4d6e
Compare
@max-nextcloud after rebase quite a few cypress tests fail now on all NC versions. Could you take a look? |
227e700
to
1bdda92
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I skimmed through the changes and they look good to me. Thanks a lot for all the refactoring work, the whole requests logic in frontend is so much cleaner now ❤️
Wrap all usage of the collectives api in a simple functional interface. This will allow us to change the layout of the api and only update it in a single place. Separate the API handling from the store. The api is concerned with axios and generateUrl while the store is only concerned with the current state of the app. Accept multiple arguments to `collectivesUrl` and `pagesUrl` and join them with `/` to build the url: Example: ```js api.pagesUrl({collectiveId: 10}, 'trash', 12) ``` results in `/apps/collectives/_api/10/_pages/trash/12` Use the api directly in the cypress commands. That way we do not require the page to be loaded. Also extract `collective-edit-mode.spec.js` from `pages.spec.js`. It requires a different beforeEach function to seed the edit mode before visiting the collective. Signed-off-by: Max <[email protected]>
1bdda92
to
180f7d3
Compare
Wrap all usage of the collectives api in a simple functional interface.
This will allow us to change the layout of the api
and only update it in a single place.
Refactor client (browser) app
Separate the API handling from the store.
The api is concerned with axios and generateUrl
while the store is only concerned with the current state of the app.
Url generation from parts
Accept multiple arguments to
collectivesUrl
andpagesUrl
and join them with
/
to build the url:Example:
results in
/apps/collectives/_api/10/_pages/trash/12
Tests (Cypress)
Use the api directly in the cypress commands.
That way we do not require the page to be loaded.
Also extract
collective-edit-mode.spec.js
frompages.spec.js
.It requires a different beforeEach function
to seed the edit mode before visiting the collective.
Signed-off-by: Max [email protected]
🏁 Checklist
npm run lint
/npm run stylelint
/composer run cs:check
)