-
Notifications
You must be signed in to change notification settings - Fork 51
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
Angular components for the Dialog Editor #55
Conversation
1342f99
to
cd947fa
Compare
@@ -5,7 +5,7 @@ | |||
.directive('dialogEditorModalFieldTemplate', function() { | |||
return { | |||
templateUrl: function(tElement, tAttrs) { | |||
return 'app/components/dialog-editor-modal-field-template/' + tAttrs.template; | |||
return tAttrs.template; |
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.
Still not sure about this one, have to try if it works before removing WIP
cd947fa
to
b6a5a6f
Compare
The build is failing, because you are mixing |
@karelhala you beat me to it ;) Steps:
|
@karelhala, @mtho11 I don't agree. Is there any technical reason ui-components needs to be typescript-only? It makes sense to me to put all our shared ui components here, whether they're written in ES5, ES6 or TypeScript. (I'm not saying this component shouldn't be typescript, if it is, even better .. but I am saying that it should not be a requirement.) |
Well the biggest problem is that we don't have loader for But does it makes sense to mix JS and TS in one project? I'd say more reasonable approach would be not to use all TS's features, but still rewriting every JS file to typescript (you don't have to create interfaces, use types or whatever, just replace IIF with I understand that it's easier to take already functioning component and just use it here, it sure is faster than rewriting whole thing over and over again. So what about we put babel loader to webpack and allow using JS files in build process (whether they are written in ES6 or 5) and when such component is introduced we create new issue which states that and when somebody has a bit of spare time he will rewrite such component to typescript. So we have more consistent code base. |
adc4651
to
46304b5
Compare
What about not adding the babel loader and just keeping everything *.ts and just replacing the IFFE blocks with |
Well, I guess the difference is that I'm thinking of this as a bag for reusable components, not a library with a consistent style and language.. So in my mind, we should support all the options. That said, @romanblanco seems OK with updating the PR to something typescript-like, so I guess we don't have to have that discussion here and now. But just to be clear about this, TS is not able to handle ES6 syntax. |
@himdel It does if you play with implicit any stuff. There are compiler settings for this. But you can also just do: I just tried it in: http://www.typescriptlang.org/play/ |
d7ebb61
to
cb6d9a4
Compare
2fe4fa5
to
b331c5d
Compare
@romanblanco you do not need to add 3rd party libraries to your |
@karelhala Thanks, I've just removed them :) |
@@ -21,6 +21,9 @@ | |||
"node": ">= 6.0.0", | |||
"npm": ">= 3.8.1" | |||
}, | |||
"files": [ | |||
"dist/js/ui-components.js" |
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 guess you don't want this .. if I'm reading the docs correctly, this would limit the npm package to just that one file
); | ||
// load categories from API, if the field is Tag Control | ||
if (this.modalData.type === 'DialogFieldTagControl') { | ||
this.resolveCategories(this.CollectionsApi).then(function(categories: any) { |
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.
this.resolveCategories()
- resolveCategories doesn't seem to take any arguments
3c2e62f
to
1e24e56
Compare
@dtaylor113 This PR is now ready, you can do your changes based on this |
Specs converted to TypeScript will be added in follow-up PR
2f36163
to
e00615c
Compare
@romanblanco found the problem why build started to fail. Looks like Webpack 1 ignored any error and exits every time with 0, even tho some build errors occurred. However webpack 2 is coded better (for us, worse) and does not ignore build errors. However we can force him to ignore these errors, just go to ...
"scripts": {
"start": "webpack --watch",
"test": "karma start",
"prepublish": "webpack || true",
"build": "webpack --config webpack.vendor.config.js && webpack -p",
"install-vendor": "webpack --config webpack.vendor.config.js",
"build-docs": "jsdoc -c jsdoc-conf.json"
},
... |
e00615c
to
5e9734e
Compare
Thank you, @karelhala! |
Merging, will release a new version together with #58. The problem with not being able to see the DialogEditor service has something to do with |
@himdel What exactly is the issue with yarn and branches? |
@mtho11 no idea about the exact issue, but have a read in ManageIQ/manageiq-ui-service#478 :). As it is now (with EDIT: possibly fixed in yarn-0.19.1, not sure, 0.16.1 is definitely affected |
Released 0.0.12 |
ManageIQ/manageiq-ui-service#54