-
Notifications
You must be signed in to change notification settings - Fork 113
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
Associate project for every organisation fetched #6518
Closed
Closed
Changes from all commits
Commits
Show all changes
133 commits
Select commit
Hold shift + click to select a range
45d13b0
Script added for table 'users' (#5722)
sonali523 5729342
iam added on roles tab
iamazzeez f0554d2
add fallback and bldr channel env vars to envrc and set back to dev w…
ae9d1f9
Script added for table 'org_users' (#5738)
sonali523 4f43167
added edit policy
iamazzeez 5c9a0d1
Storage functions for users table (#5731)
sonali523 543dc60
Chaitali/add server slider (#5728)
chaitali-mane c75dfde
environments create, delete policy added
iamazzeez a73aea5
edit env policy added
iamazzeez 3f047d0
added data bags policy
iamazzeez 4b65226
Chaitali/add server slider (#5728)
chaitali-mane 10adf5f
ui three dots fix
iamazzeez a7b783c
reverted iam actions
iamazzeez 10b76d2
Add changes for the create server slider (#5755)
vinay033 19df623
removed roles iam
iamazzeez c12aff2
environments authz reverted
iamazzeez d1c56af
databags authz reverted
iamazzeez 0c6f190
Added API to get server users list from backend DB (#5760)
sonali523 8c95dc8
Added users tab in server details page (#5802)
chaitali-mane ad97024
Added css change for notification overlap slider. (#5781)
himanshi-chhabra 4d874d1
Command to add the sample automate infra server users (#5786)
sonali523 817ad59
Renaming the sql files and modifying to incorporate WebUI key
kalroy 45a9573
infra_server_actions tests
iamazzeez 31eb720
infra server list doc update
iamazzeez d7eee2d
test cases fix
iamazzeez e007327
lint fixes
iamazzeez 1cdcb71
added infra server get test cases
iamazzeez a8a3863
create infra server test case
iamazzeez d9e63e1
added infra server create test case
iamazzeez 981fa9b
updated docs
iamazzeez 46f5b47
infra server put and delete test case added
iamazzeez fab62d6
wrapped server details into put api
iamazzeez bb2da83
wrapped delete button into delete action
iamazzeez 340ed6b
error fix
iamazzeez 3e3e399
cypress error fix
iamazzeez 54b3ad0
doc formatted
iamazzeez 32625f5
typo
iamazzeez 0b53c21
Abdul/org actions (#5838)
iamazzeez 8b33942
typo
iamazzeez 7bbbbe2
Abdul/cookbooks actions (#5848)
iamazzeez 5c67d1f
Abdul/roles actions (#5853)
iamazzeez a187f2a
Abdul/environments actions (#5898)
iamazzeez 675b991
Abdul/databag item actions (#6049)
iamazzeez 4975f79
lint fix
iamazzeez 7291866
policyfiles actions added (#6081)
iamazzeez a73b310
added policygroups actions (#6123)
iamazzeez 29b090c
infra_server_actions tests
iamazzeez e40e2ca
infra server list doc update
iamazzeez 8a41273
test cases fix
iamazzeez 229b96e
lint fixes
iamazzeez 4e9f791
added infra server get test cases
iamazzeez bfe36f4
create infra server test case
iamazzeez 51a7b50
added infra server create test case
iamazzeez 5800319
updated docs
iamazzeez 52ecc57
infra server put and delete test case added
iamazzeez 97c97cf
cypress error fix
iamazzeez 1ed82fb
doc formatted
iamazzeez a0fe143
typo
iamazzeez c8009f7
Abdul/cookbooks actions (#5848)
iamazzeez 62521a4
Abdul/roles actions (#5853)
iamazzeez e8a6975
Abdul/environments actions (#5898)
iamazzeez 144e4b1
rebase error fix
iamazzeez 1c36187
rebase fix
iamazzeez a147421
rebase error fix
iamazzeez 81c8c7c
iam permission to create, delete, get client (#6227)
iamazzeez 0630a1b
added nodes iam actions (#6275)
iamazzeez 5729bb8
infra_server_actions tests
iamazzeez 7e46415
infra server list doc update
iamazzeez 616b5bc
test cases fix
iamazzeez 7150fed
lint fixes
iamazzeez 59554b4
added infra server get test cases
iamazzeez 3866503
create infra server test case
iamazzeez 8858823
added infra server create test case
iamazzeez 352051a
updated docs
iamazzeez 8097436
infra server put and delete test case added
iamazzeez d603db4
wrapped delete button into delete action
iamazzeez fe96a5d
cypress error fix
iamazzeez 8d99022
doc formatted
iamazzeez b453414
typo
iamazzeez e10b743
Abdul/cookbooks actions (#5848)
iamazzeez 7b8b458
Abdul/roles actions (#5853)
iamazzeez f00e936
Abdul/environments actions (#5898)
iamazzeez 0294395
Abdul/databag item actions (#6049)
iamazzeez 2969f54
policyfiles actions added (#6081)
iamazzeez ef01cc1
added policygroups actions (#6123)
iamazzeez ec2b063
infra_server_actions tests
iamazzeez ba49e44
infra server list doc update
iamazzeez 02efeef
test cases fix
iamazzeez 306a603
lint fixes
iamazzeez 7bb4905
added infra server get test cases
iamazzeez db7b88f
create infra server test case
iamazzeez 83b60d0
added infra server create test case
iamazzeez ea284b5
updated docs
iamazzeez 1c4e4f1
infra server put and delete test case added
iamazzeez c6af172
cypress error fix
iamazzeez 2968333
doc formatted
iamazzeez 857412c
typo
iamazzeez 55af127
Abdul/cookbooks actions (#5848)
iamazzeez 1c5754e
Abdul/roles actions (#5853)
iamazzeez 1527f49
Abdul/databag item actions (#6049)
iamazzeez 11e2107
policyfiles actions added (#6081)
iamazzeez 1c10b45
added policygroups actions (#6123)
iamazzeez 9502a8c
rebase fix
iamazzeez 6cc0325
iam permission to create, delete, get client (#6227)
iamazzeez 0c22276
added nodes iam actions (#6275)
iamazzeez 3036b2c
added node test cases
iamazzeez ae5f068
docs fix
iamazzeez c6e976d
Added pb files after proto compilation to fix the panic error
sonali523 51dc1dc
api/external/infra_proxy/infra_proxy.pb.go
sonali523 43cd23c
added some minor changes
vinay033 5c51dd2
commented code
chaitali-mane c4963b9
database scripts added (#6351)
sonali523 10c05e2
WebUI key into add chef-server slider (#6357)
chaitali-mane b4cdd16
Create server API - create the chef server using the webui key (#6376)
vinay033 3efc2ea
API to validate the webui key (#6364)
vinay033 baed03b
Added Update web ui key slider (#6372)
chaitali-mane 5852e03
UI-API integration for web UI key (#6387)
chaitali-mane cf2540c
Infra proxy API to get the organisation of chef server (#6363)
sonali523 2f37b4d
Server details page - UI should have the option to update the WebUI …
vinay033 f04337f
Show the validation status of the WebUI key on the Chef Server Metada…
vinay033 5c0993f
API to update the web ui key (#6433)
sonali523 9445da5
infra_viewer_actions added (#6436)
iamazzeez 964bb41
Abdul/infra editor actions (#6453)
iamazzeez e2ec1b7
Changes to use web ui key in all the Infra Proxy APIs for Cookbooks, …
sonali523 eca1a1b
Database script for migration tables (#6500)
sonali523 4309076
Abdul/infra editor actions (#6508)
iamazzeez 3444624
Abdul/infra project owner (#6512)
iamazzeez 0f5b1ad
Changes from remote
cea6386
stash changes
2737de0
Changes for conflict
2b196f5
Changes for PR
5074ca2
Merge changes
1dce96b
Rebase changes
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
146 changes: 146 additions & 0 deletions
146
...app/modules/infra-proxy/update-web-uikey-slider/update-web-uikey-slider.component.spec.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 |
---|---|---|
@@ -0,0 +1,146 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
import { MockComponent } from 'ng2-mock-component'; | ||
import { ReactiveFormsModule, FormBuilder, Validators, FormGroup } from '@angular/forms'; | ||
import { UpdateWebUIKeySliderComponent } from './update-web-uikey-slider.component'; | ||
import { StoreModule, Store } from '@ngrx/store'; | ||
import { NgrxStateAtom, ngrxReducers, runtimeChecks } from 'app/ngrx.reducers'; | ||
import { HttpClient, HttpHandler } from '@angular/common/http'; | ||
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; | ||
import { Regex } from 'app/helpers/auth/regex'; | ||
import { using } from 'app/testing/spec-helpers'; | ||
import { WebUIKey } from 'app/entities/servers/server.model'; | ||
import { UpdateWebUIKeyFailure, UpdateWebUIKeySuccess } from 'app/entities/servers/server.actions'; | ||
import { HttpStatus } from 'app/types/types'; | ||
import { HttpErrorResponse } from '@angular/common/http'; | ||
|
||
describe('UpdateWebUIKeySliderComponent', () => { | ||
let component: UpdateWebUIKeySliderComponent; | ||
let fixture: ComponentFixture<UpdateWebUIKeySliderComponent>; | ||
|
||
let updateKeyForm: FormGroup; | ||
let errors = {}; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
declarations: [ | ||
MockComponent({ selector: 'chef-button', inputs: ['disabled'] }), | ||
MockComponent({ selector: 'chef-error' }), | ||
MockComponent({ selector: 'chef-icon' }), | ||
MockComponent({ selector: 'chef-form-field' }), | ||
MockComponent({ selector: 'chef-loading-spinner' }), | ||
UpdateWebUIKeySliderComponent | ||
], | ||
imports: [ | ||
ReactiveFormsModule, | ||
StoreModule.forRoot(ngrxReducers, { runtimeChecks }) | ||
], | ||
providers: [ | ||
HttpClient, | ||
HttpHandler | ||
], | ||
schemas: [ CUSTOM_ELEMENTS_SCHEMA ] | ||
}) | ||
.compileComponents(); | ||
}); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(UpdateWebUIKeySliderComponent); | ||
component = fixture.componentInstance; | ||
component.updateWebuiKeyForm = new FormBuilder().group({ | ||
webuikey: ['', [Validators.required, Validators.pattern(Regex.patterns.NON_BLANK), | ||
Validators.pattern(Regex.patterns.NO_WILDCARD_ALLOW_HYPHEN)]] | ||
}); | ||
updateKeyForm = component.updateWebuiKeyForm; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
|
||
describe('form validity', () => { | ||
describe('the form should be invalid', () => { | ||
it('when all inputs are empty', () => { | ||
expect(updateKeyForm.valid).toBeFalsy(); | ||
}); | ||
|
||
it('when webuikey is missing', () => { | ||
|
||
errors = updateKeyForm.controls['webuikey'].errors || {}; | ||
|
||
expect(updateKeyForm.valid).toBeFalsy(); | ||
expect(errors['required']).toBeTruthy(); | ||
}); | ||
}); | ||
|
||
describe('the form should be valid', () => { | ||
it('when all inputs are filled and valid', () => { | ||
expect(updateKeyForm.valid).toBeFalsy(); | ||
updateKeyForm.controls['webuikey'].setValue('WebUIKey'); | ||
expect(updateKeyForm.valid).toBeTruthy(); | ||
}); | ||
|
||
using([ | ||
['contains numbers range 0-9.', 'WebUIKey123'], | ||
['contains alphabets a-z', 'WebUIKey-test'], | ||
['contains underscore.', 'WebUIKey_test'], | ||
['contains hyphen, minus, or dash.', 'WebUIKey_test-1'], | ||
['has mixed characters', 'WebUIKey-Test_10'] | ||
], function (description: string, input: string) { | ||
it(('when the webuikey ' + description), () => { | ||
|
||
updateKeyForm.controls['webuikey'].setValue(input); | ||
errors = updateKeyForm.controls['webuikey'].errors || {}; | ||
|
||
expect(updateKeyForm.valid).toBeTruthy(); | ||
expect(errors['pattern']).toBeFalsy(); | ||
}); | ||
}); | ||
}); | ||
}); | ||
|
||
describe('#webuikey', () => { | ||
let store: Store<NgrxStateAtom>; | ||
const webuikey: WebUIKey = { | ||
id: 'test_server', | ||
webui_key: 'test_webuikey' | ||
}; | ||
|
||
beforeEach(() => { | ||
store = TestBed.inject(Store); | ||
}); | ||
|
||
it('render the UI Key Slider', () => { | ||
component.slidePanel(); | ||
expect(component.isSlideOpen).toBe(true); | ||
}); | ||
|
||
it('should be invalid when no fields are filled out', () => { | ||
expect(component.updateWebuiKeyForm.valid).toBeFalsy(); | ||
}); | ||
|
||
it('should be valid when all fields are filled out', () => { | ||
component.updateWebuiKeyForm.controls['webuikey'].setValue(webuikey.webui_key); | ||
expect(component.updateWebuiKeyForm.valid).toBeTruthy(); | ||
}); | ||
|
||
it('hide slider after updating webuikey.', () => { | ||
component.updateWebuiKeyForm.controls['webuikey'].setValue(webuikey.webui_key); | ||
component.updateWebUIkey(); | ||
|
||
store.dispatch(new UpdateWebUIKeySuccess(webuikey)); | ||
}); | ||
|
||
it('on create , slider is closed with failure banner', () => { | ||
component.updateWebuiKeyForm.controls['webuikey'].setValue(webuikey.webui_key); | ||
component.updateWebUIkey(); | ||
|
||
const error = <HttpErrorResponse>{ | ||
status: HttpStatus.INTERNAL_SERVER_ERROR, | ||
ok: false | ||
}; | ||
store.dispatch(new UpdateWebUIKeyFailure(error)); | ||
expect(component.conflictError).toBe(false); | ||
}); | ||
}); | ||
}); |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -196,4 +196,4 @@ describe('Infra Viewer Policy', () => { | |
assert.equal(resp.status, 403); | ||
}); | ||
}); | ||
}); | ||
}); |
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
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.
Will it create the policies too for the project?
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.
Yes, we are passing skip policies as false, therefore its creating project with all the policies.