Skip to content
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

Feature: job id advanced parameter type #1383

Merged
merged 14 commits into from
Jun 11, 2018
Merged

Feature: job id advanced parameter type #1383

merged 14 commits into from
Jun 11, 2018

Conversation

ascobie
Copy link
Member

@ascobie ascobie commented May 29, 2018

Fix: #1330

@codecov
Copy link

codecov bot commented May 29, 2018

Codecov Report

Merging #1383 into master will increase coverage by 0.19%.
The diff coverage is 94.66%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #1383      +/-   ##
=========================================
+ Coverage    53.7%   53.9%   +0.19%     
=========================================
  Files        1025    1027       +2     
  Lines       24333   24387      +54     
  Branches     2800    2804       +4     
=========================================
+ Hits        13069   13145      +76     
+ Misses      11264   11242      -22
Impacted Files Coverage Δ
app/components/data/shared/job-id/index.ts 100% <100%> (ø)
...nts/market/submit/submit-ncj-template.component.ts 65.25% <100%> (ø) ⬆️
app/components/data/shared/index.ts 100% <100%> (ø) ⬆️
...ubmit/parameter-input/parameter-input.component.ts 100% <100%> (ø) ⬆️
...mponents/market/submit/market-application.model.ts 96.07% <100%> (+0.07%) ⬆️
app/components/data/shared/data.shared.module.ts 100% <100%> (ø) ⬆️
src/@batch-flask/utils/form-utils/form-utils.ts 87.5% <71.42%> (-12.5%) ⬇️
.../components/data/shared/job-id/job-id.component.ts 95.12% <95.12%> (ø)
... and 7 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 370bf7e...2cb5a62. Read the comment docs.

@timotheeguerin timotheeguerin changed the title job id advanced parameter type Feature: job id advanced parameter type May 29, 2018
@@ -5,9 +5,6 @@ bl-cloud-file-picker {
bl-form-field {
flex: 1;

.warning {
Copy link
Member

Choose a reason for hiding this comment

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

why did you remove this one?

Copy link
Member

Choose a reason for hiding this comment

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

nvm saw at the bottom

import { StorageAccountPickerComponent } from "./storage-account-picker";

const components = [
FileGroupPickerComponent, FileGroupSasComponent, FileGroupsPickerComponent,
Copy link
Member

Choose a reason for hiding this comment

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

can you make those 1 per line instead


import "./job-id.scss";

// tslint:disable:no-forward-ref
Copy link
Member

Choose a reason for hiding this comment

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

you don't need this one anymore

{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => JobIdComponent), multi: true },
{ provide: NG_VALIDATORS, useExisting: forwardRef(() => JobIdComponent), multi: true },
],
})
Copy link
Member

Choose a reason for hiding this comment

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

can you add changeDetection OnPush, we should be doing this for all the new components we write(And when we edit one try to update it to have onPush)

Copy link
Member Author

Choose a reason for hiding this comment

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

Cool, will make sure to add this whenever i am pottering about in the code.


constructor(private jobService: JobService) {
this._subscriptions.push(this.value.valueChanges.debounceTime(400).distinctUntilChanged().subscribe((value) => {
this._checkValid(value);
Copy link
Member

Choose a reason for hiding this comment

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

that should probably be a validator so it prevent the form from being submitted

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah i noticed this just before i left last night. Seems that none of the advanced components use validators, so file-in-file-group also passes validation if you add a rubbish filename.

private _checkValid(value: string) {
this.jobService.get(value).subscribe({
next: (job: any) => {
this.warning = true;
Copy link
Member

Choose a reason for hiding this comment

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

you might want to add changeDetector.markForCheck() here now that it is OnPush or it might not get detected

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, cheers. This will probably change somewhat when i look to use the validator.

@ascobie
Copy link
Member Author

ascobie commented May 31, 2018

I think the issue is that the parameter-input.component.validate() doesnt know how to deal with async validation. it's expecting a normal sync validator. might need some refactoring in here as there are at least 3 advances types that could do with async validation.

} else {
return Observable.of(processErrors(control.errors));
}
}
}
Copy link
Member Author

Choose a reason for hiding this comment

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

genius! nice one.

@ascobie ascobie merged commit 4e68cd3 into master Jun 11, 2018
@ascobie ascobie deleted the feature/ncj-job-id branch June 11, 2018 04:54
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.

2 participants