Skip to content

Commit

Permalink
Fixed many major smells
Browse files Browse the repository at this point in the history
  • Loading branch information
car031 committed Jul 6, 2023
1 parent f86a2e8 commit 1a2c251
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.logicaldoc.gui.common.client;

public final class Constants {

// The currenly logged user name
public static final String AUTH_USERNAME = "authUser";

Expand Down Expand Up @@ -183,5 +184,6 @@ public final class Constants {
FULLTEXT_FIELD_CONTENT, FULLTEXT_FIELD_TAGS };

private Constants() {
// Do nothing
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,21 +44,17 @@ public ApplyTemplateDialog() {
folders.setWidth100();
folders.setHeight100();

final boolean inheritOptionEnabled = "true"
.equals(Session.get().getInfo().getConfig("gui.security.inheritoption"));

final DynamicForm form = new DynamicForm();

CheckboxItem inheritSecurity = new CheckboxItem();
inheritSecurity.setName("inheritSecurity");
inheritSecurity.setTitle(I18N.message("inheritparentsec"));
inheritSecurity.setValue("inherit".equals(Session.get().getConfig("gui.security.inheritoption.default")));
inheritSecurity.setHidden(!"true".equals(Session.get().getInfo().getConfig("gui.security.inheritoption")));

SelectItem templateSelector = ItemFactory.newFolderTemplateSelector();

if (inheritOptionEnabled)
form.setItems(templateSelector, inheritSecurity);
else
form.setItems(templateSelector);
form.setItems(templateSelector, inheritSecurity);

Button apply = new Button(I18N.message("apply"));
apply.setAutoFit(true);
Expand All @@ -72,8 +68,7 @@ public ApplyTemplateDialog() {
long templateId = Long.parseLong(form.getValueAsString("foldertemplate"));

FolderService.Instance.get().applyTemplate(folderId, templateId,
inheritOptionEnabled && "true".equals(form.getValueAsString("inheritSecurity")),
new AsyncCallback<Void>() {
"true".equals(form.getValueAsString("inheritSecurity")), new AsyncCallback<Void>() {

@Override
public void onFailure(Throwable caught) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -778,8 +778,7 @@ public void onSuccess(Void result) {
* Allows the selection of a folders template to apply to the current node
*/
private void onApplyTemplate() {
ApplyTemplateDialog dialog = new ApplyTemplateDialog();
dialog.show();
new ApplyTemplateDialog().show();
}

/**
Expand Down

0 comments on commit 1a2c251

Please sign in to comment.