-
Notifications
You must be signed in to change notification settings - Fork 114
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
Jamie/2523 data lifecycle refactor #3158
Merged
Merged
Changes from 118 commits
Commits
Show all changes
140 commits
Select commit
Hold shift + click to select a range
303cb7b
Add General setting section
f2195db
Swap out headings and sub headings
dedd697
Add checkboxes and provide alignment styles for Event feed and servic…
fb80a30
Restrict inputs to numbers, move save button to top, finish out Compl…
153c686
Alignment issues from mat-select, targeted where its coming from but …
370fa77
remove padding from dropdown that was causing alignment issues
787f0a4
WIP wiring up the event feed portion of the form
9053669
Revert control name
0bcef40
WIP - Serious form considerations to be made
0fabeb7
Changed all this.formBuilder to this.fb - just a personal preference …
de9e483
Rework patchDisable value to work with a nested formbuilder
6f823a4
Change enable/disable to hold formGroups to make it simpler
e3f95c6
rename patchInputValue to toggleInput
0325954
All inputs are now toggleable
9190937
Add temp print values button to see what the form is hosting, so far …
c88e3c1
Remove code that is no longer needed
90bc88a
WIP - Checkboxes mapped to group inside each form, may need to reconf…
1432aa9
Added some console logging
b620b7f
WIP - playing with the response coming back on getting jobs
3b707b3
WIP - lot going on here, finally have convertResponsesToJobSchedulerS…
bd14281
WIP - beginning to investigate how to update the form builder with th…
e3fa47f
Good progress getting user settings/InjestJobs back into the front en…
507e0aa
Note to self: follow up with Susan
fa3d508
WIP - Made good progress, going to branch off because I believe a bet…
b17cb9c
Full refactor of the front end and patching the forms to be enabled o…
72949c0
Refactor requests and models to accomodate new strucutre, added categ…
a9e347c
Updating forms, patchvalue is getting an object back right now, need …
3ec1918
Wired up infra, and compliance for initial ingest
e8907c8
All input wired up, little issue with one of the checkboxes not repor…
f2410c8
More refactoring of big switch statements
4f40894
WIP - pausing for today, getting ready to Apply changes of updated forms
c584f9f
Fixed error on checkboxes - needed to add value in the line
e29f60b
Fix up little form population error
556e373
WIP - need to think on how to structure the PUT call now that it's al…
1d7e675
Unfurling the Ingest Jobs to match the new PUT request, need to make …
ec04c77
Added optional nested attribute to Ingest...little wall to overcome, …
84ad13e
Clean up the conversion when building the API call
abd77db
Form is working, little bit of wonkiness still after saving the form,…
3e917ee
Fixed the retained disabled bug, First 2 client runs are not holding …
577eb6a
Change getting form values to use Raw Values
354667c
Fix Client runs retention hold
52a1830
Make service group health checks disabled to the user always
e44eeef
Update second service group item because API isn't set up for service…
0cef6fe
Test setup passing, hung up on formControlName not being on a standar…
6fa69d2
Fix first two tests by importing material modules and animations module
b914f66
Refactored unit tests for ToggleInput function
5ea28ac
Refactor two more tests, for null jobscheduler and noChanges button
ce2bbd7
Add First tests for updating form with ingest jobs
2436a5b
WIP - tiny values refactor
d538123
Added tests for updateForm with using
2cabd3b
Test coverage across automate-settings.component.ts but trouble creat…
23fb2b0
Troubleshooting 4 update forms, I believe its because of rxjs subscri…
e3c941c
Restrict frontend to positive integers, still need to implement valid…
1412765
Utilize distinctUntilKeyChanged for form update
30e935d
Temp hiding of client runs item 3 until figure out API issue
d993cc3
Update all routing and tests for routing to use data-lifecycle
848bf04
Got rid of noChanges() - was an unecessary function
4a2496a
WIP - to pull in master
96d2bfb
Add reminders
39e3cc1
Commented out effect that makes second get call, working great. Also…
4259f0d
Reset form to previously stored settings on failure
ee63eee
Subscriptions destroyed onDestroy
90baee6
Killed last subscription on destroy, callback is not a function types…
6ebe828
Move onChanges to into the update form to reset listening to the form
9f1e69a
Add positive integer regex and map path to validators using event feed
691954e
Move Notifications above Data Lifecycle on sidebar
d5b5141
Update days dropdown in client runs to only allow days
acfdeb6
add Zeros into validation, prevent negative on rest of inputs, move c…
52c2bed
Revert white space in file
56611f2
Sass linting fixes
0035380
Add saving and saving spinner
22cc945
Remove no longer needed validation, revert blank to 0s
594c733
Default to zero when a user does not enter a number
8268715
Remove effect no longer needed and add comments
0287aa8
Add strong typing to requests and populate nested
3bd82ed
Add strong typing and Enums to infra function
1b4832a
More reformatting and deleting no longer needed code
cf0a7a3
Delete more unneeded code
16986e6
Add more comments
c8b8956
Revert regex
bb43b15
Update css - make background of page white
ab64cea
Close as I can get right now to coloring and spacing, will need UX re…
df8686e
Add back keyboard navigation to dropdowns and inputs. Noticed check …
ce71743
Move Data feeds up in sidebar and into same category as Data Lifecycl…
5b6efda
Add tooltips to service group checkboxes
45def30
Sass lint fixes
f1316f7
Update deprecated routing test
c3c149a
Update comments in automate-settings model
f69bbd4
Updated environment retention URL
36e1498
Found why typescript is complaining about in requests and unfurljob, …
7f7101b
Changing type to any for now, but needs to be updated
2a1d82c
Follow chef-loading-spinner conventions
e1f446c
Fix up half of test issues to make stronger or easier to read
f1f2c1e
Remove string accessor values
de2c7d1
Simplify blocking of keys
8a51660
WIP - halfway through making default form data strictly typed
451714a
Add strong typing to default form data
f83bb0d
Organize Sass and correct full white background
0f0f8db
Correct typo in deprecated routes
d6f9d8c
Update deprecated routing redirect
e12bb14
Move subscription to changeConfiguration into the onInit and filter o…
ccea5a6
Add comments, move change subscription into ngOnInit
00c082c
Found the color value for the text on disabled dropdowns
abe46ba
Update Client Runs Remove Nodes to only allow days for right now, cod…
77a0eac
Finally have the factory functions workig in spec.ts
a97681a
Made factory function for non-nested jobs and found model should have…
a2c4f54
Test all forms
c8103db
Lint fixes
506c61d
Scss Lint fixes
90b5740
Make JobRequestComponent a model so that I can use it as a contstruct
9c216d1
Modified models and add check against undefined values in building th…
1447946
Update naming of taggle function to handleactivation
388b677
Add test against disabled form elements
b95ccb0
Move site level sass for material to styles.sass
a66820e
Update comment so that its easier to read
5ffd26b
lint fixes
4dd7d4d
Listen to form changes by pristine/dirty instead of formChanged
7809c8e
Update test for value that no longer exists
9db1cb9
Update retention api urls
40f5ba1
Add FormGroup as a type
65b7e1f
Add private function for disabing/enabling form controls
c869dd2
Shorten GetJobForm function, no type checking on it yet
69b3975
Add function signature to splitThreshold
411d631
Add function signature to getJobForm, created an interface for it as …
0da2ee4
Refactor getJobForm
275b462
Formatting to shrink up the html lines taken
8c6d7da
Update model to accept validators, add validation on to all text inputs
a77dae5
spelling
f8886b7
spelling
3749de4
Fix that grey background, turns out two elements needed to be white t…
67920a1
Lint fix
7d0735d
Spelling corrections
b2086c5
Spelling and comment corrections
f2b3b1d
Remove getJobForm function - only needed in one spot
b1bd7bf
Update tests to separate out nested and non-nested into separate tests
9695ee0
Add needed types in model
8844ef4
Adding console.errors in the strange case that a name didn't exist
2e72877
More commenting for clarity
ebbd42e
Update sentence for UX
3848132
Updated test for UX change
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
180 changes: 144 additions & 36 deletions
180
components/automate-ui/src/app/entities/automate-settings/automate-settings.model.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,73 +1,181 @@ | ||
export class JobSchedulerStatus { | ||
running: boolean; | ||
jobs: IngestJob[]; | ||
|
||
constructor(running: boolean, ingestJobs: IngestJob[]) { | ||
this.running = running; | ||
constructor(ingestJobs: IngestJob[]) { | ||
this.jobs = ingestJobs; | ||
} | ||
|
||
getJob(name: string): IngestJob { | ||
return this.jobs.find((job: IngestJob) => job.name === name); | ||
} | ||
} | ||
|
||
export interface ConfigureSettingsRequest { | ||
jobs: IngestJob[]; | ||
} | ||
|
||
export interface RespJob { | ||
running: boolean; | ||
name: string; | ||
every: string; | ||
nested_name?: string; | ||
disabled: boolean; | ||
recurrence: string; | ||
threshold: string; | ||
last_run: Date; | ||
next_run: Date; | ||
last_elapsed: Date; | ||
started_on: Date; | ||
purge_policies: any; // TODO needs specific type | ||
SEAjamieD marked this conversation as resolved.
Show resolved
Hide resolved
|
||
last_elapsed?: Date; | ||
next_due_at?: Date; | ||
last_enqueued_at?: Date; | ||
last_started_at?: Date; | ||
last_ended_at?: Date; | ||
} | ||
|
||
export interface RespJobSchedulerStatus { | ||
running: boolean; | ||
jobs: RespJob[]; | ||
infra: { | ||
jobs: RespJob[]; | ||
}; | ||
compliance: { | ||
jobs: RespJob[]; | ||
}; | ||
event_feed: { | ||
jobs: RespJob[]; | ||
}; | ||
services: { | ||
jobs: RespJob[]; | ||
}; | ||
SEAjamieD marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
|
||
// IngestJobs is an enum that defines the list of jobs that the | ||
// JobScheduler has inside the ingest-service | ||
export enum IngestJobs { | ||
// MissingNodes: Checks when a node hasn't check-in | ||
// for a period of time | ||
MissingNodes = 'missing_nodes', | ||
// EventFeed | ||
EventFeedRemoveData = 'eventFeedRemoveData', | ||
EventFeedServerActions = 'eventFeedServerActions', | ||
|
||
// MissingNodesForDeletion: Checks when a node has been missing | ||
// for a period of time | ||
// Service Groups | ||
ServiceGroupNoHealthChecks = 'serviceGroupNoHealthChecks', | ||
ServiceGroupRemoveServices = 'serviceGroupRemoveServices', | ||
|
||
// Client Runs | ||
ClientRunsRemoveData = 'clientRunsRemoveData', | ||
ClientRunsLabelMissing = 'clientRunsLabelMissing', | ||
ClientRunsRemoveNodes = 'clientRunsRemoveNodes', | ||
|
||
// Compliance | ||
ComplianceRemoveReports = 'complianceRemoveReports', | ||
ComplianceRemoveScans = 'complianceRemoveScans' | ||
} | ||
|
||
export enum JobCategories { | ||
Infra = 'infra', | ||
Compliance = 'compliance', | ||
EventFeed = 'event_feed', | ||
Services = 'services' | ||
} | ||
|
||
export enum InfraJobName { | ||
MissingNodes = 'missing_nodes', | ||
MissingNodesForDeletion = 'missing_nodes_for_deletion', | ||
DeleteNodes = 'delete_nodes', | ||
PeriodicPurgeTimeseries = 'periodic_purge_timeseries' | ||
} | ||
|
||
// DeleteNodes: Removes completely from elasticsearch nodes that | ||
// have been marked for deletion | ||
DeleteNodes = 'delete_nodes' | ||
// Actions and ConvergeHistory are nested, but contained inside | ||
// the InfraJobName of PeriodicPurgeTimeseries | ||
export enum NestedJobName { | ||
ComplianceReports = 'compliance-reports', | ||
ComplianceScans = 'compliance-scans', | ||
Feed = 'feed', | ||
Actions = 'actions', | ||
ConvergeHistory = 'converge-history' | ||
} | ||
|
||
export class IngestJob { | ||
running: boolean; | ||
category: JobCategories; | ||
name: string; | ||
nested_name?: string; | ||
recurrence?: string; | ||
threshold: string; | ||
every?: string; | ||
lastRun?: Date; | ||
nextRun?: Date; | ||
lastElapsed?: Date; | ||
startedOn?: Date; | ||
disabled: boolean; | ||
purge_policies?: any; // TODO needs specific type | ||
older_than_days?: number; | ||
last_elapsed?: Date; | ||
next_due_at?: Date; | ||
last_enqueued_at?: Date; | ||
last_started_at?: Date; | ||
last_ended_at?: Date; | ||
|
||
constructor(respJob: RespJob) { | ||
constructor(category: JobCategories, respJob: RespJob) { | ||
if (respJob !== null) { | ||
this.running = respJob.running; | ||
this.category = category; | ||
this.name = respJob.name; | ||
this.every = respJob.every; | ||
this.nested_name = respJob.nested_name; | ||
this.disabled = respJob.disabled; | ||
this.recurrence = respJob.recurrence; | ||
this.threshold = respJob.threshold; | ||
this.lastRun = new Date(respJob.last_run); | ||
this.nextRun = new Date(respJob.next_run); | ||
this.lastElapsed = new Date(respJob.last_elapsed); | ||
this.startedOn = new Date(respJob.started_on); | ||
this.purge_policies = respJob.purge_policies; | ||
this.last_elapsed = new Date(respJob.last_elapsed); | ||
this.next_due_at = new Date(respJob.next_due_at); | ||
this.last_enqueued_at = new Date(respJob.last_enqueued_at); | ||
this.last_started_at = new Date(respJob.last_started_at); | ||
this.last_ended_at = new Date(respJob.last_ended_at); | ||
} | ||
} | ||
} | ||
|
||
export class UnfurledJob { | ||
disabled: boolean; | ||
policy_name?: string; | ||
older_than_days?: number; | ||
name?: string; | ||
threshold?: string; | ||
} | ||
|
||
// A JobRequestComponent is very flexible so that it may contain | ||
// contain an older API Job object and a newer API Job Object | ||
SEAjamieD marked this conversation as resolved.
Show resolved
Hide resolved
|
||
export class JobRequestComponent { | ||
disabled?: boolean; | ||
name?: string; | ||
threshold?: string | number; | ||
purge_policies?: { | ||
elasticsearch?: UnfurledJob[]; | ||
}; | ||
} | ||
|
||
export interface JobRequestBody { | ||
infra: { | ||
job_settings: JobRequestComponent[]; | ||
}; | ||
compliance: { | ||
job_settings: JobRequestComponent[]; | ||
}; | ||
event_feed: { | ||
job_settings: JobRequestComponent[]; | ||
}; | ||
// services has not yet been implemented so we will leave as optional for now | ||
services?: { | ||
job_settings: JobRequestComponent[]; | ||
}; | ||
} | ||
|
||
export interface SingleDefaultForm { | ||
category: JobCategories; | ||
name?: string; // TODO; make stricter after services implemented | ||
nested_name?: NestedJobName; | ||
unit: { | ||
value: string; | ||
disabled: boolean; | ||
}; | ||
threshold: { | ||
value: string; | ||
disabled: boolean; | ||
}; | ||
disabled: boolean; | ||
} | ||
|
||
export interface DefaultFormData { | ||
eventFeedRemoveData: SingleDefaultForm; | ||
eventFeedServerActions: SingleDefaultForm; | ||
serviceGroupNoHealthChecks: SingleDefaultForm; | ||
serviceGroupRemoveServices: SingleDefaultForm; | ||
clientRunsRemoveData: SingleDefaultForm; | ||
clientRunsLabelMissing: SingleDefaultForm; | ||
clientRunsRemoveNodes: SingleDefaultForm; | ||
complianceRemoveReports: SingleDefaultForm; | ||
complianceRemoveScans: SingleDefaultForm; | ||
} | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 change in nomenclature warrants changes to node-lifecycle.md and/or data-lifecycle.md.
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.
@kagarmoe / @mjingle - Making sure I don't step on any toes here, is this part of documentation or is this a change that I should handle?
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.
I think this is being taken care of already? We're removing any instance of node-lifecycle in the docs per #3170
Also, I'm pretty sure that we're deleting node-lifecycle.md and creating data-lifecycle.md in its place.
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.
data lifecycle docs page already existed, but yah deleting the node lifecycle page.. with a redirect.
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.
ok great - thats the info I was looking for. Thank you!