Skip to content

Commit 85350d9

Browse files
Add explicit public modifiers to dialog members (partial 2)
This change continues adding explicit `public` modifiers to class members (fields, constructors, and methods) in TypeScript files within the `src/CrystalQuartz.Application.Client2/src/dialogs` directory. This is part of a larger effort to improve code clarity and explicitness. Completed steps in this phase: - Modified `src/CrystalQuartz.Application.Client2/src/dialogs/dialog-view-base.tsx` - Modified `src/CrystalQuartz.Application.Client2/src/dialogs/dialog-view-model.ts` - Modified `src/CrystalQuartz.Application.Client2/src/dialogs/job-details/job-details-view-model.ts` - Modified `src/CrystalQuartz.Application.Client2/src/dialogs/schedule-job/schedule-job-view-model.ts` - Modified `src/CrystalQuartz.Application.Client2/src/dialogs/schedule-job/steps/group-configuration-step.ts` Previously completed steps for this directory are in the commit for branch `feature/public-dialog-modifiers-partial`.
1 parent 2acd7f2 commit 85350d9

File tree

5 files changed

+38
-38
lines changed

5 files changed

+38
-38
lines changed

src/CrystalQuartz.Application.Client2/src/dialogs/dialog-view-base.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export default abstract class DialogViewBase<T extends IDialogViewModel<any>>
2525
}
2626
}
2727

