forked from apache/nifi
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
444 additions
and
8 deletions.
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
41 changes: 41 additions & 0 deletions
41
...entation/state/flow-registry-client-definition/flow-registry-client-definition.actions.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,41 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import { createAction, props } from '@ngrx/store'; | ||
import { FlowRegistryClientDefinition } from './index'; | ||
import { DefinitionCoordinates } from '../index'; | ||
|
||
const FLOW_REGISTRY_CLIENT_DEFINITION_PREFIX = '[Flow Registry Client Definition]'; | ||
|
||
export const loadFlowRegistryClientDefinition = createAction( | ||
`${FLOW_REGISTRY_CLIENT_DEFINITION_PREFIX} Load Flow Registry Client Definition`, | ||
props<{ coordinates: DefinitionCoordinates }>() | ||
); | ||
|
||
export const loadFlowRegistryClientDefinitionSuccess = createAction( | ||
`${FLOW_REGISTRY_CLIENT_DEFINITION_PREFIX} Load Flow Registry Client Definition Success`, | ||
props<{ flowRegistryClientDefinition: FlowRegistryClientDefinition }>() | ||
); | ||
|
||
export const flowRegistryClientDefinitionApiError = createAction( | ||
`${FLOW_REGISTRY_CLIENT_DEFINITION_PREFIX} Load Flow Registry Client Definition Error`, | ||
props<{ error: string }>() | ||
); | ||
|
||
export const resetFlowRegistryClientDefinitionState = createAction( | ||
`${FLOW_REGISTRY_CLIENT_DEFINITION_PREFIX} Reset Flow Registry Client Definition State` | ||
); |
57 changes: 57 additions & 0 deletions
57
...entation/state/flow-registry-client-definition/flow-registry-client-definition.effects.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,57 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import { Injectable } from '@angular/core'; | ||
import { Actions, createEffect, ofType } from '@ngrx/effects'; | ||
import * as FlowRegistryClientDefinitionActions from './flow-registry-client-definition.actions'; | ||
import { catchError, from, map, of, switchMap } from 'rxjs'; | ||
import { ErrorHelper } from '../../../../service/error-helper.service'; | ||
import { HttpErrorResponse } from '@angular/common/http'; | ||
import { DocumentationService } from '../../service/documentation.service'; | ||
import { FlowRegistryClientDefinition } from './index'; | ||
|
||
@Injectable() | ||
export class FlowRegistryClientDefinitionEffects { | ||
constructor( | ||
private actions$: Actions, | ||
private documentationService: DocumentationService, | ||
private errorHelper: ErrorHelper | ||
) {} | ||
|
||
loadFlowRegistryClientDefinition$ = createEffect(() => | ||
this.actions$.pipe( | ||
ofType(FlowRegistryClientDefinitionActions.loadFlowRegistryClientDefinition), | ||
map((action) => action.coordinates), | ||
switchMap((coordinates) => | ||
from(this.documentationService.getFlowRegistryClientDefinition(coordinates)).pipe( | ||
map((flowRegistryClientDefinition: FlowRegistryClientDefinition) => | ||
FlowRegistryClientDefinitionActions.loadFlowRegistryClientDefinitionSuccess({ | ||
flowRegistryClientDefinition | ||
}) | ||
), | ||
catchError((errorResponse: HttpErrorResponse) => | ||
of( | ||
FlowRegistryClientDefinitionActions.flowRegistryClientDefinitionApiError({ | ||
error: this.errorHelper.getErrorString(errorResponse) | ||
}) | ||
) | ||
) | ||
) | ||
) | ||
) | ||
); | ||
} |
54 changes: 54 additions & 0 deletions
54
...entation/state/flow-registry-client-definition/flow-registry-client-definition.reducer.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,54 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import { FlowRegistryClientDefinitionState } from './index'; | ||
import { createReducer, on } from '@ngrx/store'; | ||
import { | ||
loadFlowRegistryClientDefinition, | ||
loadFlowRegistryClientDefinitionSuccess, | ||
flowRegistryClientDefinitionApiError, | ||
resetFlowRegistryClientDefinitionState | ||
} from './flow-registry-client-definition.actions'; | ||
|
||
export const initialState: FlowRegistryClientDefinitionState = { | ||
flowRegistryClientDefinition: null, | ||
error: null, | ||
status: 'pending' | ||
}; | ||
|
||
export const flowRegistryClientDefinitionReducer = createReducer( | ||
initialState, | ||
on(loadFlowRegistryClientDefinition, (state) => ({ | ||
...state, | ||
status: 'loading' as const | ||
})), | ||
on(loadFlowRegistryClientDefinitionSuccess, (state, { flowRegistryClientDefinition }) => ({ | ||
...state, | ||
flowRegistryClientDefinition, | ||
error: null, | ||
status: 'success' as const | ||
})), | ||
on(flowRegistryClientDefinitionApiError, (state, { error }) => ({ | ||
...state, | ||
flowRegistryClientDefinition: null, | ||
error, | ||
status: 'error' as const | ||
})), | ||
on(resetFlowRegistryClientDefinitionState, () => ({ | ||
...initialState | ||
})) | ||
); |
25 changes: 25 additions & 0 deletions
25
...tation/state/flow-registry-client-definition/flow-registry-client-definition.selectors.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,25 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import { createSelector } from '@ngrx/store'; | ||
import { DocumentationState, selectDocumentationState } from '../index'; | ||
import { flowRegistryClientDefinitionFeatureKey } from './index'; | ||
|
||
export const selectFlowRegistryClientDefinitionState = createSelector( | ||
selectDocumentationState, | ||
(state: DocumentationState) => state[flowRegistryClientDefinitionFeatureKey] | ||
); |
28 changes: 28 additions & 0 deletions
28
...tend/apps/nifi/src/app/pages/documentation/state/flow-registry-client-definition/index.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,28 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import { ConfigurableExtensionDefinition } from '../index'; | ||
|
||
export const flowRegistryClientDefinitionFeatureKey = 'flowRegistryClientDefinition'; | ||
|
||
export interface FlowRegistryClientDefinition extends ConfigurableExtensionDefinition {} | ||
|
||
export interface FlowRegistryClientDefinitionState { | ||
flowRegistryClientDefinition: FlowRegistryClientDefinition | null; | ||
error: string | null; | ||
status: 'pending' | 'loading' | 'success' | 'error'; | ||
} |
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
33 changes: 33 additions & 0 deletions
33
...ntation/ui/flow-registry-client-definition/flow-registry-client-definition.component.html
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,33 @@ | ||
<!-- | ||
~ Licensed to the Apache Software Foundation (ASF) under one or more | ||
~ contributor license agreements. See the NOTICE file distributed with | ||
~ this work for additional information regarding copyright ownership. | ||
~ The ASF licenses this file to You under the Apache License, Version 2.0 | ||
~ (the "License"); you may not use this file except in compliance with | ||
~ the License. You may obtain a copy of the License at | ||
~ | ||
~ http://www.apache.org/licenses/LICENSE-2.0 | ||
~ | ||
~ Unless required by applicable law or agreed to in writing, software | ||
~ distributed under the License is distributed on an "AS IS" BASIS, | ||
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
~ See the License for the specific language governing permissions and | ||
~ limitations under the License. | ||
--> | ||
|
||
@if (flowRegistryClientDefinitionState) { | ||
@if (isInitialLoading(flowRegistryClientDefinitionState)) { | ||
<ngx-skeleton-loader count="3"></ngx-skeleton-loader> | ||
} @else { | ||
@if (flowRegistryClientDefinitionState.flowRegistryClientDefinition; as flowRegistryClientDefinition) { | ||
<div class="flex flex-col gap-y-4 p-4"> | ||
<configurable-extension-definition | ||
[configurableExtensionDefinition]="flowRegistryClientDefinition"></configurable-extension-definition> | ||
</div> | ||
} @else if (flowRegistryClientDefinitionState.error) { | ||
<div class="p-4"> | ||
{{ flowRegistryClientDefinitionState.error }} | ||
</div> | ||
} | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
...ntation/ui/flow-registry-client-definition/flow-registry-client-definition.component.scss
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,16 @@ | ||
/*! | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ |
Oops, something went wrong.