Skip to content

Commit 2b9a0e7

Browse files
authored
Fixing js doc (#1721)
1 parent 3bbcc32 commit 2b9a0e7

File tree

4 files changed

+58
-43
lines changed

4 files changed

+58
-43
lines changed

jsdocs/jsdoc.conf.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
},
55
"source": {
66
"includePattern": ".+\\.js(doc)?$",
7-
"excludePattern": "(^|\\/|\\\\)_",
7+
"excludePattern": "(^|\\/|\\\\)_|FormFileInputWidgetBase\\.js$|FormFileInputWidget\\.js$",
88
"include": ["./../ui.frontend/src",
99
"./resources/copyright/README.md"
1010
]

ui.frontend/src/view/FormCheckBox.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,14 @@
1616

1717
import FormFieldBase from "./FormFieldBase.js";
1818

19+
20+
/**
21+
* @module FormView
22+
*/
23+
1924
/**
2025
* Class representing components based on CheckBox.
21-
* @extends module:FormView~FormCheckBox
26+
* @extends module:FormView~FormFieldBase
2227
*/
2328
class FormCheckBox extends FormFieldBase {
2429

ui.frontend/src/view/FormFileInput.js

Lines changed: 45 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -16,56 +16,61 @@
1616

1717
import FormFieldBase from "./FormFieldBase.js";
1818

19-
/**
20-
* Class representing components based on FileInput.
21-
* @extends module:FormView~FormFileInput
22-
*/
23-
class FormFileInput extends FormFieldBase {
2419

25-
constructor(params) {
26-
super(params);
27-
}
20+
/**
21+
* @module FormView
22+
*/
2823

29-
setModel(model) {
30-
super.setModel(model);
31-
if (this.widgetObject == null) {
32-
this.widgetObject = new FileInputWidget(this.widgetFields);
33-
}
34-
}
24+
/**
25+
* Class representing components based on FileInput.
26+
* @extends module:FormView~FormFieldBase
27+
*/
28+
class FormFileInput extends FormFieldBase {
3529

36-
updateValue(value) {
37-
if (this.widgetObject == null) {
38-
this.widgetObject = new FileInputWidget(this.widgetFields);
39-
}
40-
this.widgetObject.setValue(value);
41-
super.updateEmptyStatus();
30+
constructor(params) {
31+
super(params);
32+
}
33+
34+
setModel(model) {
35+
super.setModel(model);
36+
if (this.widgetObject == null) {
37+
this.widgetObject = new FileInputWidget(this.widgetFields);
4238
}
39+
}
4340

44-
syncWidget() {
45-
let widgetElement = this.getWidget ? this.getWidget() : null;
46-
if (widgetElement) {
47-
widgetElement.id = this.getId() + "__widget";
48-
this.getAttachButtonLabel().setAttribute('for', this.getId() + "__widget");
49-
}
41+
updateValue(value) {
42+
if (this.widgetObject == null) {
43+
this.widgetObject = new FileInputWidget(this.widgetFields);
5044
}
45+
this.widgetObject.setValue(value);
46+
super.updateEmptyStatus();
47+
}
5148

52-
/*
53-
We are overriding the syncLabel method of the FormFieldBase class because for all components,
54-
we pass the widgetId in 'for' attribute. However, for the file input component,
55-
we already have a widget, so we should not pass the widgetId twice
56-
*/
57-
syncLabel() {
58-
let labelElement = typeof this.getLabel === 'function' ? this.getLabel() : null;
59-
if (labelElement) {
60-
labelElement.setAttribute('for', this.getId());
61-
}
49+
syncWidget() {
50+
let widgetElement = this.getWidget ? this.getWidget() : null;
51+
if (widgetElement) {
52+
widgetElement.id = this.getId() + "__widget";
53+
this.getAttachButtonLabel().setAttribute('for', this.getId() + "__widget");
6254
}
55+
}
6356

64-
syncMarkupWithModel() {
65-
super.syncMarkupWithModel();
66-
this.syncWidget();
67-
this.syncLabel();
57+
/*
58+
We are overriding the syncLabel method of the FormFieldBase class because for all components,
59+
we pass the widgetId in 'for' attribute. However, for the file input component,
60+
we already have a widget, so we should not pass the widgetId twice
61+
*/
62+
syncLabel() {
63+
let labelElement = typeof this.getLabel === 'function' ? this.getLabel() : null;
64+
if (labelElement) {
65+
labelElement.setAttribute('for', this.getId());
6866
}
6967
}
68+
69+
syncMarkupWithModel() {
70+
super.syncMarkupWithModel();
71+
this.syncWidget();
72+
this.syncLabel();
73+
}
74+
}
7075

7176
export default FormFileInput;

ui.frontend/src/view/FormOptionFieldBase.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,14 @@
1616

1717
import FormFieldBase from "./FormFieldBase.js";
1818

19+
20+
/**
21+
* @module FormView
22+
*/
23+
1924
/**
2025
* Class containing common view code for dropdown, checkboxgroup and radiobutton
21-
* @extends module:FormView~FormOptionFieldBase
26+
* @extends module:FormView~FormFieldBase
2227
*/
2328
class FormOptionFieldBase extends FormFieldBase {
2429
constructor(params) {

0 commit comments

Comments
 (0)