Skip to content

Commit

Permalink
SearchKit - Make UI less confusing by not allowing joins to be switched
Browse files Browse the repository at this point in the history
Switching a join was confusing and buggy. Best to disable that and only allow them to be deleted
  • Loading branch information
colemanw committed Jan 21, 2021
1 parent 344c48b commit 4df8a1d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 13 deletions.
5 changes: 4 additions & 1 deletion ext/search/ang/crmSearchAdmin/compose/criteria.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@
<fieldset ng-repeat="join in $ctrl.savedSearch.api_params.join">
<div class="form-inline">
<label for="crm-search-join-{{ $index }}">{{:: ts('With') }}</label>
<input id="crm-search-join-{{ $index }}" class="form-control huge" ng-model="join[0]" crm-ui-select="{placeholder: ' ', data: getJoinEntities}" ng-change="changeJoin($index)" />
<input id="crm-search-join-{{ $index }}" class="form-control huge" ng-model="join[0]" crm-ui-select="{placeholder: ' ', data: getJoinEntities}" disabled >
<select class="form-control" ng-model="join[1]" ng-options="o.k as o.v for o in ::joinTypes" ></select>
<button class="btn btn-xs btn-danger-outline" ng-click="$ctrl.clearParam('join', $index)" title="{{:: ts('Remove join') }}">
<i class="crm-i fa-trash" aria-hidden="true"></i>
</button>
</div>
<fieldset class="api4-clause-fieldset">
<crm-search-clause clauses="join" format="json" skip="2 + getJoin(join[0]).conditions.length" op="AND" label="{{ ts('If') }}" fields="fieldsForWhere" ></crm-search-clause>
Expand Down
9 changes: 0 additions & 9 deletions ext/search/ang/crmSearchAdmin/crmSearchAdmin.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,15 +255,6 @@
});
};

$scope.changeJoin = function(idx) {
if (ctrl.savedSearch.api_params.join[idx][0]) {
ctrl.savedSearch.api_params.join[idx].length = 2;
loadFieldOptions();
} else {
ctrl.clearParam('join', idx);
}
};

$scope.changeGroupBy = function(idx) {
if (!ctrl.savedSearch.api_params.groupBy[idx]) {
ctrl.clearParam('groupBy', idx);
Expand Down
3 changes: 0 additions & 3 deletions ext/search/css/search.css
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,6 @@
right: 0;
top: 0;
}
#bootstrap-theme.crm-search crm-search-clause > .btn-group .btn {
border: 0 none;
}

#bootstrap-theme.crm-search fieldset div.api4-input {
margin-bottom: 10px;
Expand Down

0 comments on commit 4df8a1d

Please sign in to comment.