28-
template(): HtmlDefinition {
28+
public template(): HtmlDefinition {
2929
console.log('template', this.viewModel);
3030

3131
return (

src/CrystalQuartz.Application.Client2/src/dialogs/dialog-view-model.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@ export interface IDialogViewModel<TResult> {
1010
}
1111

1212
export class DialogViewModel<TResult> implements IDialogViewModel<TResult> {
13-
accepted = new Event<any>();
14-
canceled = new Event<any>();
15-
state = new ObservableValue<DataState>('unknown');
16-
errorMessage = new ObservableValue<string | null>(null);
13+
public accepted = new Event<any>();
14+
public canceled = new Event<any>();
15+
public state = new ObservableValue<DataState>('unknown');
16+
public errorMessage = new ObservableValue<string | null>(null);
1717

18-
constructor() {
18+
public constructor() {
1919
this.state.setValue('unknown');
2020
}
2121

22-
cancel() {
22+
public cancel() {
2323
this.canceled.trigger({});
2424
}
2525

src/CrystalQuartz.Application.Client2/src/dialogs/job-details/job-details-view-model.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,18 @@ import { Property, PropertyType } from '../common/property';
66
import { DialogViewModel } from '../dialog-view-model';
77

88
export default class JobDetailsViewModel extends DialogViewModel<any> {
9-
summary = new ObservableList<Property>();
10-
identity = new ObservableList<Property>();
11-
jobDataMap = new ObservableValue<PropertyValue | null>(null);
9+
public summary = new ObservableList<Property>();
10+
public identity = new ObservableList<Property>();
11+
public jobDataMap = new ObservableValue<PropertyValue | null>(null);
1212

13-
constructor(
13+
public constructor(
1414
private job: Job,
1515
private commandService: CommandService
1616
) {
1717
super();
1818
}
1919

20-
loadDetails() {
20+
public loadDetails() {
2121
this.commandService
2222
.executeCommand<JobDetails>(new GetJobDetailsCommand(this.job.GroupName, this.job.Name), true)
2323
.then((details) => {

src/CrystalQuartz.Application.Client2/src/dialogs/schedule-job/schedule-job-view-model.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,18 @@ export class ScheduleJobViewModel /*extends Owner*/ implements IDialogViewModel<
3838
private _currentData!: ConfigurationStepData;
3939
private _finalStep: TriggerConfigurationStep;
4040

41-
isSaving = new ObservableValue<boolean>(false);
41+
public isSaving = new ObservableValue<boolean>(false);
4242

43-
currentStep = new ObservableValue<ConfigurationStep | null>(null);
44-
previousStep = new ObservableValue<ConfigurationStep | null>(null);
45-
nextStep = new ObservableValue<ConfigurationStep | null>(null);
43+
public currentStep = new ObservableValue<ConfigurationStep | null>(null);
44+
public previousStep = new ObservableValue<ConfigurationStep | null>(null);
45+
public nextStep = new ObservableValue<ConfigurationStep | null>(null);
4646

47-
state = new ObservableValue<string | null>(null);
47+
public state = new ObservableValue<string | null>(null);
4848

49-
accepted = new Event<any>(); /* todo: base class */
50-
canceled = new Event<any>();
49+
public accepted = new Event<any>(); /* todo: base class */
50+
public canceled = new Event<any>();
5151

52-
constructor(
52+
public constructor(
5353
private schedulerExplorer: SchedulerExplorer,
5454
private commandService: CommandService,
5555
private options: ScheduleJobOptions = {}
@@ -89,21 +89,21 @@ export class ScheduleJobViewModel /*extends Owner*/ implements IDialogViewModel<
8989
this.state.setValue(ConfigarationState.Ready);
9090
}
9191

92-
initState(): void {
92+
public initState(): void {
9393
this.state.setValue(ConfigarationState.Loading);
9494

9595
this.commandService.executeCommand(new GetJobTypesCommand()).then((data) => {
9696
this.initConfigSteps(data);
9797
});
9898
}
9999

100-
releaseState() {}
100+
public releaseState() {}
101101

102-
cancel() {
102+
public cancel() {
103103
this.canceled.trigger({});
104104
}
105105

106-
goBackOrCancel() {
106+
public goBackOrCancel() {
107107
const previousStep = this.previousStep.getValue();
108108
if (previousStep) {
109109
this.setCurrentStep(this.previousStep.getValue()!);
@@ -112,7 +112,7 @@ export class ScheduleJobViewModel /*extends Owner*/ implements IDialogViewModel<
112112
}
113113
}
114114

115-
goNextOrSave() {
115+
public goNextOrSave() {
116116
const currentStep = this.currentStep.getValue();
117117
if (currentStep && currentStep.validators && !currentStep.validators.validate()) {
118118
return false;

src/CrystalQuartz.Application.Client2/src/dialogs/schedule-job/steps/group-configuration-step.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,18 @@ export class JobGroupType {
1515
}
1616

1717
export class GroupConfigurationStep /*extends Owner*/ implements ConfigurationStep {
18-
code = 'group';
19-
navigationLabel = 'Configure Group';
18+
public code = 'group';
19+
public navigationLabel = 'Configure Group';
2020

21-
jobGroupType = new BidirectionalValue<string>((value) => true, JobGroupType.None);
22-
jobGroupTypeOptions = new ObservableList<SelectOption>();
23-
existingJobGroups = new ObservableList<SelectOption>();
24-
selectedJobGroup = new BidirectionalValue<string>((value) => true, '');
25-
newJobGroup = new BidirectionalValue<string>((value) => true, '');
21+
public jobGroupType = new BidirectionalValue<string>((value) => true, JobGroupType.None);
22+
public jobGroupTypeOptions = new ObservableList<SelectOption>();
23+
public existingJobGroups = new ObservableList<SelectOption>();
24+
public selectedJobGroup = new BidirectionalValue<string>((value) => true, '');
25+
public newJobGroup = new BidirectionalValue<string>((value) => true, '');
2626

27-
validators = new Validators();
27+
public validators = new Validators();
2828

29-
constructor(private schedulerExplorer: SchedulerExplorer) {
29+
public constructor(private schedulerExplorer: SchedulerExplorer) {
3030
// super();
3131

3232
const groups = schedulerExplorer.listGroups().map((g) => ({ value: g.Name, title: g.Name }));
@@ -56,7 +56,7 @@ export class GroupConfigurationStep /*extends Owner*/ implements ConfigurationSt
5656
//this.own(this.validators);
5757
}
5858

59-
onEnter(data: ConfigurationStepData): ConfigurationStepData {
59+
public onEnter(data: ConfigurationStepData): ConfigurationStepData {
6060
// workarounds for selects caused by the fact that the value is set before
6161
// options rendered
6262
this.jobGroupType.mutate((_) => _);
@@ -65,15 +65,15 @@ export class GroupConfigurationStep /*extends Owner*/ implements ConfigurationSt
6565
return data;
6666
}
6767

68-
onLeave(data: ConfigurationStepData): ConfigurationStepData {
68+
public onLeave(data: ConfigurationStepData): ConfigurationStepData {
6969
return {
7070
groupName: this.getGroupName(),
7171
jobClass: data.jobClass,
7272
jobName: data.jobName,
7373
};
7474
}
7575

76-
getGroupName(): string | null {
76+
public getGroupName(): string | null {
7777
const jobGroupType = this.jobGroupType.getValue();
7878

7979
if (jobGroupType === JobGroupType.None) {
@@ -87,7 +87,7 @@ export class GroupConfigurationStep /*extends Owner*/ implements ConfigurationSt
8787
return null;
8888
}
8989

90-
releaseState() {
90+
public releaseState() {
9191
//this.dispose();
9292
}
9393
}

0 commit comments

Comments
 (0)