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

Invite users to an org or space #3377

Merged
merged 58 commits into from
Feb 19, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
8c86ef7
Merge remote-tracking branch 'origin/v2-master' into invite-users
nwmac Jan 25, 2019
366869b
WIP
nwmac Jan 25, 2019
04ad893
WIP - Add stepper with new step, routing and list button (tbd)
richard-cox Jan 25, 2019
b59bb53
WIP - Added stacked input & mostly fleshed out
richard-cox Jan 29, 2019
46ef39a
WIP - Flesh out step 1 with instructions, special case of space level
richard-cox Jan 29, 2019
28ea51c
Add email library
nwmac Jan 30, 2019
93cd3ed
v2/v3 api docs updates
richard-cox Jan 25, 2019
9c2b5dc
wire in perms, cleared many todos
richard-cox Jan 30, 2019
0bbc74b
Merge remote-tracking branch 'origin/invite-users' into invite-users-2
richard-cox Jan 31, 2019
d79cb13
WIP backend
nwmac Jan 31, 2019
292a79d
Merge remote-tracking branch 'origin/invite-users' into invite-users-2
richard-cox Jan 31, 2019
30b7396
Wire in request
richard-cox Jan 31, 2019
70f002f
Remove other steps, fix & tidy up
richard-cox Feb 1, 2019
66546a8
Fix dupe entries
richard-cox Feb 1, 2019
3602acf
Return + focus
richard-cox Feb 1, 2019
8a3d171
Tweaks
richard-cox Feb 4, 2019
1da601c
Tweaks
richard-cox Feb 4, 2019
a95f61e
Fix tests
richard-cox Feb 4, 2019
b9c1454
Merge remote-tracking branch 'origin/v2-master' into invite-users
richard-cox Feb 4, 2019
8585502
CC and lint fixes
richard-cox Feb 4, 2019
e9d53d9
Basic docs, test fixes
richard-cox Feb 4, 2019
4c909f7
MD lint fixes
richard-cox Feb 5, 2019
aece246
Only show invite configure button if cf admin, tweak message for non-…
richard-cox Feb 5, 2019
bc27492
Fix `other` suite e2e tests
richard-cox Feb 5, 2019
887aab0
Improve wait for users table
richard-cox Feb 5, 2019
42599f6
Fix backend test
richard-cox Feb 5, 2019
2944bc6
Fix unit test, allow more time for e2e loading users
richard-cox Feb 5, 2019
ad8eb90
Unit test tweak
richard-cox Feb 6, 2019
fa1855c
Doc fix, tweak for unit tests
richard-cox Feb 6, 2019
66219a7
To Revert - e2e debug
richard-cox Feb 6, 2019
adcc443
Revert "To Revert - e2e debug"
richard-cox Feb 7, 2019
8ceae43
Fix forever loading users list on systems with no smpt config
richard-cox Feb 7, 2019
0afc77e
CC Fixes
richard-cox Feb 7, 2019
501b77c
Add close option to config invite client snack bar
richard-cox Feb 7, 2019
e3fab3b
Add confirmation and error snackbar to disable user invite
richard-cox Feb 7, 2019
8551357
Check scopes and use token for creating user in CF
nwmac Feb 8, 2019
6cd885b
Merge remote-tracking branch 'origin/v2-master' into invite-users
nwmac Feb 12, 2019
93eead1
Update user invite to Echo V3 API
nwmac Feb 12, 2019
ca17c21
Unit test fix
nwmac Feb 12, 2019
086dcfe
Fix front-end unit test
nwmac Feb 12, 2019
9f72548
Add permission check
nwmac Feb 13, 2019
0b2ba30
Three changes
richard-cox Feb 12, 2019
cbf358f
Move invite users button to above user tables
richard-cox Feb 13, 2019
69c06a7
Fix doc readme cc warnings
richard-cox Feb 13, 2019
d442ee3
Minor tidy-ups
nwmac Feb 14, 2019
3fef4f6
Merge branch 'v2-master' into invite-users
KlapTrap Feb 15, 2019
40058aa
Fix imports
KlapTrap Feb 15, 2019
283b5a0
Update docs
KlapTrap Feb 15, 2019
159a5ef
Update the docs guide
KlapTrap Feb 18, 2019
db04bb3
Update invite users text
KlapTrap Feb 18, 2019
ecea0ad
Minor change to the invite table header
KlapTrap Feb 18, 2019
af6e698
Small text change
KlapTrap Feb 18, 2019
a55a88a
Minor text change
KlapTrap Feb 18, 2019
b108d71
Merge remote-tracking branch 'origin/v2-master' into invite-users
richard-cox Feb 18, 2019
73793bc
Merge fixes
richard-cox Feb 18, 2019
93d8719
Update fetch all users max pagination
richard-cox Feb 18, 2019
2090f70
CC Fixed and copy change
KlapTrap Feb 18, 2019
656e3ff
CC Fix
KlapTrap Feb 18, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
WIP - Added stacked input & mostly fleshed out
  • Loading branch information
