Skip to content

Fix/behaviour #11

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

Merged
merged 17 commits into from
Oct 6, 2017
Merged

Fix/behaviour #11

merged 17 commits into from
Oct 6, 2017

Conversation

MurhafSousli
Copy link
Contributor

closes #9

@adrianq
Copy link
Member

adrianq commented Sep 10, 2017

@tokland I am adding you as a reviewer. Can you please have a look at this PR when you are back to work? I will also do a review after yours...

@@ -8,29 +8,52 @@ config.i18n.strings.add('details');
config.i18n.strings.add('assignToOrgUnits');

const contextActions = Action.createActionsFromNames([
'details',
Copy link
Contributor

Choose a reason for hiding this comment

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

I see (ad807e6) that those conversions to 2 spaces are intentional, but this way we are mixing 2 and 4 spaces in the same project? Are you planning to convert the whole project to 2 spaces?

Copy link
Contributor Author

@MurhafSousli MurhafSousli Sep 11, 2017

Choose a reason for hiding this comment

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

@tokland I didn't intentionally want to change the spaces actually, but I had to hit the organize code shortcut before committing anyway, and It turned out whether I choose 2 or 4 spaces, git was seeing it as total change, so I went with 2 spaces (which I use usually)

Copy link
Member

Choose a reason for hiding this comment

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

@tokland what do you use in general? four spaces, right? no tabs, correct? This is a sort of a fork from https://github.com/EyeSeeTea/organisationUnit-User-Assigment. In there, we were using four spaces so probably it is better if we keep the 4 spaces conventions. I definitively would like the three of us to use the same convention

Copy link
Contributor

Choose a reason for hiding this comment

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

Personally, with JS, I like 2-spaces-no-tabs. But for existing projects let's keep whatever we had, here 4-spaces-no-tabs.

@@ -341,6 +341,9 @@ data_set=Data Set
intro_data_set=Create, update, view and delete data sets and custom forms. A data set is a collection of data elements for which data is entered.

assignToOrgUnits=Assign to organisation units
assignRoles=Assign roles
Copy link
Contributor

Choose a reason for hiding this comment

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

Side note: at some point, we should fix the i18n files; it has lots of unused keys and each language has different keys.

Copy link
Member

Choose a reason for hiding this comment

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

@MurhafSousli Can you please create a card for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@adrianq sure

@@ -9,14 +9,19 @@ config.i18n.strings.add('assignToOrgUnits');

const contextActions = Action.createActionsFromNames([
'details',
'assignToOrgUnits'
'assignToOrgUnits',
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you see the icons in the app? I needed to change all "*" to "**" in webpack.config.js proxy routes for the proxy to work (webpack/webpack-dev-server#458 (comment))

@tokland
Copy link
Contributor

tokland commented Sep 11, 2017

Btw, did you see the icons? I had to replace * by ** in webpack proxied urls (webpack/webpack-dev-server#458 (comment))

@MurhafSousli
Copy link
Contributor Author

MurhafSousli commented Sep 11, 2017

@tokland I added material fonts manually in index.html to fix the icon in dev.

@adrianq
Copy link
Member

adrianq commented Sep 24, 2017

@tokland are you fine with this PR? any pending change or something to discuss?

@tokland
Copy link
Contributor

tokland commented Sep 24, 2017

I don't see any changes commited in this branch from the original review, am I missing something?

I added material fonts manually in index.html to fix the icon in dev.

Did you try the proposal in my comment? it seemed easier to fix webpack.config.js.

@MurhafSousli
Copy link
Contributor Author

@tokland Sorry I didn't notice that you requested a change. yea it is much better like this!

@tokland
Copy link
Contributor

tokland commented Sep 24, 2017

Cool! And what was the final decision about the spaces? the PR still has the mixture 2 (new) / 4 (old)

@MurhafSousli
Copy link
Contributor Author

@tokland 4 spaces right! I did 4 in the next PR, but I didn't manage to finish it

Copy link
Member

@adrianq adrianq left a comment

Choose a reason for hiding this comment

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

@MurhafSousli This code looks good to me. A couple of things...
Can you please change the indentation of the new code to 4 spaces? I know that you changed it in the next PR but if you can change it here as well it would definitely help to see the difference. Also, it shouldn't cause you any major conflict in your next PR.

In the card, we talked about two different options for assign org unit:
Assign OU Data Capture -> It is implemented
Assign OU Output -> It is implemented

Keep in mind the two of them should open the same graphical interface (layout): 'assign org units' That graphical interface is currently working so please double check it keeps working. We will make changes to that interface in another PR.

@MurhafSousli
Copy link
Contributor Author

@adrianq sorry for the delay, I added 4 spaces to all files

@adrianq
Copy link
Member

adrianq commented Sep 28, 2017

Thanks @MurhafSousli What about my second comment?

@MurhafSousli
Copy link
Contributor Author

MurhafSousli commented Sep 29, 2017

@adrianq For the context menu, we already have one of them which opens the dialog.

But which property does the current Assign OU refer to? Assign OU Data Capture? or Assign OU Output?

I can only think about duplicating this field and rename them to

  • Assign to organization units data capture
  • Assign to organization units output

Assuming that we get the OU data capture from { fields: ":all,assignToOrgUnits[id,path,displayName]" };

What should we use for OU data output?
I tried { fields: ":all,assignToOrgUnitsOutput[id,path,displayName]" }; didn't work


After checking your last commit again, I found out that my code was almost identical except the field was userGroups instead of userGroups[id,displayName,publicAccess]

This is so frustrating, There should be a documentation for this somewhere, the documentation you gave me was for the REST API not the JS client we use

@MurhafSousli
Copy link
Contributor Author

MurhafSousli commented Oct 4, 2017

@adrianq PR is ready for review

@adrianq
Copy link
Member

adrianq commented Oct 4, 2017

@MurhafSousli Sorry for being picky but there a couple of things I would like you to polish:

  • If you look at the files comparison, there are a lot of files and bits of codes that aren't actually changed, just the format is changing. This may cause some issues (in general it is not considered a good practice): it is more difficult for us to review the code, if in the future we would like to compare it with the original app (organisation user assignment app) it is gonna be more difficult, if in the future I want to see the author of a line because is causing problems or whatever it is gonna be a nightmare, mixing formats, etc. Can you please clean up the code and just commit actual changes?
  • There is some code that doesn't have anything to do with this task https://github.com/EyeSeeTea/user-app/issues/9. For instance these lines https://github.com/EyeSeeTea/user-app/pull/11/files#diff-3f783c9074ac4c268b871dac8a540b69R64 I know you will be using this code in the next PR but, in any case, this code should be part of this PR.

Next tasks are much more difficult and can be a nightmare for the two of us if we are not particularly clean with the PRs. Hopefully, these changes shouldn't take you long. It would be great if we can close these PRs between tomorrow and the day after.

@MurhafSousli
Copy link
Contributor Author

MurhafSousli commented Oct 5, 2017

@adrianq I am sorry for the difficulties you are having in reviewing this PR. But do you remember when we talked about the 4 spaces? (A couple of comments above)

@MurhafSousli This code looks good to me. A couple of things...
Can you please change the indentation of the new code to 4 spaces? I know that you changed it in the next PR but if you can change it here as well it would definitely help to see the difference. Also, it shouldn't cause you any major conflict in your next PR.

So this is the result of adding 4 spaces. I literally sat the spaces to 4 and then I applied code organizing to all files.

As you see I am not committing all the changes in one giant commit. I made separate commits for this purpose. IMHO I think you should not review the code from the total file changes. instead, it is easier to review each commit on its own. The lines you highlighted are related to the Add 4 space commit (4abdafa) I believe.

If the code that was being pushed in earlier PRs was being pushed in a correct format, we wouldn't have seen these annoying changes. but code with extra spaces and wrong formatting will cause such issue and it needs to be fixed sooner or later. otherwise, we are keeping the unfixed code with us from PR to PR.


There is some code that doesn't have anything to do with this task #9

Sorry, I don't know how this happened, I probably made mistake while checking out between branches and forgot what branch I was working on. this mistake was produced in the commit Add group to the detail panel(1371215)

I honestly don't know how to clean up at this point due to my limited git skills. I don't think I can go back to that state. But I can undo the last commit and push it again into multiple commits if you want.

Would you like remove this PR and start a new one. or if you know a better way, can you guide me through the steps? thanks.

@adrianq adrianq merged commit 968ba5f into development Oct 6, 2017
@adrianq adrianq removed the testing label Oct 6, 2017
@adrianq adrianq deleted the fix/behaviour branch February 21, 2018 09:54
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.

3 participants