Skip to content

Commit

Permalink
#fn fix union add dataset popup where checkbox was always disabled in…
Browse files Browse the repository at this point in the history
… edit mode
  • Loading branch information
paigechoi authored and eltriny committed Apr 3, 2019
1 parent 4ffdb65 commit 03e8141
Show file tree
Hide file tree
Showing 5 changed files with 287 additions and 288 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,7 @@ export class EditDataflowRule2Component extends AbstractPopupComponent implement
}

if (jsonRuleString.name === 'join') {
if (this.selectedDataSet.gridData.data.length > 1) {
if (this.selectedDataSet.gridData.data.length > 0) {
this.editJoinOrUnionRuleStr = rule['jsonRuleString'];
this.setJoinEditInfo(rule);
} else {
Expand All @@ -645,7 +645,7 @@ export class EditDataflowRule2Component extends AbstractPopupComponent implement
}

if (jsonRuleString.name === 'union') {
if (this.selectedDataSet.gridData.data.length > 1) {
if (this.selectedDataSet.gridData.data.length > 0) {
this.editJoinOrUnionRuleStr = rule['jsonRuleString'];
this.isUpdate = true;
this.isRuleUnionModalShow = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,12 @@
</div>
</div>
</div>

<app-union-add-datasets
[editInfo]="editInfo" [isUpdate]="isUpdate" [existingDatasets]="datasets" [dfId]="dfId" (complete)="selectedDatasets($event);" *ngIf="isAddDatasetsModal">
*ngIf="isAddDatasetsModal"
[editInfo]="editInfo"
[existingDatasets]="datasets"
[dfId]="dfId"
(complete)="selectedDatasets($event);"
[masterDsId]="masterDataset.dsId">
</app-union-add-datasets>
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { PopupService } from '../../../../../../common/service/popup.service';
import { DataflowService } from '../../../../service/dataflow.service';
import { Alert } from '../../../../../../common/util/alert.util';
import { PreparationAlert } from '../../../../../util/preparation-alert.util';
import * as _ from 'lodash';

class Field {
public name: string;
Expand Down Expand Up @@ -184,7 +185,6 @@ export class RuleUnionPopupComponent extends AbstractPopupComponent implements O
* 데이터셋 추가 팝업 열기
*/
public openPopup() {
this.editInfo = this.unionDatasets;
this.isAddDatasetsModal = true;
} // function - openPopup

Expand All @@ -194,8 +194,8 @@ export class RuleUnionPopupComponent extends AbstractPopupComponent implements O
*/
public selectedDatasets(data) {
if (null != data) {
this.unionDatasets = this.unionDatasets.concat(data);
this.datasets = [this.masterDataset].concat(this.unionDatasets);
this.unionDatasets = data;
this.datasets = _.union([this.masterDataset], this.unionDatasets);
this.convertDataToUiType();
}
this.isAddDatasetsModal = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,27 @@

<!-- pop button -->
<div class="ddp-ui-pop-buttons">
<a href="javascript:" class="ddp-btn-pop" (click)="close()">{{'msg.comm.btn.close' | translate}}</a>
<a href="javascript:" class="ddp-btn-pop ddp-bg-black" [ngClass]="{'ddp-disabled': checkInvalidStateAdd()}" (click)="applyRule()"><em class="ddp-icon-link-plus"></em> {{'msg.dp.btn.union.add' | translate}}</a>

<a href="javascript:" class="ddp-btn-pop" (click)="close()">
{{'msg.comm.btn.close' | translate}}
</a>
<a href="javascript:" class="ddp-btn-pop ddp-bg-black"
[ngClass]="{'ddp-disabled': isAddEnabled()}"
(click)="addDatasets()">
<em class="ddp-icon-link-plus"></em>
{{'msg.dp.btn.union.add' | translate}}
</a>
</div>
<!-- //pop button -->

</div>
<!-- //sub title -->
<div class="ddp-type-top-option ddp-clear">
<!-- 검색 -->
<div class="ddp-form-search ddp-fleft">
<em class="ddp-icon-search"></em>
<input type="text" placeholder="{{'msg.dp.ui.ds.search.description' | translate}}" (keypress)="searchDatasets($event)" [(ngModel)]="searchText">
<em class="ddp-btn-search-close" *ngIf="searchText" (click)="searchText='';getDatasets()"></em>
<input type="text" placeholder="{{'msg.dp.ui.ds.search.description' | translate}}"
(keypress)="onKeyPress($event)" [(ngModel)]="searchText">
<em class="ddp-btn-search-close" *ngIf="searchText" (click)="refreshSearch()"></em>
</div>
<!-- //검색 -->

Expand All @@ -61,13 +69,13 @@
</colgroup>
<thead>
<tr>
<th class="ddp-txt-center" (click)="checkAllEventHandler();">
<div class="ddp-ui-checkbox" [ngClass]="{'ddp-checkboxtype' : partialChecked()}">
<input type="checkbox" class="ddp-checkbox-form" [checked]="isCheckAll" >
<th class="ddp-txt-center">
<label class="ddp-ui-checkbox" (click)="checkAll();">
<input type="checkbox" class="ddp-checkbox-form" [checked]="isAllChecked()" [disabled]="isCheckAllDisabled()">
<i class="ddp-icon-checkbox"></i>
</div>
</label>
</th>
<th (click)="changeOrder('dsName')">
<th (click)="sortList('dsName')">
{{'msg.comm.menu.manage.prep.set' | translate}}
<em class="ddp-icon-array-default2" *ngIf="selectedContentSort.key !== 'dsName' || selectedContentSort.sort === 'default'"></em>
<em class="ddp-icon-array-asc2" *ngIf="selectedContentSort.key === 'dsName' && selectedContentSort.sort === 'asc'"></em>
Expand All @@ -76,7 +84,7 @@
<th>
{{'msg.comm.th.type' | translate}}
</th>
<th (click)="changeOrder('modifiedTime')">
<th (click)="sortList('modifiedTime')">
{{'msg.comm.ui.list.last' | translate}}
<em class="ddp-icon-array-default2" *ngIf="selectedContentSort.key !== 'modifiedTime' || selectedContentSort.sort === 'default'"></em>
<em class="ddp-icon-array-asc2" *ngIf="selectedContentSort.key === 'modifiedTime' && selectedContentSort.sort === 'asc'"></em>
Expand All @@ -100,12 +108,12 @@
</colgroup>

<tbody>
<tr *ngFor="let dsItem of datasets" [class.ddp-disabled]="dsItem.origin">
<td class="ddp-txt-center" (click)="checkEventHandler(dsItem);">
<div class="ddp-ui-checkbox">
<input type="checkbox" [checked]="dsItem.selected" >
<tr *ngFor="let dsItem of datasets">
<td class="ddp-txt-center">
<label class="ddp-ui-checkbox" (click)="check(dsItem);">
<input type="checkbox" [checked]="dsItem.selected && !dsItem.origin" [disabled]="dsItem.origin">
<i class="ddp-icon-checkbox"></i>
</div>
</label>
</td>
<td>
<div class=" ddp-txt-long">
Expand All @@ -131,7 +139,7 @@
<!-- //테이블 -->
<div class="ddp-ui-bottomoption ddp-clear">
<span class="ddp-data-type ddp-fleft">
{{'msg.dp.ui.sel.count'| translate :{value:countSelected} }}
{{'msg.dp.ui.sel.count'| translate :{value:selectedItems.length} }}
</span>

</div>
Expand Down
Loading

0 comments on commit 03e8141

Please sign in to comment.