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,
|
attrTable::getSelection,
|
||||||
PageAction::applySingleSelectionAsEntityKey,
|
PageAction::applySingleSelectionAsEntityKey,
|
||||||
EMPTY_ATTRIBUTE_SELECTION_TEXT_KEY)
|
EMPTY_ATTRIBUTE_SELECTION_TEXT_KEY)
|
||||||
.publishIf(() -> attrTable.hasAnyContent() && modifyGrant, false)
|
.publishIf(() -> modifyGrant, false)
|
||||||
|
|
||||||
.newAction(ActionDefinition.SEB_EXAM_CONFIG_TEMPLATE_ATTR_SET_DEFAULT)
|
.newAction(ActionDefinition.SEB_EXAM_CONFIG_TEMPLATE_ATTR_SET_DEFAULT)
|
||||||
.withParentEntityKey(entityKey)
|
.withParentEntityKey(entityKey)
|
||||||
|
@ -260,7 +260,7 @@ public class ConfigTemplateForm implements TemplateComposer {
|
||||||
action -> this.resetToDefaults(action, attrTable),
|
action -> this.resetToDefaults(action, attrTable),
|
||||||
EMPTY_ATTRIBUTE_SELECTION_TEXT_KEY)
|
EMPTY_ATTRIBUTE_SELECTION_TEXT_KEY)
|
||||||
.noEventPropagation()
|
.noEventPropagation()
|
||||||
.publishIf(() -> attrTable.hasAnyContent() && modifyGrant, false)
|
.publishIf(() -> modifyGrant, false)
|
||||||
|
|
||||||
.newAction(ActionDefinition.SEB_EXAM_CONFIG_TEMPLATE_ATTR_LIST_REMOVE_VIEW)
|
.newAction(ActionDefinition.SEB_EXAM_CONFIG_TEMPLATE_ATTR_LIST_REMOVE_VIEW)
|
||||||
.withParentEntityKey(entityKey)
|
.withParentEntityKey(entityKey)
|
||||||
|
@ -269,7 +269,7 @@ public class ConfigTemplateForm implements TemplateComposer {
|
||||||
action -> this.removeFormView(action, attrTable),
|
action -> this.removeFormView(action, attrTable),
|
||||||
EMPTY_ATTRIBUTE_SELECTION_TEXT_KEY)
|
EMPTY_ATTRIBUTE_SELECTION_TEXT_KEY)
|
||||||
.noEventPropagation()
|
.noEventPropagation()
|
||||||
.publishIf(() -> attrTable.hasAnyContent() && modifyGrant, false)
|
.publishIf(() -> modifyGrant, false)
|
||||||
|
|
||||||
.newAction(ActionDefinition.SEB_EXAM_CONFIG_TEMPLATE_ATTR_LIST_ATTACH_DEFAULT_VIEW)
|
.newAction(ActionDefinition.SEB_EXAM_CONFIG_TEMPLATE_ATTR_LIST_ATTACH_DEFAULT_VIEW)
|
||||||
.withParentEntityKey(entityKey)
|
.withParentEntityKey(entityKey)
|
||||||
|
@ -278,7 +278,7 @@ public class ConfigTemplateForm implements TemplateComposer {
|
||||||
action -> this.attachView(action, attrTable),
|
action -> this.attachView(action, attrTable),
|
||||||
EMPTY_ATTRIBUTE_SELECTION_TEXT_KEY)
|
EMPTY_ATTRIBUTE_SELECTION_TEXT_KEY)
|
||||||
.noEventPropagation()
|
.noEventPropagation()
|
||||||
.publishIf(() -> attrTable.hasAnyContent() && modifyGrant, false);
|
.publishIf(() -> modifyGrant, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
pageActionBuilder
|
pageActionBuilder
|
||||||
|
|
|
@ -148,12 +148,12 @@ public class ConfigTemplateList implements TemplateComposer {
|
||||||
.newAction(ActionDefinition.SEB_EXAM_CONFIG_TEMPLATE_VIEW_FROM_LIST)
|
.newAction(ActionDefinition.SEB_EXAM_CONFIG_TEMPLATE_VIEW_FROM_LIST)
|
||||||
.withSelect(templateTable::getSelection, PageAction::applySingleSelectionAsEntityKey,
|
.withSelect(templateTable::getSelection, PageAction::applySingleSelectionAsEntityKey,
|
||||||
EMPTY_TEMPLATE_SELECTION_TEXT_KEY)
|
EMPTY_TEMPLATE_SELECTION_TEXT_KEY)
|
||||||
.publishIf(templateTable::hasAnyContent, false)
|
.publish(false)
|
||||||
|
|
||||||
.newAction(ActionDefinition.SEB_EXAM_CONFIG_TEMPLATE_MODIFY_FROM_LIST)
|
.newAction(ActionDefinition.SEB_EXAM_CONFIG_TEMPLATE_MODIFY_FROM_LIST)
|
||||||
.withSelect(
|
.withSelect(
|
||||||
templateTable.getGrantedSelection(this.currentUser, NO_MODIFY_PRIVILEGE_ON_OTHER_INSTITUTION),
|
templateTable.getGrantedSelection(this.currentUser, NO_MODIFY_PRIVILEGE_ON_OTHER_INSTITUTION),
|
||||||
PageAction::applySingleSelectionAsEntityKey, EMPTY_TEMPLATE_SELECTION_TEXT_KEY)
|
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
|
actionBuilder
|
||||||
.newAction(ActionDefinition.EXAM_VIEW_FROM_LIST)
|
.newAction(ActionDefinition.EXAM_VIEW_FROM_LIST)
|
||||||
.withSelect(table::getSelection, PageAction::applySingleSelectionAsEntityKey, EMPTY_SELECTION_TEXT_KEY)
|
.withSelect(table::getSelection, PageAction::applySingleSelectionAsEntityKey, EMPTY_SELECTION_TEXT_KEY)
|
||||||
.publishIf(table::hasAnyContent, false)
|
.publish(false)
|
||||||
|
|
||||||
.newAction(ActionDefinition.EXAM_MODIFY_FROM_LIST)
|
.newAction(ActionDefinition.EXAM_MODIFY_FROM_LIST)
|
||||||
.withSelect(
|
.withSelect(
|
||||||
table.getGrantedSelection(currentUser, NO_MODIFY_PRIVILEGE_ON_OTHER_INSTITUTION),
|
table.getGrantedSelection(currentUser, NO_MODIFY_PRIVILEGE_ON_OTHER_INSTITUTION),
|
||||||
action -> modifyExam(action, table),
|
action -> modifyExam(action, table),
|
||||||
EMPTY_SELECTION_TEXT_KEY)
|
EMPTY_SELECTION_TEXT_KEY)
|
||||||
.publishIf(() -> userGrant.im() && table.hasAnyContent(), false);
|
.publishIf(() -> userGrant.im(), false);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -142,19 +142,19 @@ public class InstitutionList implements TemplateComposer {
|
||||||
table::getSelection,
|
table::getSelection,
|
||||||
PageAction::applySingleSelectionAsEntityKey,
|
PageAction::applySingleSelectionAsEntityKey,
|
||||||
EMPTY_SELECTION_TEXT_KEY)
|
EMPTY_SELECTION_TEXT_KEY)
|
||||||
.publishIf(table::hasAnyContent, false)
|
.publish(false)
|
||||||
|
|
||||||
.newAction(ActionDefinition.INSTITUTION_MODIFY_FROM_LIST)
|
.newAction(ActionDefinition.INSTITUTION_MODIFY_FROM_LIST)
|
||||||
.withSelect(
|
.withSelect(
|
||||||
table::getSelection,
|
table::getSelection,
|
||||||
PageAction::applySingleSelectionAsEntityKey,
|
PageAction::applySingleSelectionAsEntityKey,
|
||||||
EMPTY_SELECTION_TEXT_KEY)
|
EMPTY_SELECTION_TEXT_KEY)
|
||||||
.publishIf(() -> instGrant.m() && table.hasAnyContent(), false)
|
.publishIf(() -> instGrant.m(), false)
|
||||||
|
|
||||||
.newAction(ActionDefinition.INSTITUTION_TOGGLE_ACTIVITY)
|
.newAction(ActionDefinition.INSTITUTION_TOGGLE_ACTIVITY)
|
||||||
.withExec(this.pageService.activationToggleActionFunction(table, EMPTY_SELECTION_TEXT_KEY))
|
.withExec(this.pageService.activationToggleActionFunction(table, EMPTY_SELECTION_TEXT_KEY))
|
||||||
.withConfirm(this.pageService.confirmDeactivation(table))
|
.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)
|
.newAction(ActionDefinition.LMS_SETUP_VIEW_FROM_LIST)
|
||||||
.withSelect(table::getSelection, PageAction::applySingleSelectionAsEntityKey, EMPTY_SELECTION_TEXT_KEY)
|
.withSelect(table::getSelection, PageAction::applySingleSelectionAsEntityKey, EMPTY_SELECTION_TEXT_KEY)
|
||||||
.publishIf(table::hasAnyContent, false)
|
.publish(false)
|
||||||
|
|
||||||
.newAction(ActionDefinition.LMS_SETUP_MODIFY_FROM_LIST)
|
.newAction(ActionDefinition.LMS_SETUP_MODIFY_FROM_LIST)
|
||||||
.withSelect(
|
.withSelect(
|
||||||
table.getGrantedSelection(currentUser, NO_MODIFY_PRIVILEGE_ON_OTHER_INSTITUTION),
|
table.getGrantedSelection(currentUser, NO_MODIFY_PRIVILEGE_ON_OTHER_INSTITUTION),
|
||||||
PageAction::applySingleSelectionAsEntityKey, EMPTY_SELECTION_TEXT_KEY)
|
PageAction::applySingleSelectionAsEntityKey, EMPTY_SELECTION_TEXT_KEY)
|
||||||
.publishIf(() -> userGrant.im() && table.hasAnyContent(), false)
|
.publishIf(() -> userGrant.im(), false)
|
||||||
|
|
||||||
.newAction(ActionDefinition.LMS_SETUP_TOGGLE_ACTIVITY)
|
.newAction(ActionDefinition.LMS_SETUP_TOGGLE_ACTIVITY)
|
||||||
.withSelect(
|
.withSelect(
|
||||||
|
@ -186,7 +186,7 @@ public class LmsSetupList implements TemplateComposer {
|
||||||
action -> LmsSetupForm.testLmsSetup(action, null, restService)),
|
action -> LmsSetupForm.testLmsSetup(action, null, restService)),
|
||||||
EMPTY_SELECTION_TEXT_KEY)
|
EMPTY_SELECTION_TEXT_KEY)
|
||||||
.withConfirm(this.pageService.confirmDeactivation(table))
|
.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),
|
institutionNameFunction),
|
||||||
EMPTY_SELECTION_TEXT)
|
EMPTY_SELECTION_TEXT)
|
||||||
.noEventPropagation()
|
.noEventPropagation()
|
||||||
.publishIf(table::hasAnyContent, false)
|
.publish(false)
|
||||||
|
|
||||||
.newAction(ActionDefinition.QUIZ_DISCOVERY_EXAM_IMPORT)
|
.newAction(ActionDefinition.QUIZ_DISCOVERY_EXAM_IMPORT)
|
||||||
.withConfirm(importQuizConfirm(table, restService))
|
.withConfirm(importQuizConfirm(table, restService))
|
||||||
|
@ -243,7 +243,7 @@ public class QuizLookupList implements TemplateComposer {
|
||||||
table.getGrantedSelection(currentUser, NO_MODIFY_PRIVILEGE_ON_OTHER_INSTITUTION),
|
table.getGrantedSelection(currentUser, NO_MODIFY_PRIVILEGE_ON_OTHER_INSTITUTION),
|
||||||
action -> this.importQuizData(action, table),
|
action -> this.importQuizData(action, table),
|
||||||
EMPTY_SELECTION_TEXT)
|
EMPTY_SELECTION_TEXT)
|
||||||
.publishIf(() -> examGrant.im() && table.hasAnyContent(), false);
|
.publishIf(() -> examGrant.im(), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Function<QuizData, String> quizDataLmsSetupNameFunction(final ResourceService resourceService) {
|
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)
|
.newAction(ActionDefinition.SEB_CLIENT_CONFIG_VIEW_FROM_LIST)
|
||||||
.withSelect(table::getSelection, PageAction::applySingleSelectionAsEntityKey, EMPTY_SELECTION_TEXT_KEY)
|
.withSelect(table::getSelection, PageAction::applySingleSelectionAsEntityKey, EMPTY_SELECTION_TEXT_KEY)
|
||||||
.publishIf(table::hasAnyContent, false)
|
.publish(false)
|
||||||
|
|
||||||
.newAction(ActionDefinition.SEB_CLIENT_CONFIG_MODIFY_FROM_LIST)
|
.newAction(ActionDefinition.SEB_CLIENT_CONFIG_MODIFY_FROM_LIST)
|
||||||
.withSelect(
|
.withSelect(
|
||||||
table.getGrantedSelection(this.currentUser, NO_MODIFY_PRIVILEGE_ON_OTHER_INSTITUTION),
|
table.getGrantedSelection(this.currentUser, NO_MODIFY_PRIVILEGE_ON_OTHER_INSTITUTION),
|
||||||
PageAction::applySingleSelectionAsEntityKey, EMPTY_SELECTION_TEXT_KEY)
|
PageAction::applySingleSelectionAsEntityKey, EMPTY_SELECTION_TEXT_KEY)
|
||||||
.publishIf(() -> clientConfigGrant.im() && table.hasAnyContent(), false)
|
.publishIf(() -> clientConfigGrant.im(), false)
|
||||||
|
|
||||||
.newAction(ActionDefinition.SEB_CLIENT_CONFIG_TOGGLE_ACTIVITY)
|
.newAction(ActionDefinition.SEB_CLIENT_CONFIG_TOGGLE_ACTIVITY)
|
||||||
.withSelect(
|
.withSelect(
|
||||||
|
@ -186,7 +186,7 @@ public class SEBClientConfigList implements TemplateComposer {
|
||||||
this.pageService.activationToggleActionFunction(table, EMPTY_SELECTION_TEXT_KEY),
|
this.pageService.activationToggleActionFunction(table, EMPTY_SELECTION_TEXT_KEY),
|
||||||
EMPTY_SELECTION_TEXT_KEY)
|
EMPTY_SELECTION_TEXT_KEY)
|
||||||
.withConfirm(this.pageService.confirmDeactivation(table))
|
.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()),
|
action -> this.sebClientLogDetailsPopup.showDetails(action, table.getSingleSelectedROWData()),
|
||||||
EMPTY_SELECTION_TEXT)
|
EMPTY_SELECTION_TEXT)
|
||||||
.noEventPropagation()
|
.noEventPropagation()
|
||||||
.publishIf(table::hasAnyContent, false);
|
.publish(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
private Function<ExtendedClientEvent, String> examNameFunction() {
|
private Function<ExtendedClientEvent, String> examNameFunction() {
|
||||||
|
|
|
@ -336,7 +336,7 @@ public class SEBExamConfigForm implements TemplateComposer {
|
||||||
return pageAction.withEntityKey(
|
return pageAction.withEntityKey(
|
||||||
new EntityKey(selectedExamMapping.examId, EntityType.EXAM));
|
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)
|
.newAction(ActionDefinition.SEB_EXAM_CONFIG_VIEW_PROP_FROM_LIST)
|
||||||
.withSelect(configTable::getSelection, PageAction::applySingleSelectionAsEntityKey,
|
.withSelect(configTable::getSelection, PageAction::applySingleSelectionAsEntityKey,
|
||||||
EMPTY_SELECTION_TEXT_KEY)
|
EMPTY_SELECTION_TEXT_KEY)
|
||||||
.publishIf(configTable::hasAnyContent, false)
|
.publish(false)
|
||||||
|
|
||||||
.newAction(ActionDefinition.SEB_EXAM_CONFIG_MODIFY_PROP_FROM_LIST)
|
.newAction(ActionDefinition.SEB_EXAM_CONFIG_MODIFY_PROP_FROM_LIST)
|
||||||
.withSelect(
|
.withSelect(
|
||||||
configTable.getGrantedSelection(this.currentUser, NO_MODIFY_PRIVILEGE_ON_OTHER_INSTITUTION),
|
configTable.getGrantedSelection(this.currentUser, NO_MODIFY_PRIVILEGE_ON_OTHER_INSTITUTION),
|
||||||
PageAction::applySingleSelectionAsEntityKey, EMPTY_SELECTION_TEXT_KEY)
|
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)
|
.newAction(ActionDefinition.SEB_EXAM_CONFIG_IMPORT_TO_NEW_CONFIG)
|
||||||
.withSelect(
|
.withSelect(
|
||||||
|
|
|
@ -223,16 +223,16 @@ public class UserAccountList implements TemplateComposer {
|
||||||
|
|
||||||
.newAction(ActionDefinition.USER_ACCOUNT_VIEW_FROM_LIST)
|
.newAction(ActionDefinition.USER_ACCOUNT_VIEW_FROM_LIST)
|
||||||
.withSelect(table::getSelection, PageAction::applySingleSelectionAsEntityKey, EMPTY_SELECTION_TEXT_KEY)
|
.withSelect(table::getSelection, PageAction::applySingleSelectionAsEntityKey, EMPTY_SELECTION_TEXT_KEY)
|
||||||
.publishIf(table::hasAnyContent, false)
|
.publish(false)
|
||||||
|
|
||||||
.newAction(ActionDefinition.USER_ACCOUNT_MODIFY_FROM_LIST)
|
.newAction(ActionDefinition.USER_ACCOUNT_MODIFY_FROM_LIST)
|
||||||
.withSelect(table::getSelection, this::editAction, EMPTY_SELECTION_TEXT_KEY)
|
.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)
|
.newAction(ActionDefinition.USER_ACCOUNT_TOGGLE_ACTIVITY)
|
||||||
.withExec(this.pageService.activationToggleActionFunction(table, EMPTY_SELECTION_TEXT_KEY))
|
.withExec(this.pageService.activationToggleActionFunction(table, EMPTY_SELECTION_TEXT_KEY))
|
||||||
.withConfirm(this.pageService.confirmDeactivation(table))
|
.withConfirm(this.pageService.confirmDeactivation(table))
|
||||||
.publishIf(() -> userGrant.m() && table.hasAnyContent(), false);
|
.publishIf(() -> userGrant.m(), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
private PageAction editAction(final PageAction pageAction) {
|
private PageAction editAction(final PageAction pageAction) {
|
||||||
|
|
|
@ -216,7 +216,7 @@ public class UserActivityLogs implements TemplateComposer {
|
||||||
action -> this.showDetails(action, table.getSingleSelectedROWData()),
|
action -> this.showDetails(action, table.getSingleSelectedROWData()),
|
||||||
EMPTY_SELECTION_TEXT)
|
EMPTY_SELECTION_TEXT)
|
||||||
.noEventPropagation()
|
.noEventPropagation()
|
||||||
.publishIf(table::hasAnyContent, false);
|
.publish(false);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue