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

Feature/rename workspace/47 #72

Merged
merged 52 commits into from
Jun 15, 2021
Merged

Feature/rename workspace/47 #72

merged 52 commits into from
Jun 15, 2021

Conversation

zak39
Copy link
Collaborator

@zak39 zak39 commented May 31, 2021

Hey @StCyr 👋

The renaming is (almost) finished but the sidebar menu (AppNavigation) doesn't update at the same time.

Give you some advice me ? ^^'

zak39 and others added 26 commits May 28, 2021 17:03
…ral homepage

when reloading pages

Signed-off-by: Cyrille Bollu <cyr.debian@bollu.be>
Signed-off-by: Cyrille Bollu <cyr.debian@bollu.be>
Signed-off-by: Cyrille Bollu <cyr.debian@bollu.be>
Signed-off-by: Cyrille Bollu <cyr.debian@bollu.be>
Signed-off-by: Cyrille Bollu <cyr.debian@bollu.be>
Signed-off-by: Cyrille Bollu <cyr.debian@bollu.be>
Signed-off-by: Cyrille Bollu <cyr.debian@bollu.be>
it matching other more specific routes.

Signed-off-by: Cyrille Bollu <cyr.debian@bollu.be>
Signed-off-by: Cyrille Bollu <cyr.debian@bollu.be>
Signed-off-by: Cyrille Bollu <cyr.debian@bollu.be>
Signed-off-by: Cyrille Bollu <cyr.debian@bollu.be>
Signed-off-by: Cyrille Bollu <cyr.debian@bollu.be>
…ckend

Signed-off-by: Cyrille Bollu <cyr.debian@bollu.be>
Signed-off-by: Cyrille Bollu <cyr.debian@bollu.be>
Signed-off-by: Cyrille Bollu <cyr.debian@bollu.be>
Signed-off-by: Cyrille Bollu <cyr.debian@bollu.be>
Signed-off-by: Cyrille Bollu <cyr.debian@bollu.be>
Signed-off-by: Cyrille Bollu <cyr.debian@bollu.be>
Signed-off-by: Cyrille Bollu <cyr.debian@bollu.be>
Copy link
Collaborator

@StCyr StCyr left a comment

Choose a reason for hiding this comment

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

Hello Baptiste,

I've requested some changes

{{ t('workspace', 'Rename space') }}
</ActionButton>
@submit="renameSpace">
{{ t('workspace', 'Rename spaceAAAAA') }}
Copy link
Collaborator

Choose a reason for hiding this comment

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

some old garbage

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I corrected it !

// TODO
const oldSpaceName = this.$root.$data.spaces[this.$route.params.space].name
Copy link
Collaborator

Choose a reason for hiding this comment

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

better write it:

const oldSpaceName = this.$route.params.space

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I will test it !

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Okay I took it into account

const data = resp.data

