fixed action disappearing on empty list
This commit is contained in:
parent
066df95d0c
commit
63949a9416
12 changed files with 29 additions and 29 deletions
|
@ -251,7 +251,7 @@ public class ConfigTemplateForm implements TemplateComposer {
|
|||
attrTable::getSelection,
|
||||
PageAction::applySingleSelectionAsEntityKey,
|
||||
EMPTY_ATTRIBUTE_SELECTION_TEXT_KEY)
|
||||
.publishIf(() -> attrTable.hasAnyContent() && modifyGrant, false)
|
||||
.publishIf(() -> modifyGrant, false)
|
||||
|
||||
.newAction(ActionDefinition.SEB_EXAM_CONFIG_TEMPLATE_ATTR_SET_DEFAULT)
|
||||
.withParentEntityKey(entityKey)
|
||||
|
@ -260,7 +260,7 @@ public class ConfigTemplateForm implements TemplateComposer {
|
|||
action -> this.resetToDefaults(action, attrTable),
|
||||
EMPTY_ATTRIBUTE_SELECTION_TEXT_KEY)
|
||||
.noEventPropagation()
|
||||
.publishIf(() -> attrTable.hasAnyContent() && modifyGrant, false)
|
||||
.publishIf(() -> modifyGrant, false)
|
||||
|
||||
.newAction(ActionDefinition.SEB_EXAM_CONFIG_TEMPLATE_ATTR_LIST_REMOVE_VIEW)
|
||||
.withParentEntityKey(entityKey)
|
||||
|
@ -269,7 +269,7 @@ public class ConfigTemplateForm implements TemplateComposer {
|
|||
action -> this.removeFormView(action, attrTable),
|
||||
EMPTY_ATTRIBUTE_SELECTION_TEXT_KEY)
|
||||
.noEventPropagation()
|
||||
.publishIf(() -> attrTable.hasAnyContent() && modifyGrant, false)
|
||||
.publishIf(() -> modifyGrant, false)
|
||||
|
||||
.newAction(ActionDefinition.SEB_EXAM_CONFIG_TEMPLATE_ATTR_LIST_ATTACH_DEFAULT_VIEW)
|
||||
.withParentEntityKey(entityKey)
|
||||
|
@ -278,7 +278,7 @@ public class ConfigTemplateForm implements TemplateComposer {
|
|||
action -> this.attachView(action, attrTable),
|
||||
EMPTY_ATTRIBUTE_SELECTION_TEXT_KEY)
|
||||
.noEventPropagation()
|
||||
.publishIf(() -> attrTable.hasAnyContent() && modifyGrant, false);
|
||||
.publishIf(() -> modifyGrant, false);
|
||||
}
|
||||
|
||||
pageActionBuilder
|
||||
|
|
|
@ -148,12 +148,12 @@ public class ConfigTemplateList implements TemplateComposer {
|
|||
.newAction(ActionDefinition.SEB_EXAM_CONFIG_TEMPLATE_VIEW_FROM_LIST)
|
||||
.withSelect(templateTable::getSelection, PageAction::applySingleSelectionAsEntityKey,
|
||||
EMPTY_TEMPLATE_SELECTION_TEXT_KEY)
|
||||
.publishIf(templateTable::hasAnyContent, false)
|
||||
.publish(false)
|
||||
|
||||
.newAction(ActionDefinition.SEB_EXAM_CONFIG_TEMPLATE_MODIFY_FROM_LIST)
|
||||
.withSelect(
|
||||
templateTable.getGrantedSelection(this.currentUser, NO_MODIFY_PRIVILEGE_ON_OTHER_INSTITUTION),
|
||||
PageAction::applySingleSelectionAsEntityKey, EMPTY_TEMPLATE_SELECTION_TEXT_KEY)
|
||||
.publishIf(() -> examConfigGrant.im() && templateTable.hasAnyContent(), false);
|
||||
.publishIf(() -> examConfigGrant.im(), false);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -209,14 +209,14 @@ public class ExamList implements TemplateComposer {
|
|||
actionBuilder
|
||||
.newAction(ActionDefinition.EXAM_VIEW_FROM_LIST)
|
||||
.withSelect(table::getSelection, PageAction::applySingleSelectionAsEntityKey, EMPTY_SELECTION_TEXT_KEY)
|
||||
.publishIf(table::hasAnyContent, false)
|
||||
.publish(false)
|
||||
|
||||
.newAction(ActionDefinition.EXAM_MODIFY_FROM_LIST)
|
||||
.withSelect(
|
||||
table.getGrantedSelection(currentUser, NO_MODIFY_PRIVILEGE_ON_OTHER_INSTITUTION),
|
||||
action -> modifyExam(action, table),
|
||||
EMPTY_SELECTION_TEXT_KEY)
|
||||
.publishIf(() -> userGrant.im() && table.hasAnyContent(), false);
|
||||
.publishIf(() -> userGrant.im(), false);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -87,8 +87,8 @@ public class InstitutionList implements TemplateComposer {
|
|||
final Composite content = this.pageService
|
||||
.getWidgetFactory()
|
||||
.defaultPageLayout(
|
||||
pageContext.getParent(),
|
||||
TITLE_TEXT_KEY);
|
||||
pageContext.getParent(),
|
||||
TITLE_TEXT_KEY);
|
||||
|
||||
final PageActionBuilder pageActionBuilder =
|
||||
this.pageService.pageActionBuilder(pageContext.clearEntityKeys());
|
||||
|
@ -142,19 +142,19 @@ public class InstitutionList implements TemplateComposer {
|
|||
table::getSelection,
|
||||
PageAction::applySingleSelectionAsEntityKey,
|
||||
EMPTY_SELECTION_TEXT_KEY)
|
||||
.publishIf(table::hasAnyContent, false)
|
||||
.publish(false)
|
||||
|
||||
.newAction(ActionDefinition.INSTITUTION_MODIFY_FROM_LIST)
|
||||
.withSelect(
|
||||
table::getSelection,
|
||||
PageAction::applySingleSelectionAsEntityKey,
|
||||
EMPTY_SELECTION_TEXT_KEY)
|
||||
.publishIf(() -> instGrant.m() && table.hasAnyContent(), false)
|
||||
.publishIf(() -> instGrant.m(), false)
|
||||
|
||||
.newAction(ActionDefinition.INSTITUTION_TOGGLE_ACTIVITY)
|
||||
.withExec(this.pageService.activationToggleActionFunction(table, EMPTY_SELECTION_TEXT_KEY))
|
||||
.withConfirm(this.pageService.confirmDeactivation(table))
|
||||
.publishIf(() -> instGrant.m() && table.hasAnyContent(), false);
|
||||
.publishIf(() -> instGrant.m(), false);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -169,13 +169,13 @@ public class LmsSetupList implements TemplateComposer {
|
|||
|
||||
.newAction(ActionDefinition.LMS_SETUP_VIEW_FROM_LIST)
|
||||
.withSelect(table::getSelection, PageAction::applySingleSelectionAsEntityKey, EMPTY_SELECTION_TEXT_KEY)
|
||||
.publishIf(table::hasAnyContent, false)
|
||||
.publish(false)
|
||||
|
||||
.newAction(ActionDefinition.LMS_SETUP_MODIFY_FROM_LIST)
|
||||
.withSelect(
|
||||
table.getGrantedSelection(currentUser, NO_MODIFY_PRIVILEGE_ON_OTHER_INSTITUTION),
|
||||
PageAction::applySingleSelectionAsEntityKey, EMPTY_SELECTION_TEXT_KEY)
|
||||
.publishIf(() -> userGrant.im() && table.hasAnyContent(), false)
|
||||
.publishIf(() -> userGrant.im(), false)
|
||||
|
||||
.newAction(ActionDefinition.LMS_SETUP_TOGGLE_ACTIVITY)
|
||||
.withSelect(
|
||||
|
@ -186,7 +186,7 @@ public class LmsSetupList implements TemplateComposer {
|
|||
action -> LmsSetupForm.testLmsSetup(action, null, restService)),
|
||||
EMPTY_SELECTION_TEXT_KEY)
|
||||
.withConfirm(this.pageService.confirmDeactivation(table))
|
||||
.publishIf(() -> userGrant.iw() && table.hasAnyContent(), false);
|
||||
.publishIf(() -> userGrant.iw(), false);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -235,7 +235,7 @@ public class QuizLookupList implements TemplateComposer {
|
|||
institutionNameFunction),
|
||||
EMPTY_SELECTION_TEXT)
|
||||
.noEventPropagation()
|
||||
.publishIf(table::hasAnyContent, false)
|
||||
.publish(false)
|
||||
|
||||
.newAction(ActionDefinition.QUIZ_DISCOVERY_EXAM_IMPORT)
|
||||
.withConfirm(importQuizConfirm(table, restService))
|
||||
|
@ -243,7 +243,7 @@ public class QuizLookupList implements TemplateComposer {
|
|||
table.getGrantedSelection(currentUser, NO_MODIFY_PRIVILEGE_ON_OTHER_INSTITUTION),
|
||||
action -> this.importQuizData(action, table),
|
||||
EMPTY_SELECTION_TEXT)
|
||||
.publishIf(() -> examGrant.im() && table.hasAnyContent(), false);
|
||||
.publishIf(() -> examGrant.im(), false);
|
||||
}
|
||||
|
||||
private static Function<QuizData, String> quizDataLmsSetupNameFunction(final ResourceService resourceService) {
|
||||
|
|
|
@ -172,13 +172,13 @@ public class SEBClientConfigList implements TemplateComposer {
|
|||
|
||||
.newAction(ActionDefinition.SEB_CLIENT_CONFIG_VIEW_FROM_LIST)
|
||||
.withSelect(table::getSelection, PageAction::applySingleSelectionAsEntityKey, EMPTY_SELECTION_TEXT_KEY)
|
||||
.publishIf(table::hasAnyContent, false)
|
||||
.publish(false)
|
||||
|
||||
.newAction(ActionDefinition.SEB_CLIENT_CONFIG_MODIFY_FROM_LIST)
|
||||
.withSelect(
|
||||
table.getGrantedSelection(this.currentUser, NO_MODIFY_PRIVILEGE_ON_OTHER_INSTITUTION),
|
||||
PageAction::applySingleSelectionAsEntityKey, EMPTY_SELECTION_TEXT_KEY)
|
||||
.publishIf(() -> clientConfigGrant.im() && table.hasAnyContent(), false)
|
||||
.publishIf(() -> clientConfigGrant.im(), false)
|
||||
|
||||
.newAction(ActionDefinition.SEB_CLIENT_CONFIG_TOGGLE_ACTIVITY)
|
||||
.withSelect(
|
||||
|
@ -186,7 +186,7 @@ public class SEBClientConfigList implements TemplateComposer {
|
|||
this.pageService.activationToggleActionFunction(table, EMPTY_SELECTION_TEXT_KEY),
|
||||
EMPTY_SELECTION_TEXT_KEY)
|
||||
.withConfirm(this.pageService.confirmDeactivation(table))
|
||||
.publishIf(() -> clientConfigGrant.im() && table.hasAnyContent(), false);
|
||||
.publishIf(() -> clientConfigGrant.im(), false);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -185,7 +185,7 @@ public class SEBClientLogs implements TemplateComposer {
|
|||
action -> this.sebClientLogDetailsPopup.showDetails(action, table.getSingleSelectedROWData()),
|
||||
EMPTY_SELECTION_TEXT)
|
||||
.noEventPropagation()
|
||||
.publishIf(table::hasAnyContent, false);
|
||||
.publish(false);
|
||||
}
|
||||
|
||||
private Function<ExtendedClientEvent, String> examNameFunction() {
|
||||
|
|
|
@ -336,7 +336,7 @@ public class SEBExamConfigForm implements TemplateComposer {
|
|||
return pageAction.withEntityKey(
|
||||
new EntityKey(selectedExamMapping.examId, EntityType.EXAM));
|
||||
})
|
||||
.publishIf(table::hasAnyContent, false);
|
||||
.publish(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -161,13 +161,13 @@ public class SEBExamConfigList implements TemplateComposer {
|
|||
.newAction(ActionDefinition.SEB_EXAM_CONFIG_VIEW_PROP_FROM_LIST)
|
||||
.withSelect(configTable::getSelection, PageAction::applySingleSelectionAsEntityKey,
|
||||
EMPTY_SELECTION_TEXT_KEY)
|
||||
.publishIf(configTable::hasAnyContent, false)
|
||||
.publish(false)
|
||||
|
||||
.newAction(ActionDefinition.SEB_EXAM_CONFIG_MODIFY_PROP_FROM_LIST)
|
||||
.withSelect(
|
||||
configTable.getGrantedSelection(this.currentUser, NO_MODIFY_PRIVILEGE_ON_OTHER_INSTITUTION),
|
||||
PageAction::applySingleSelectionAsEntityKey, EMPTY_SELECTION_TEXT_KEY)
|
||||
.publishIf(() -> examConfigGrant.im() && configTable.hasAnyContent(), false)
|
||||
.publishIf(() -> examConfigGrant.im(), false)
|
||||
|
||||
.newAction(ActionDefinition.SEB_EXAM_CONFIG_IMPORT_TO_NEW_CONFIG)
|
||||
.withSelect(
|
||||
|
|
|
@ -223,16 +223,16 @@ public class UserAccountList implements TemplateComposer {
|
|||
|
||||
.newAction(ActionDefinition.USER_ACCOUNT_VIEW_FROM_LIST)
|
||||
.withSelect(table::getSelection, PageAction::applySingleSelectionAsEntityKey, EMPTY_SELECTION_TEXT_KEY)
|
||||
.publishIf(table::hasAnyContent, false)
|
||||
.publish(false)
|
||||
|
||||
.newAction(ActionDefinition.USER_ACCOUNT_MODIFY_FROM_LIST)
|
||||
.withSelect(table::getSelection, this::editAction, EMPTY_SELECTION_TEXT_KEY)
|
||||
.publishIf(() -> userGrant.im() && table.hasAnyContent(), false)
|
||||
.publishIf(() -> userGrant.im(), false)
|
||||
|
||||
.newAction(ActionDefinition.USER_ACCOUNT_TOGGLE_ACTIVITY)
|
||||
.withExec(this.pageService.activationToggleActionFunction(table, EMPTY_SELECTION_TEXT_KEY))
|
||||
.withConfirm(this.pageService.confirmDeactivation(table))
|
||||
.publishIf(() -> userGrant.m() && table.hasAnyContent(), false);
|
||||
.publishIf(() -> userGrant.m(), false);
|
||||
}
|
||||
|
||||
private PageAction editAction(final PageAction pageAction) {
|
||||
|
|
|
@ -216,7 +216,7 @@ public class UserActivityLogs implements TemplateComposer {
|
|||
action -> this.showDetails(action, table.getSingleSelectedROWData()),
|
||||
EMPTY_SELECTION_TEXT)
|
||||
.noEventPropagation()
|
||||
.publishIf(table::hasAnyContent, false);
|
||||
.publish(false);
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue