ing
This commit is contained in:
parent
3af1550821
commit
7852cd0081
|
@ -41,7 +41,7 @@ export class NoAuthProbeListContainerComponent implements OnInit, AfterContentIn
|
||||||
ngAfterContentInit() {
|
ngAfterContentInit() {
|
||||||
this.store.select(AuthSelector.select('domain')).subscribe(
|
this.store.select(AuthSelector.select('domain')).subscribe(
|
||||||
(domain: Domain) => {
|
(domain: Domain) => {
|
||||||
this.store.dispatch(new ListStore.ReadAllByDomain(domain));
|
this.store.dispatch(new ListStore.ReadAllByDomainID(domain.id));
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,15 +19,15 @@ export class NoAuthProbeService {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public readAllByDomain(domain: Domain): Observable<NoAuthProbe[]> {
|
public readAllByDomainID(domainID: number): Observable<NoAuthProbe[]> {
|
||||||
return this.rpcService.call<NoAuthProbe[]>('NoAuthProbeService.readAllByDomain', domain);
|
return this.rpcService.call<NoAuthProbe[]>('NoAuthProbeService.readAllByDomainID', domainID);
|
||||||
}
|
}
|
||||||
|
|
||||||
public acceptNoAuthProbe(noAuthProbe: NoAuthProbe): Observable<NoAuthProbe[]> {
|
public acceptNoAuthProbe(noAuthProbeID: number): Observable<NoAuthProbe[]> {
|
||||||
return this.rpcService.call<NoAuthProbe[]>('NoAuthProbeService.acceptNoAuthProbe', noAuthProbe);
|
return this.rpcService.call<NoAuthProbe[]>('NoAuthProbeService.acceptNoAuthProbe', noAuthProbeID);
|
||||||
}
|
}
|
||||||
|
|
||||||
public denyNoauthProbe(noAuthProbe: NoAuthProbe): Observable<NoAuthProbe[]> {
|
public denyNoauthProbe(noAuthProbeID: number): Observable<NoAuthProbe[]> {
|
||||||
return this.rpcService.call<NoAuthProbe[]>('NoAuthProbeService.denyNoauthProbe', noAuthProbe);
|
return this.rpcService.call<NoAuthProbe[]>('NoAuthProbeService.denyNoauthProbe', noAuthProbeID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,9 +7,9 @@ import { Domain } from '@overflow/commons-typescript/model/domain';
|
||||||
import { NoAuthProbe } from '@overflow/commons-typescript/model/noauth';
|
import { NoAuthProbe } from '@overflow/commons-typescript/model/noauth';
|
||||||
|
|
||||||
export enum ActionType {
|
export enum ActionType {
|
||||||
ReadAllByDomain = '[noauth-proboe.noauth-proboe] ReadAllByDomain',
|
ReadAllByDomainID = '[noauth-proboe.noauth-proboe] ReadAllByDomainID',
|
||||||
ReadAllByDomainSuccess = '[noauth-proboe.noauth-proboe] ReadAllByDomainSuccess',
|
ReadAllByDomainIDSuccess = '[noauth-proboe.noauth-proboe] ReadAllByDomainIDSuccess',
|
||||||
ReadAllByDomainFailure = '[noauth-proboe.noauth-proboe] ReadAllByDomainFailure',
|
ReadAllByDomainIDFailure = '[noauth-proboe.noauth-proboe] ReadAllByDomainIDFailure',
|
||||||
|
|
||||||
Accept = '[noauth-proboe.noauth-proboe] Accept',
|
Accept = '[noauth-proboe.noauth-proboe] Accept',
|
||||||
AcceptSuccess = '[noauth-proboe.noauth-proboe] AcceptSuccess',
|
AcceptSuccess = '[noauth-proboe.noauth-proboe] AcceptSuccess',
|
||||||
|
@ -23,20 +23,20 @@ export enum ActionType {
|
||||||
OnDisconnect = '[noauth-proboe.noauth-proboe] OnDisconnect',
|
OnDisconnect = '[noauth-proboe.noauth-proboe] OnDisconnect',
|
||||||
}
|
}
|
||||||
|
|
||||||
export class ReadAllByDomain implements Action {
|
export class ReadAllByDomainID implements Action {
|
||||||
readonly type = ActionType.ReadAllByDomain;
|
readonly type = ActionType.ReadAllByDomainID;
|
||||||
|
|
||||||
constructor(public payload: Domain) {}
|
constructor(public payload: number) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class ReadAllByDomainSuccess implements Action {
|
export class ReadAllByDomainIDSuccess implements Action {
|
||||||
readonly type = ActionType.ReadAllByDomainSuccess;
|
readonly type = ActionType.ReadAllByDomainIDSuccess;
|
||||||
|
|
||||||
constructor(public payload: NoAuthProbe[]) {}
|
constructor(public payload: NoAuthProbe[]) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class ReadAllByDomainFailure implements Action {
|
export class ReadAllByDomainIDFailure implements Action {
|
||||||
readonly type = ActionType.ReadAllByDomainFailure;
|
readonly type = ActionType.ReadAllByDomainIDFailure;
|
||||||
|
|
||||||
constructor(public payload: RPCClientError) {}
|
constructor(public payload: RPCClientError) {}
|
||||||
}
|
}
|
||||||
|
@ -44,7 +44,7 @@ export class ReadAllByDomainFailure implements Action {
|
||||||
export class Accept implements Action {
|
export class Accept implements Action {
|
||||||
readonly type = ActionType.Accept;
|
readonly type = ActionType.Accept;
|
||||||
|
|
||||||
constructor(public payload: NoAuthProbe) {}
|
constructor(public payload: number) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class AcceptSuccess implements Action {
|
export class AcceptSuccess implements Action {
|
||||||
|
@ -62,7 +62,7 @@ export class AcceptFailure implements Action {
|
||||||
export class Deny implements Action {
|
export class Deny implements Action {
|
||||||
readonly type = ActionType.Deny;
|
readonly type = ActionType.Deny;
|
||||||
|
|
||||||
constructor(public payload: NoAuthProbe) {}
|
constructor(public payload: number) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class DenySuccess implements Action {
|
export class DenySuccess implements Action {
|
||||||
|
@ -91,9 +91,9 @@ export class OnDisconnect implements Action {
|
||||||
|
|
||||||
|
|
||||||
export type Actions =
|
export type Actions =
|
||||||
| ReadAllByDomain
|
| ReadAllByDomainID
|
||||||
| ReadAllByDomainSuccess
|
| ReadAllByDomainIDSuccess
|
||||||
| ReadAllByDomainFailure
|
| ReadAllByDomainIDFailure
|
||||||
| Accept
|
| Accept
|
||||||
| AcceptSuccess
|
| AcceptSuccess
|
||||||
| AcceptFailure
|
| AcceptFailure
|
||||||
|
|
|
@ -22,9 +22,9 @@ import { NoAuthProbe } from '@overflow/commons-typescript/model/noauth';
|
||||||
import { NoAuthProbeService } from '../../service/noauth-probe.service';
|
import { NoAuthProbeService } from '../../service/noauth-probe.service';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
ReadAllByDomain,
|
ReadAllByDomainID,
|
||||||
ReadAllByDomainFailure,
|
ReadAllByDomainIDFailure,
|
||||||
ReadAllByDomainSuccess,
|
ReadAllByDomainIDSuccess,
|
||||||
Accept,
|
Accept,
|
||||||
AcceptSuccess,
|
AcceptSuccess,
|
||||||
AcceptFailure,
|
AcceptFailure,
|
||||||
|
@ -45,14 +45,14 @@ export class Effects {
|
||||||
|
|
||||||
@Effect()
|
@Effect()
|
||||||
readAllByDomain$: Observable<Action> = this.actions$
|
readAllByDomain$: Observable<Action> = this.actions$
|
||||||
.ofType(ActionType.ReadAllByDomain)
|
.ofType(ActionType.ReadAllByDomainID)
|
||||||
.map((action: ReadAllByDomain) => action.payload)
|
.map((action: ReadAllByDomainID) => action.payload)
|
||||||
.switchMap(payload => this.noAuthProbeService.readAllByDomain(payload))
|
.switchMap(payload => this.noAuthProbeService.readAllByDomainID(payload))
|
||||||
.map(noAuthProbes => {
|
.map(noAuthProbes => {
|
||||||
return new ReadAllByDomainSuccess(noAuthProbes);
|
return new ReadAllByDomainIDSuccess(noAuthProbes);
|
||||||
})
|
})
|
||||||
.catch((error: RPCClientError) => {
|
.catch((error: RPCClientError) => {
|
||||||
return of(new ReadAllByDomainFailure(error));
|
return of(new ReadAllByDomainIDFailure(error));
|
||||||
});
|
});
|
||||||
|
|
||||||
@Effect()
|
@Effect()
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import {
|
import {
|
||||||
ReadAllByDomain,
|
ReadAllByDomainID,
|
||||||
ReadAllByDomainFailure,
|
ReadAllByDomainIDFailure,
|
||||||
ReadAllByDomainSuccess,
|
ReadAllByDomainIDSuccess,
|
||||||
Accept,
|
Accept,
|
||||||
AcceptSuccess,
|
AcceptSuccess,
|
||||||
AcceptFailure,
|
AcceptFailure,
|
||||||
|
@ -21,7 +21,7 @@ import { NoAuthProbe } from '@overflow/commons-typescript/model/noauth';
|
||||||
|
|
||||||
export function reducer(state = initialState, action: Actions): State {
|
export function reducer(state = initialState, action: Actions): State {
|
||||||
switch (action.type) {
|
switch (action.type) {
|
||||||
case ActionType.ReadAllByDomain: {
|
case ActionType.ReadAllByDomainID: {
|
||||||
return {
|
return {
|
||||||
...state,
|
...state,
|
||||||
error: null,
|
error: null,
|
||||||
|
@ -29,7 +29,7 @@ export function reducer(state = initialState, action: Actions): State {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
case ActionType.ReadAllByDomainSuccess: {
|
case ActionType.ReadAllByDomainIDSuccess: {
|
||||||
return {
|
return {
|
||||||
...state,
|
...state,
|
||||||
error: null,
|
error: null,
|
||||||
|
@ -38,7 +38,7 @@ export function reducer(state = initialState, action: Actions): State {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
case ActionType.ReadAllByDomainFailure: {
|
case ActionType.ReadAllByDomainIDFailure: {
|
||||||
return {
|
return {
|
||||||
...state,
|
...state,
|
||||||
error: action.payload,
|
error: action.payload,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user