Clone Tools
  • last updated a few minutes ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Created a separate review for this - FEOLMIS-1727.

Created a separate review for this - FEOLMIS-1727.

Move all property assignments to onInit method

Move all property assignments to onInit method

OLMIS-2797: Removed CSS that was overly general and repetative

Do we want to make the method take a list of arguments(title, message etc.) instead of an object?

Do we want to make the method take a list of arguments(title, message etc.) instead of an object?

Yes, sorry. The other one is for a separate branch.

Yes, sorry. The other one is for a separate branch.

I agree.

I agree.

Overall, this looks good — I don't love the preSave/postSave hooks being so explicit — I feel like we could have a better interface if we moved more logic into the adjustments-modal.service.js

Overall, this looks good — I don't love the preSave/postSave hooks being so explicit — I feel like we could have a better interface if we moved more logic into the adjustments-modal.service.js

This should should be prefixed somewhere, so the change stays contained to this specific area...

This should should be prefixed somewhere, so the change stays contained to this specific area...

If possible — delete this entire file, its a great example of duplicative CSS

If possible — delete this entire file, its a great example of duplicative CSS

Like I noted in the other review — setting and copying options variables would be more clear here — and also make the contract of how to use this modal more obvious

Like I noted in the other review — setting and copying options variables would be more clear here — and also make the contract of how to use this modal more obvious

+1 – unit tests for this file will also help make its actions clear (IE you get list back with changes)

+1 – unit tests for this file will also help make its actions clear (IE you get list back with changes)

I think we have two reviews for this same ticket — crap — please remove this file if we are not using it...

I think we have two reviews for this same ticket — crap — please remove this file if we are not using it...

I'm not loving pre-cancel or pre-save calls — I see that we need it to provide extra validation, and ideally before the controller's scope is destroyed... which seems to be the reason we don't use ...

I'm not loving pre-cancel or pre-save calls — I see that we need it to provide extra validation, and ideally before the controller's scope is destroyed... which seems to be the reason we don't use a promise and just "re-open" the modal

This is totally fine for now — we might want to explore adding an event here // or finding a way to use a promise, where closing/destroying the scope happens after the code written in the implementing controller.

Be sure to document this interface

+1

+1

This looks great — there are a couple comments and "unresolved" that I think can be optional

This looks great — there are a couple comments and "unresolved" that I think can be optional

Cool — I'll try to see where else this happens and make a refactor ticket about it (which we can do.... later)

Cool — I'll try to see where else this happens and make a refactor ticket about it (which we can do.... later)

that is such a tiny dumb difference — but probably not worthing making some abstraction to deal with — and let services do their own thing

that is such a tiny dumb difference — but probably not worthing making some abstraction to deal with — and let services do their own thing

I like the use of $onInit and $element — it looks like we almost don't use $scope.... Overall this will become more testable and extendable — which we should document and recommend (eventually)

I like the use of $onInit and $element — it looks like we almost don't use $scope.... Overall this will become more testable and extendable — which we should document and recommend (eventually)

This looks like the only function that uses $scope, and it seems like this check could happen more cleanly somewhere else. This is also something we could clean up later

This looks like the only function that uses $scope, and it seems like this check could happen more cleanly somewhere else.

This is also something we could clean up later

Looks good — not 100% sure we need the "digits-cell" class — but its good enough for now

Looks good — not 100% sure we need the "digits-cell" class — but its good enough for now

Question: Can we expect .stockAjustments to be null? (or false, "2", or some other value) This seems like a great place to set a default value

Question: Can we expect .stockAjustments to be null? (or false, "2", or some other value)

This seems like a great place to set a default value

(1) Yes, that's fugly. (2) I really do think this component should be in referencedata-ui — it uses base components to provide logic — and has an idea of data specifically from OpenLMIS (adjustmen...

(1) Yes, that's fugly.

(2) I really do think this component should be in referencedata-ui — it uses base components to provide logic — and has an idea of data specifically from OpenLMIS (adjustments)

I'd just do simple things like:

  • Set adjustments to an empty array (if it isn't)
  • Set reasons to an empty array (if it isn't)
  • and specify options as false at the top of the file so its really clear whats in the options object.


var defaultOptions = {
  adjustments: [],
  reasons: [],
  message: false,
  title: messageService.get("default title")
};

options = angular.extend({}, defaultOptions, options);

Can we delete this entire file? (if so, lets do it)

Can we delete this entire file? (if so, lets do it)

add return annotation

add return annotation

update parameter list

update parameter list