-
Notifications
You must be signed in to change notification settings - Fork 2
Integrate web component to webkit #116
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
base: master
Are you sure you want to change the base?
Conversation
6d23878 to
0fe6673
Compare
| sg!.setContext(sg!.getAvailableContext()) | ||
| htmlView! = #Wnd!.addHtmlView(wnd!.getAvailableControlID(),0,0,300,300,"<avatar-initial height="""+height$+""" width="""+width$+""" name="""+name$+"""></avatar-initial>") | ||
| htmlView! = #configureAvatarView(htmlView!) | ||
| methodret htmlView! |
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.
Syntax Error: missing methodend
| #fireEvent(#ON_AVATAR_INITIAL_CLICK, ev!) | ||
| methodend | ||
|
|
||
| methodend |
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.
Remove this methodend
|
|
||
| methodend | ||
|
|
||
| method public BBjHtmlView drawAvatarIcon(BBjWindow wnd!,BBjInt height%, BBjInt width%, BBjString name$) |
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.
duplicate code
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.
Hi, it's not duplicate, one function takes integer and other take string (width and height)
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.
We don't need two methods performing the exact same task and executing basically the same thing. The method with the int parameters converts the ints into strings and executes the exact same code as the method with the string parameters, making it duplicate code
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.
ah you're right. Got it. Fixing now. Thanks.
| methodend | ||
|
|
||
| method public BBjHtmlView drawAvatarIcon(BBjWindow wnd!,BBjString height$, BBjString width$, BBjString name$) | ||
| htmlView! = wnd!.addHtmlView(wnd!.getAvailableControlID(),0,0,300,300,"<avatar-initial height="""+height$+""" width="""+width$+""" name="""+name$+"""></avatar-initial>") |
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.
duplicate code
| sg! = BBjAPI().openSysGui("X0") | ||
| #Wnd! =sg!.addWindow(95501,0,0,0,0,"",$01101083$) | ||
| sg!.setContext(sg!.getAvailableContext()) | ||
| htmlView! = #Wnd!.addHtmlView(wnd!.getAvailableControlID(),0,0,300,300,"<avatar-initial height="""+height$+""" width="""+width$+""" name="""+name$+"""></avatar-initial>") |
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.
duplicate code
|
|
||
| method public BBjHtmlView drawAvatarIcon(BBjString height$, BBjString width$, BBjString name$) | ||
| sg! = BBjAPI().openSysGui("X0") | ||
| #Wnd! =sg!.addWindow(95501,0,0,0,0,"",$01101083$) |
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.
id 95501 ?
| methodend | ||
|
|
||
| method public void onClickAvatarInitial(BBjNativeJavaScriptEvent ev!) | ||
| ClientUtil.consoleLog("catched the webcomponent event from BBj :)") |
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.
remove this log
|
@saadnoor |
|
|
@saadnoor I've opened several issues for your avatar component in: https://github.com/BasisHub/web-components/issues |
| method public AvatarInital(BBjWindow wnd!) | ||
| #super!(wnd!) | ||
|
|
||
| #setTitle("Avatar Initail Demo") |
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.
Typo: It should probably say "Avatar Initial Demo"
| use ::WebKit/widgets/WebComponents/WebComponents.bbj::WebComponents | ||
| use ::WebKit/widgets/WebComponents/AvatarIcon/AvatarIcon.bbj::AvatarIcon | ||
|
|
||
| class public AvatarInital extends ShowcaseWidget |
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.
Typo in class name: It should probably say "AvatarInitial" or "AvatarInitials"
| @@ -0,0 +1,71 @@ | |||
| use ::WebKit/demo/Showcase/ShowcaseWidget/ShowcaseWidget.bbj::ShowcaseWidget | |||
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.
Typo in file name
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.
Code indentation in the whole file is bad
| #super!(wnd!) | ||
|
|
||
| #setTitle("Avatar Initail Demo") | ||
| #setIntro("This demo shows the Avatar initail stuff") |
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.
Typo + We should refrain from writing "stuff" as this seems unprofessional
| methodend | ||
|
|
||
| method public CircularAvatar(BBjWindow parent!, BBjString radius!, BBjString imagePath!, BBjString title!) | ||
| DynamicLoader.addLocalCSS("WebKit/widgets/common/CircularAvatar/CircularAvatar.css") |
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.
The DynamicLoader is deprecated, use the ClientUtil instead
| use ::WebKit/widgets/WebComponents/WebComponents.bbj::WebComponents | ||
| use ::WebKit/util/ClientUtil.bbj::ClientUtil | ||
|
|
||
| class public AvatarIcon extends WebComponents |
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 class should follow the BBjWidget pattern and not use some custom methods to use the widget (drawAvatarIcon)
| use ::WebKit/widgets/WebComponents/WebComponents.bbj::WebComponents | ||
| use ::WebKit/util/ClientUtil.bbj::ClientUtil | ||
|
|
||
| class public AvatarIcon extends WebComponents |
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 class is missing some setters to update the avatar values - See BBjWidget pattern
| methodret htmlView! | ||
| methodend | ||
|
|
||
| method public BBjHtmlView drawAvatarIcon(BBjString height$, BBjString width$, BBjString name$) |
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.
The class should be a widget meaning that the BBjHtmlView should not be returned. The class might use the BBjHtmlView internally but for external usage it should always be treated as BBjWidget
| methodend | ||
|
|
||
| method public BBjHtmlView drawAvatarIcon(BBjWindow wnd!,BBjString height$, BBjString width$, BBjString name$) | ||
| htmlView! = wnd!.addHtmlView(wnd!.getAvailableControlID(),0,0,300,300,"<avatar-initial height="""+height$+""" width="""+width$+""" name="""+name$+"""></avatar-initial>") |
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.
The properties should not be passed using inline css
|
I was only able to review the code because the showcase didn't work on my machine for unknown reasons |
@hyyan thanks for opening the issues, will address them one by one |
In this PR:
How to test avatar Icon:
#drawerDataModel!.getAvatarUrl()as""