SEBSERV-230 removed attributes from GUI
This commit is contained in:
parent
b42dd5e146
commit
33c915bd92
4 changed files with 89 additions and 63 deletions
|
@ -1027,7 +1027,10 @@ public class WidgetFactory {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void setARIALabel(final Widget widget, final String label) {
|
public static void setARIALabel(final Widget widget, final String label) {
|
||||||
setAttribute(widget, ADD_HTML_ATTR_ARIA_LABEL, label);
|
setAttribute(
|
||||||
|
widget,
|
||||||
|
ADD_HTML_ATTR_ARIA_LABEL,
|
||||||
|
Utils.escapeHTML_XML_EcmaScript(label));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void setAttribute(final Widget widget, final String name, final String value) {
|
public static void setAttribute(final Widget widget, final String name, final String value) {
|
||||||
|
|
|
@ -127,6 +127,9 @@ class ConfigurationDAOBatchService {
|
||||||
.where(
|
.where(
|
||||||
ConfigurationNodeRecordDynamicSqlSupport.name,
|
ConfigurationNodeRecordDynamicSqlSupport.name,
|
||||||
isEqualTo(data.name))
|
isEqualTo(data.name))
|
||||||
|
.and(
|
||||||
|
ConfigurationNodeRecordDynamicSqlSupport.type,
|
||||||
|
SqlBuilder.isEqualTo(data.type.name()))
|
||||||
.and(
|
.and(
|
||||||
ConfigurationNodeRecordDynamicSqlSupport.institutionId,
|
ConfigurationNodeRecordDynamicSqlSupport.institutionId,
|
||||||
SqlBuilder.isEqualTo(data.institutionId))
|
SqlBuilder.isEqualTo(data.institutionId))
|
||||||
|
@ -355,6 +358,9 @@ class ConfigurationDAOBatchService {
|
||||||
.where(
|
.where(
|
||||||
ConfigurationNodeRecordDynamicSqlSupport.name,
|
ConfigurationNodeRecordDynamicSqlSupport.name,
|
||||||
isEqualTo(copyInfo.name))
|
isEqualTo(copyInfo.name))
|
||||||
|
.and(
|
||||||
|
ConfigurationNodeRecordDynamicSqlSupport.type,
|
||||||
|
SqlBuilder.isEqualTo(copyInfo.configurationType.name()))
|
||||||
.and(
|
.and(
|
||||||
ConfigurationNodeRecordDynamicSqlSupport.institutionId,
|
ConfigurationNodeRecordDynamicSqlSupport.institutionId,
|
||||||
isEqualTo(institutionId))
|
isEqualTo(institutionId))
|
||||||
|
|
|
@ -185,24 +185,8 @@ public class ConfigurationNodeDAOImpl implements ConfigurationNodeDAO {
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public Result<ConfigurationNode> save(final ConfigurationNode data) {
|
public Result<ConfigurationNode> save(final ConfigurationNode data) {
|
||||||
return Result.tryCatch(() -> {
|
return checkUniqueName(data)
|
||||||
|
.map(_d -> {
|
||||||
final Long count = this.configurationNodeRecordMapper.countByExample()
|
|
||||||
.where(
|
|
||||||
ConfigurationNodeRecordDynamicSqlSupport.name,
|
|
||||||
isEqualTo(data.name))
|
|
||||||
.and(
|
|
||||||
ConfigurationNodeRecordDynamicSqlSupport.id,
|
|
||||||
isNotEqualTo(data.id))
|
|
||||||
.and(
|
|
||||||
ConfigurationNodeRecordDynamicSqlSupport.institutionId,
|
|
||||||
isNotEqualTo(data.institutionId))
|
|
||||||
.build()
|
|
||||||
.execute();
|
|
||||||
|
|
||||||
if (count != null && count > 0) {
|
|
||||||
throw new FieldValidationException("name", "configurationNode:name:exists");
|
|
||||||
}
|
|
||||||
|
|
||||||
final ConfigurationNodeRecord newRecord = new ConfigurationNodeRecord(
|
final ConfigurationNodeRecord newRecord = new ConfigurationNodeRecord(
|
||||||
data.id,
|
data.id,
|
||||||
|
@ -316,6 +300,32 @@ public class ConfigurationNodeDAOImpl implements ConfigurationNodeDAO {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Result<ConfigurationNode> checkUniqueName(final ConfigurationNode data) {
|
||||||
|
return Result.tryCatch(() -> {
|
||||||
|
final Long count = this.configurationNodeRecordMapper.countByExample()
|
||||||
|
.where(
|
||||||
|
ConfigurationNodeRecordDynamicSqlSupport.name,
|
||||||
|
isEqualTo(data.name))
|
||||||
|
.and(
|
||||||
|
ConfigurationNodeRecordDynamicSqlSupport.type,
|
||||||
|
isNotEqualTo(data.type.name()))
|
||||||
|
.and(
|
||||||
|
ConfigurationNodeRecordDynamicSqlSupport.id,
|
||||||
|
isNotEqualTo(data.id))
|
||||||
|
.and(
|
||||||
|
ConfigurationNodeRecordDynamicSqlSupport.institutionId,
|
||||||
|
isNotEqualTo(data.institutionId))
|
||||||
|
.build()
|
||||||
|
.execute();
|
||||||
|
|
||||||
|
if (count != null && count > 0) {
|
||||||
|
throw new FieldValidationException("name", "configurationNode:name:exists");
|
||||||
|
}
|
||||||
|
|
||||||
|
return data;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
static Result<ConfigurationNode> toDomainModel(final ConfigurationNodeRecord record) {
|
static Result<ConfigurationNode> toDomainModel(final ConfigurationNodeRecord record) {
|
||||||
return Result.tryCatch(() -> new ConfigurationNode(
|
return Result.tryCatch(() -> new ConfigurationNode(
|
||||||
record.getId(),
|
record.getId(),
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
-- -----------------------------------------------------
|
||||||
|
-- Remove SEB Settings from GUI (and templates too)
|
||||||
|
-- -----------------------------------------------------
|
||||||
|
|
||||||
|
DELETE FROM `orientation` WHERE `config_attribute_id`='5';
|
||||||
|
DELETE FROM `orientation` WHERE `config_attribute_id`='6';
|
||||||
|
DELETE FROM `orientation` WHERE `config_attribute_id`='7';
|
Loading…
Reference in a new issue