Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Confirmation dialog to delete an UI configuration #6092

Merged
merged 1 commit into from
Jan 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,10 @@
};

$scope.deleteUiConfig = function() {
$('#gn-confirm-remove-ui').modal('show');
};

$scope.confirmDeleteUiConfig = function() {
$scope.lastUiConfiguration = undefined;
$http.delete('../api/ui/' + $scope.uiConfiguration.id).then(function(r) {
loadUiConfigurations();
Expand Down
3 changes: 2 additions & 1 deletion web-ui/src/main/resources/catalog/locales/en-admin.json
Original file line number Diff line number Diff line change
Expand Up @@ -1495,6 +1495,7 @@
"ui-addWMSLayersToMap-urlLayerParam-help": "If the WMS layer name is configured in the metadata resource url, configure the url parameter that contains the layer name.",
"confirmRemoveLogo": "Are you sure you want to delete this logo?",
"groupRemoved": "Group removed",
"userRemoved": "User removed"
"userRemoved": "User removed",
"confirmUiDelete": "Are you sure you want to delete this UI configuration?"
}

3 changes: 2 additions & 1 deletion web-ui/src/main/resources/catalog/style/gn_admin.less
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,8 @@ ul.pager {
}

#gn-thesaurus-container, #gn-categories-container,
#gn-logo-container, #gn-group-container, #gn-user-container {
#gn-logo-container, #gn-group-container, #gn-user-container,
#gn-uiconfig-container {
// Fixes gn-modal windows; TODO: fix this globally in gn-popup style
[gn-modal] {
max-width: none;
Expand Down
203 changes: 106 additions & 97 deletions web-ui/src/main/resources/catalog/templates/admin/settings/ui.html
Original file line number Diff line number Diff line change
@@ -1,116 +1,125 @@
<div class="row">
<div class="col-md-12" data-ng-controller="GnSystemSettingsController">
<div class="col-md-12" id="gn-uiconfig-container"
data-ng-controller="GnSystemSettingsController">

<div class="navbar btn-toolbar">
<form class="form-inline">
<div class="well well-lg"
data-ng-cloak=""
data-ng-show="uiConfigurations.length === 0">
<div data-translate="">noConfigDefinedUsingTheDefault</div>
<br/>
<a class="btn btn-primary"
data-gn-click-and-spin="createDefaultUiConfig()"
data-translate="">createDefaultUiConfig</a>
<br/>
</div>
<div class="navbar btn-toolbar">
<form class="form-inline">
<div class="well well-lg"
data-ng-cloak=""
data-ng-show="uiConfigurations.length === 0">
<div data-translate="">noConfigDefinedUsingTheDefault</div>
<br/>
<a class="btn btn-primary"
data-gn-click-and-spin="createDefaultUiConfig()"
data-translate="">createDefaultUiConfig</a>
<br/>
</div>

<div class="pull-left"
data-ng-show="uiConfigurations.length !== 0">
<label for="uiConfigurationList"
title="{{'uiConfiguration-help' | translate}}"
data-translate="">chooseAUiConfiguration</label>
<select id="uiConfigurationList"
class="form-control"
data-ng-options="c as c.id for c in uiConfigurations | orderBy: 'id'"
data-ng-model="uiConfiguration"></select>
</div>

<div class="btn-toolbar pull-right">
<label for="addUiSettings" data-translate="">addUiSettings</label>

<div class="pull-left"
data-ng-show="uiConfigurations.length !== 0">
<label for="uiConfigurationList"
title="{{'uiConfiguration-help' | translate}}"
data-translate="">chooseAUiConfiguration</label>
<select id="uiConfigurationList"
class="form-control"
data-ng-options="c as c.id for c in uiConfigurations | orderBy: 'id'"
data-ng-model="uiConfiguration"></select>
<div class="input-group">
<input class="form-control"
type="text"
id="addUiSettings"
data-ng-model="uiConfigurationId"
data-ng-model-options="{debounce: 300}"
placeholder="{{'uiConfigurationName' | translate}}"/>
<span class="input-group-btn">
<button class="btn btn-primary"
type="button"
data-ng-disabled="!uiConfigurationIdIsValid"
title="{{'createNewUiConfiguration' | translate}}"
data-ng-click="createOrUpdateUiConfiguration(false, uiConfigurationId)">
<i class="fa fa-plus" aria-hidden="true"></i>
</button>
</span>
</div>
</div>
</form>
</div>

<div class="btn-toolbar pull-right">
<label for="addUiSettings" data-translate="">addUiSettings</label>
<div class="panel panel-default"
data-ng-show="uiConfiguration">
<div class="panel-heading">
<h1 data-translate="">ui</h1>

<div data-gn-need-help="administrator-guide/configuring-the-catalog/user-interface-configuration.html"
class="pull-right"></div>
</div>
<div class="panel-body">
<div class="row">
<div class="col-lg-6 gn-nopadding-left">
<label for="filter-settings" data-translate="">filterSettings</label>
<div class="input-group">
<span class="input-group-addon"">
<i class="fa fa-filter" aria-hidden="true"></i>
</span>
<input class="form-control"
type="text"
id="addUiSettings"
data-ng-model="uiConfigurationId"
data-ng-model-options="{debounce: 300}"
placeholder="{{'uiConfigurationName' | translate}}"/>
id="filter-settings"
placeholder="{{'filterPlaceHolder' | translate}}"
data-ng-keyup="filterForm($event,'#gn-settings')" />
<span class="input-group-btn">
<button class="btn btn-primary"
type="button"
data-ng-disabled="!uiConfigurationIdIsValid"
title="{{'createNewUiConfiguration' | translate}}"
data-ng-click="createOrUpdateUiConfiguration(false, uiConfigurationId)">
<i class="fa fa-plus" aria-hidden="true"></i>
</button>
</span>
<button class="btn btn-default"
type="button"
title="{{'filterReset' | translate}}"
data-ng-click="resetFilter('#gn-settings')">
<i class="fa fa-close" aria-hidden="true"></i>
</button>
</span>
</div>
</div>
</form>
</div>

<div class="panel panel-default"
data-ng-show="uiConfiguration">
<div class="panel-heading">
<h1 data-translate="">ui</h1>

<div data-gn-need-help="administrator-guide/configuring-the-catalog/user-interface-configuration.html"
class="pull-right"></div>
</div>
<div class="panel-body">
<div class="row">
<div class="col-lg-6 gn-nopadding-left">
<label for="filter-settings" data-translate="">filterSettings</label>
<div class="input-group">
<span class="input-group-addon"">
<i class="fa fa-filter" aria-hidden="true"></i>
</span>
<input class="form-control"
type="text"
id="filter-settings"
placeholder="{{'filterPlaceHolder' | translate}}"
data-ng-keyup="filterForm($event,'#gn-settings')" />
<span class="input-group-btn">
<button class="btn btn-default"
type="button"
title="{{'filterReset' | translate}}"
data-ng-click="resetFilter('#gn-settings')">
<i class="fa fa-close" aria-hidden="true"></i>
</button>
</span>
</div>
</div>
<div class="col-lg-6 gn-nopadding-right">
<div class="btn-toolbar">
<button type="submit" class="btn btn-primary pull-right"
id="gn-btn-settings-save"
data-ng-disabled="!gnSettings.$valid"
data-ng-click="updateUiConfig()">
<span class="fa fa-save"></span>
{{"saveSettings"|translate}}
</button>
<button type="submit" class="btn btn-danger pull-right"
id="gn-btn-settings-delete"
data-ng-disabled="!uiConfiguration"
data-ng-click="deleteUiConfig()">
<span class="fa fa-times"></span>
{{"deleteUiSettings"|translate}}
</button>
</div>
<div class="col-lg-6 gn-nopadding-right">
<div class="btn-toolbar">
<button type="submit" class="btn btn-primary pull-right"
id="gn-btn-settings-save"
data-ng-disabled="!gnSettings.$valid"
data-ng-click="updateUiConfig()">
<span class="fa fa-save"></span>
{{"saveSettings"|translate}}
</button>
<button type="submit" class="btn btn-danger pull-right"
id="gn-btn-settings-delete"
data-ng-disabled="!uiConfiguration"
data-ng-click="deleteUiConfig()">
<span class="fa fa-times"></span>
{{"deleteUiSettings"|translate}}
</button>
</div>
</div>
</div>

<form id="gn-settings" name="gnSettings" class="form-horizontal">
<div data-gn-ui-config="uiConfiguration.configuration"></div>
</form>
<form id="gn-settings" name="gnSettings" class="form-horizontal">
<div data-gn-ui-config="uiConfiguration.configuration"></div>
</form>

<button type="submit" class="btn btn-primary pull-right"
data-ng-disabled="!gnSettings.$valid"
data-ng-click="updateUiConfig()">
<span class="fa fa-save"></span>
{{"saveSettings"|translate}}
</button>
</div>
<button type="submit" class="btn btn-primary pull-right"
data-ng-disabled="!gnSettings.$valid"
data-ng-click="updateUiConfig()">
<span class="fa fa-save"></span>
{{"saveSettings"|translate}}
</button>
</div>
</div>

<div gn-modal class="gn-confirm-delete"
gn-popup-options="{title: 'confirmDialogTitle', confirmCallback: confirmDeleteUiConfig}"
id="gn-confirm-remove-ui">
<p translate>confirmUiDelete</p>
</div>
</div>


</div>