Skip to content

Conversation

satvikshubham
Copy link
Contributor

Signed-off-by: Satvik Shubham Singh 58393226+satvikshubham@users.noreply.github.com

Signed-off-by: Satvik Shubham Singh <58393226+satvikshubham@users.noreply.github.com>
****
For using bhlib in your app, add the below dependency in the entry/package.json
```
"dependencies": {

Choose a reason for hiding this comment

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

add dependency command like this
npm i @ohos/bhlib

*/

export class Business {
private workingDays: boolean[] = [false, false, false, false, false, false, false];

Choose a reason for hiding this comment

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

add properties in custom component using model class


@CustomDialog
export struct TimeSelectorDialog {
time: string

Choose a reason for hiding this comment

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

add properties in custom component using model class


@Component
export struct BusinessHoursWeekView {
private showBusinessModel: Business = undefined

Choose a reason for hiding this comment

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

add properties in custom component using model class

dayInd: number
format: number
callback: (selIndex, where, dayInd) => void
arr12: string [] = [

Choose a reason for hiding this comment

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

add these arr12 & arr24 variables in separate constant file

Choose a reason for hiding this comment

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

done

@CustomDialog
export struct TimeSelectorDialog {
time: string
where: string

Choose a reason for hiding this comment

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

time, where, dayInd, format
add these properties in model class

Choose a reason for hiding this comment

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

Done

.textAlign(TextAlign.Center)
.backgroundColor(0xFFFFFF)
.onClick(() => {
this.callback(item, this.where, this.dayInd)

Choose a reason for hiding this comment

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

handle null & undefined validations on callback variable

.textAlign(TextAlign.Center)
.backgroundColor(0xFFFFFF)
.onClick(() => {
this.callback(item, this.where, this.dayInd)

Choose a reason for hiding this comment

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

handle null & undefined validations on callback variable

Choose a reason for hiding this comment

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

done

}
}

bhTextColor: string = '#000000'

Choose a reason for hiding this comment

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

create a model class for BusinessDayAndTime component and add all variables from this component in model class

Choose a reason for hiding this comment

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

done

@Component
export struct BusinessHoursWeekView {
private showBusinessModel: BusinessModel = undefined
isToday = new Date().getDay()

Choose a reason for hiding this comment

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

create a model class for BusinessHoursWeekView component and add all variables from this component in model class

Choose a reason for hiding this comment

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

Done

}

setWorkingDay = (day: number, v: boolean): void => {
this.workingDays[day - 1] = v;
Copy link

@HMOS-Developer HMOS-Developer Jul 5, 2022

Choose a reason for hiding this comment

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

handle null & undefined validations before assigning values to a variable in all setter methods

Choose a reason for hiding this comment

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

Done

export struct BusinessPicker {
@Link selectedBusinessModel: BusinessModel
day: string [] = BusinessModel.dayArr
arr: number[] = [0, 1, 2, 3, 4, 5, 6]

Choose a reason for hiding this comment

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

create a model class for BusinessPicker component and add all variables from this component in model class

Choose a reason for hiding this comment

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

Done

@@ -0,0 +1,8 @@
export default {

Choose a reason for hiding this comment

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

add copyright text here

Choose a reason for hiding this comment

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

Done

@HMOS-Developer
Copy link

Add Copyright text in all ts/ets files

ForEach(this.arr24, (item) => {
ListItem() {
Text(item)
.fontSize(16)

Choose a reason for hiding this comment

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

Mark all fontsizes as fp and dimentions as vp, recheck in all files and handle.

package.json Outdated
"hypium": "^1.0.0",
"@ohos/hvigor": "1.0.6",
"@ohos/hvigor-ohos-plugin": "1.0.6",
"@ohos/bhlib": "file:./bhlib"

Choose a reason for hiding this comment

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

remove the bhlib dependency from here and add at entry's package.json

Copy link

@archanaatr archanaatr left a comment

Choose a reason for hiding this comment

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

pls check the comments

Copy link

@archanaatr archanaatr left a comment

Choose a reason for hiding this comment

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

ok

@applibengineering applibengineering merged commit ad2879c into Applib-OpenHarmony:main Jul 8, 2022
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.

7 participants