Skip to content
This repository has been archived by the owner on Dec 13, 2020. It is now read-only.

new getAttributes methods #1357 #1392

Merged
merged 3 commits into from
Nov 30, 2017
Merged

new getAttributes methods #1357 #1392

merged 3 commits into from
Nov 30, 2017

Conversation

wiadev
Copy link
Contributor

@wiadev wiadev commented Nov 29, 2017

@@ -38,6 +38,26 @@ export function getData(
);
}

/**
*
* @param {*} entity - entity should always be `documentView`
Copy link
Member

Choose a reason for hiding this comment

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

then why having it as parameter?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

just for the future development

Copy link
Member

Choose a reason for hiding this comment

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

Agile development best practices(1) says that we shall not develop ahead and imagine things because they might never happen. It might be that there will be no future extension. And when and if it will be, we will address it at that time.
At the moment i find this misleading for new developers.
More I would rename the function from "getAttributes" to "getViewAttributes" because that's what precisely is doing.
I will drop that "entity" param because it;s pointless and i will also drop that viewId and rowId checking because if they are null/missing, you would build a wrong endpoint URL anyways.

Also, please note, I am not a javascript developer, so it might be wrong what I am saying.
I would like to hear other oppinions too.
@pablosichert @metas-ts @ottosichert guys, wdyt?

References:

  1. Clean Code: A Handbook of Agile Software Craftsmanship (Robert C. Martin)

'/' + entity +
'/' + windowId +
(viewId ? '/' + viewId : '') +
(rowId ? '/' + rowId : '') +
Copy link
Member

Choose a reason for hiding this comment

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

imho the viewId and rowId shall always be present. if not, there is an error.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, they will always be presented but left them to make it generic function

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@teosarca do you want me to update these comments?

@teosarca
Copy link
Member

found an issue: wrong endpoint is called when PATCHing:
image

@teosarca teosarca merged commit af74af7 into master Nov 30, 2017
@teosarca teosarca deleted the dev-1357 branch November 30, 2017 10:36
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants