-
Notifications
You must be signed in to change notification settings - Fork 9
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
16 changed files
with
611 additions
and
259 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
58 changes: 58 additions & 0 deletions
58
dynamic-mapping-ui/src/mapping/grid/advisor/advice-action.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,58 @@ | ||
<!-- | ||
~ Copyright (c) 2022 Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, | ||
~ and/or its subsidiaries and/or its affiliates and/or their licensors. | ||
~ | ||
~ SPDX-License-Identifier: Apache-2.0 | ||
~ | ||
~ Licensed 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. | ||
~ | ||
~ @authors Christof Strack | ||
--> | ||
|
||
<div class="modal-header dialog-header animated fadeIn"> | ||
<h1 c8yIcon="plus-circle"></h1> | ||
<h4>Select next step</h4> | ||
</div> | ||
|
||
<c8y-modal | ||
(onClose)="onClose()" | ||
(onDismiss)="onDismiss()" | ||
[labels]="labels" | ||
[disabled]="!valid" | ||
> | ||
<div> | ||
<p class="text-center text-medium text-16 sticky-top bg-white"> | ||
{{ 'Select next step ... ' | translate }} | ||
</p> | ||
<div class="p-24 modal-inner-scroll animated fadeIn"> | ||
<c8y-list-group class="separator-top"> | ||
<c8y-li> | ||
<c8y-li-radio | ||
name="mapping_type_group" | ||
title="{{ 'Continue snooping' }}" | ||
(click)="onSelection('CONTINUE_SNOOPING')" | ||
></c8y-li-radio> | ||
<span>{{ 'Continue snooping and wait for more templates ...' }}</span> | ||
</c8y-li> | ||
<c8y-li> | ||
<c8y-li-radio | ||
name="mapping_type_group" | ||
title="{{ 'Stop snooping' }}" | ||
(click)="onSelection('STOP_SNOOPING_AND_EDIT')" | ||
></c8y-li-radio> | ||
<span>{{ 'Stop snooping and edit mapping ...' }}</span> | ||
</c8y-li> | ||
</c8y-list-group> | ||
</div> | ||
</div> | ||
</c8y-modal> |
70 changes: 70 additions & 0 deletions
70
dynamic-mapping-ui/src/mapping/grid/advisor/advice-action.component.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,70 @@ | ||
/* | ||
* Copyright (c) 2022 Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, | ||
* and/or its subsidiaries and/or its affiliates and/or their licensors. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* Licensed 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. | ||
* | ||
* @authors Christof Strack | ||
*/ | ||
import { | ||
Component, | ||
Input, | ||
OnDestroy, | ||
OnInit, | ||
ViewEncapsulation | ||
} from '@angular/core'; | ||
import { ModalLabels } from '@c8y/ngx-components'; | ||
import { Subject } from 'rxjs'; | ||
import { Mapping, MappingEnriched } from '../../../shared'; | ||
|
||
@Component({ | ||
selector: 'd11r-advice-action', | ||
templateUrl: './advice-action.component.html', | ||
encapsulation: ViewEncapsulation.None | ||
}) | ||
export class AdviceActionComponent implements OnInit, OnDestroy { | ||
@Input() enrichedMapping: MappingEnriched; | ||
mapping: Mapping; | ||
closeSubject: Subject<string> = new Subject(); | ||
labels: ModalLabels = { ok: 'Select', cancel: 'Cancel' }; | ||
|
||
selection: string = ''; | ||
valid: boolean = false; | ||
|
||
constructor() {} | ||
|
||
ngOnInit(): void { | ||
this.closeSubject = new Subject(); | ||
} | ||
|
||
onDismiss() { | ||
this.closeSubject.next('CANCEL'); | ||
this.closeSubject.complete(); | ||
} | ||
|
||
onClose() { | ||
this.closeSubject.next(this.selection); | ||
this.closeSubject.complete(); | ||
} | ||
|
||
onSelection(t) { | ||
this.selection = t; | ||
this.valid = true; | ||
} | ||
|
||
ngOnDestroy() { | ||
this.closeSubject.complete(); | ||
} | ||
} |
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
Oops, something went wrong.