if (data.statuscode === 204) {
this.$root.$data.spaces[data.space] = this.$root.$data.spaces[oldSpaceName]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should be:

let space = this.$root.$data.spaces[oldSpaceName]
space.name = data.space
Vue.set(this.$root.$data.spaces, data.space, space)
delete this.$root.$data.spaces[oldSpaceName]

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Aaah okay ! Instead of replacing the space you advise me to create a new space in spaces list

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I took it into account !

}
})
.catch((e) => {
Vue.set(this.$root.$data.spaces[this.$route.params.space], 'name', oldSpaceName)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not needed

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Okay I understand what you mean !

And I will correct it

Copy link
Collaborator

@StCyr StCyr left a comment

Choose a reason for hiding this comment

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

Please review my remarks.

There are also issues in the SpaceDetails.vue file.

@@ -29,6 +29,11 @@
'url' => '/spaces',
'verb' => 'GET'
],
[
'name' => 'workspace#create',
'url' => '/spaces',
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you change the url to /api/spaces?

I think it's better to do it like this.

I'll change the existing routes one of these days

@@ -49,6 +54,11 @@
'url' => '/group/{gid}/users',
'verb' => 'GET'
],
[
'name' => 'workspace#rename',
'url' => '/spaces/{folderId}',
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you change the url to /api/spaces/{$folderId}?

I think it's better to do it like this.

I'll change the existing routes one of these days

@@ -59,5 +69,10 @@
'requirements' => array('path' => '.+'),
'defaults' => array('path' => 'dummy'),
],
[
'name' => 'workspace#rename',
Copy link
Collaborator

Choose a reason for hiding this comment

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

This route is already defined above

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ouch... I am correcting it !

@@ -67,12 +79,12 @@ public function __construct(
* may use.
*
* @NoAdminRequired
*
* @NoCSRFRequired
Copy link
Collaborator

Choose a reason for hiding this comment

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

@NoCSRTRequired isn't needed?!?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ouch... I had to add it to test when I didn't success to get all users :/

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I tested the route with curl

@zak39
Copy link
Collaborator Author

zak39 commented Jun 3, 2021

@StCyr for Routes : If we want to add /api/<ressource>. It has to formalize our responses. In this way, we will have structure responses

What do you think ?

For example to support my proposition : When I create a space I return this json :

{
  "space": "Galadriel",
  "id_space": 213,
  "groups": {
    "GE-Galadriel": 31,
    "U-Galadriel": 31
  },
  "space_advanced_permissions": true,
  "space_assign_groups": [
    "GE-Galadriel",
    "U-Galadriel"
  ],
  "acl": {
    "state": true,
    "group_manage": "GE-Galadriel"
  },
  "statuscode": 201
}

I don't know if this structure is better. But, to know if the resource is created, we can filter as it : .statuscode.

@zak39 zak39 self-assigned this Jun 8, 2021
@zak39
Copy link
Collaborator Author

zak39 commented Jun 10, 2021

@StCyr I resolved conflicts but I need your help ! 😕

Can you check again this PR, please ? 🙂

Copy link
Collaborator

@StCyr StCyr left a comment

Choose a reason for hiding this comment

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

Hello,
I've reviewed your PR.
I've a remark related to access-control on your 'rename' method + have found some regression removing the '/index.php' part in your axios calls

lib/Controller/WorkspaceController.php Show resolved Hide resolved
*/
public function get($folderId) {
$response = $this->httpClient->get(
$this->urlGenerator->getBaseUrl() . '/apps/groupfolders/folders/' . $folderId,
Copy link
Collaborator

Choose a reason for hiding this comment

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

add /index.php

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's okay

$this->urlGenerator->getBaseUrl() . '/index.php/apps/groupfolders/folders/' . $id . '/groups/' . $gid ,
public function delete($id) {
$response = $this->httpClient->delete(
$this->urlGenerator->getBaseUrl() . '/apps/groupfolders/folders/' . $id,
Copy link
Collaborator

Choose a reason for hiding this comment

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

add /index.php

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's okay 👌

$this->urlGenerator->getBaseUrl() . '/index.php/apps/groupfolders/folders/' . $id,
public function rename($folderId, $newSpaceName) {
$response = $this->httpClient->post(
$this->urlGenerator->getBaseUrl() . '/apps/groupfolders/folders/'. $folderId .'/mountpoint',
Copy link
Collaborator

Choose a reason for hiding this comment

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

add /index.php

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's okay 👌

*/
public function attachGroup($folderId, $gid) {
$response = $this->httpClient->post(
$this->urlGenerator->getBaseUrl() . '/apps/groupfolders/folders/' . $folderId . '/groups',
Copy link
Collaborator

Choose a reason for hiding this comment

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

add /index.php

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's okay 👌

@zak39
Copy link
Collaborator Author

zak39 commented Jun 11, 2021

It's okay @StCyr now ;)

@StCyr StCyr merged commit 78c82d6 into main Jun 15, 2021
@LivOriona LivOriona linked an issue Jun 15, 2021 that may be closed by this pull request
@zak39 zak39 deleted the feature/rename-workspace/47 branch July 13, 2021 13:53
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.

Be able to rename a workspace as a general manager
2 participants