richard-cox committed Jan 29, 2019
commit b59bb536c16e7594a8a25f549864b2104f5bae80
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ import { UsersRolesComponent } from './users/manage-users/manage-users.component
CloudFoundryRoutesComponent,
UserInviteConfigurationDialogComponent,
InviteUsersComponent,
InviteUsersCreateComponent
InviteUsersCreateComponent,
],
providers: [
CFEndpointsListConfigService,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
<p>
invite-users-create works!
</p>
<app-stacked-input-actions [state$]="state.asObservable()" (update)="updateUsers($event)"></app-stacked-input-actions>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
:host {
flex: 1;
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import { Component, OnDestroy, OnInit } from '@angular/core';
import { Observable, of as observableOf } from 'rxjs';
import { BehaviorSubject, Observable, of as observableOf } from 'rxjs';

import {
StackedInputActionsState,
StackedInputActionsUpdate,
} from '../../../../../shared/components/stacked-input-actions/stacked-input-actions.component';
import { ActiveRouteCfOrgSpace } from '../../../cf-page.types';

@Component({
selector: 'app-invite-users-create',
Expand All @@ -8,9 +14,21 @@ import { Observable, of as observableOf } from 'rxjs';
})
export class InviteUsersCreateComponent implements OnInit, OnDestroy {

valid$: Observable<boolean> = observableOf(false);
valid$: Observable<boolean>;
stepValid = new BehaviorSubject<boolean>(false);
// state$: Observable<StackedInputActionsState[]>;
state = new BehaviorSubject<StackedInputActionsState[]>([]);
isSpace = false;
// createUserResults$: Observable<StackedInputActionsState[]>;

constructor() { }
constructor(private activeRouteCfOrgSpace: ActiveRouteCfOrgSpace) {
this.valid$ = this.stepValid.asObservable();
this.isSpace = !!this.activeRouteCfOrgSpace.spaceGuid || true; // TODO: RC
}

updateUsers(users: StackedInputActionsUpdate) {
this.stepValid.next(users.valid);
}

ngOnInit() {
}
Expand Down Expand Up @@ -47,7 +65,8 @@ export class InviteUsersCreateComponent implements OnInit, OnDestroy {

onNext = () => {
// this.store.dispatch(new UsersRolesSetUsers(this.cfUserService.activeRouteCfOrgSpace.cfGuid, [user.entity]));

// TODO: RC wire in invite service create user function to here
// TODO: RC what happens if some pass and some fail? Do we re-attempt the passed?
return observableOf({ success: false });
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ export enum BooleanIndicatorType {
unlockedLocked = 'unlocked-locked',
yesNo = 'yes-no',
trueFalse = 'true-false',
healthyUnhealthy = 'healthy-unhealthy'
healthyUnhealthy = 'healthy-unhealthy',
succeededFailed = 'success-failed'
}


Expand All @@ -32,10 +33,12 @@ export class BooleanIndicatorComponent {
Enabled: 'check_circle',
Healthy: 'check_circle',
True: 'check_circle',
Succeeded: 'check_circle',
Add: 'add_circle',
No: 'highlight_off',
Disabled: 'highlight_off',
Unhealthy: 'highlight_off',
Failed: 'remove_circle',
False: 'highlight_off',
Remove: 'remove_circle',
Locked: 'lock_outline',
Expand All @@ -52,7 +55,7 @@ export class BooleanIndicatorComponent {
return this.capitalizeFirstLetter(value ? enabledText : disabledText);
}

getTypeText = (s) => s.split('-');
getTypeText = (s: string) => s.split('-');

capitalizeFirstLetter = (string) => string.charAt(0).toUpperCase() + string.slice(1);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!-- // TODO: rc generic validation OR change name -->
<div class="input-action">
<form class="input-action__form stepper-form">
<mat-form-field class="">
<input matInput placeholder="Email" [formControl]="emailFormControl">
<mat-error *ngIf="emailFormControl.hasError('email') && !emailFormControl.hasError('required')">
Please enter a valid email address
</mat-error>
<mat-error *ngIf="emailFormControl.hasError('required')">
Email is required
</mat-error>
</mat-form-field>
</form>
<div class="input-action__detail">
<mat-icon class="input-action__detail__remove" (click)="remove.emit()">indeterminate_check_box</mat-icon>
<div *ngIf="state" class="input-action__detail__result">
<app-boolean-indicator *ngIf="state.result === result.SUCCEEDED || state.result === result.FAILED" [isTrue]="state.result === result.SUCCEEDED" type="succeeded-failed"></app-boolean-indicator>
{{ state.message }}
</div>
</div>

</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
.input-action {
align-items: center;
display: flex;
// flex-direction: row;

> *, &__detail > *, &__detail__result app-boolean-indicator { // TODO: RC flatten
margin-right: 10px;
}

&__form {
align-items: center;
flex: 1;
flex-direction: row;
}
&__detail {
align-items: center;
display: flex;
margin-top: 20px;
> * {
// margin-right: 10px;
}

&__remove {
cursor: pointer;
// padding-left: 10px;
}

&__result {
align-items: center;
display: flex;
app-boolean-indicator {
// margin-right: 10px;
}
}
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';

import { StackedInputActionComponent } from './stacked-input-action.component';

describe('StackedInputActionComponent', () => {
let component: StackedInputActionComponent;
let fixture: ComponentFixture<StackedInputActionComponent>;

beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ StackedInputActionComponent ]
})
.compileComponents();
}));

beforeEach(() => {
fixture = TestBed.createComponent(StackedInputActionComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import { Component, EventEmitter, Input, OnDestroy, OnInit, Output } from '@angular/core';
import { FormControl, Validators } from '@angular/forms';
import { Observable, Subscription } from 'rxjs';

import { safeUnsubscribe } from '../../../../core/utils.service';
import { StackedInputActionsState } from '../stacked-input-actions.component';

export enum StackedInputActionResult {
PROCESSING = 'PROCESSING',
SUCCEEDED = 'SUCCEEDED',
FAILED = 'FAILED'
}

export interface StackedInputActionUpdate { value: string; valid: boolean; }

@Component({
selector: 'app-stacked-input-action',
templateUrl: './stacked-input-action.component.html',
styleUrls: ['./stacked-input-action.component.scss']
})
export class StackedInputActionComponent implements OnInit, OnDestroy {


@Input() state$: Observable<StackedInputActionsState>;
result = StackedInputActionResult;
@Output() update = new EventEmitter<StackedInputActionUpdate>();
@Output() remove = new EventEmitter<any>();

emailFormControl = new FormControl('', [
Validators.required,
Validators.email,
]);
state: StackedInputActionsState;
subs: Subscription[] = [];

constructor() { }

ngOnInit() {
this.subs.push(this.emailFormControl.valueChanges.subscribe((value) => {
this.update.emit({ value, valid: this.emailFormControl.valid });
}));

this.subs.push(this.state$.subscribe(incState => {
this.state = incState;
if (incState && incState.result === StackedInputActionResult.PROCESSING) {
this.emailFormControl.disable();
} else {
this.emailFormControl.enable();
}
}));
}

ngOnDestroy(): void {
safeUnsubscribe(...this.subs);
}


}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<div class="stacked-input__inputs">
<div #inputs></div>
</div>
<button class="stacked-input__add" mat-button color="accent" (click)="add()">Add another <mat-icon class="">add_box</mat-icon></button>
<!-- <span class="stacked-input__add" (click)="add()">Add another <mat-icon class="">add_box</mat-icon></span> -->
<!-- <mat-icon class="" (click)="add()">person_add</mat-icon> -->
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.stacked-input {
&__add {
// cursor: pointer;
.mat-button-wrapper {
align-items: center;
display: flex;
}

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';

import { StackedInputActionsComponent } from './stacked-input-actions.component';

describe('StackedInputActionsComponent', () => {
let component: StackedInputActionsComponent;
let fixture: ComponentFixture<StackedInputActionsComponent>;

beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ StackedInputActionsComponent ]
})
.compileComponents();
}));

beforeEach(() => {
fixture = TestBed.createComponent(StackedInputActionsComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
Loading