SEBSERV-461 fixed

This commit is contained in:
anhefti 2023-12-04 16:56:27 +01:00
parent dd9a0381cb
commit 4cc1eca23e
10 changed files with 26 additions and 13 deletions

View file

@ -188,7 +188,7 @@ public class ConfigTemplateAttributeForm implements TemplateComposer {
new View(-1L, ViewContext.TEMPLATE_VIEW_NAME, 10, 0, templateId),
viewName -> null,
attributeMapping,
1, false, null);
1, false, true, null);
final InputFieldBuilder inputFieldBuilder = this.examConfigurationService.getInputFieldBuilder(
attribute.getConfigAttribute(),

View file

@ -173,6 +173,7 @@ public class SEBSettingsForm implements TemplateComposer {
attributes,
30,
readonly,
false,
publishedMessagePanelViewCallback);
viewContexts.add(viewContext);

View file

@ -79,6 +79,7 @@ public interface ExamConfigurationService {
* @param attributeMapping The attribute mapping if the properties page
* @param rows Number of rows supported for the view.
* @param readonly Indicates if the view shall be composed in read-only mode.
* @param isTemplate indicates if the view context is related to a configuration template or not
* @return ViewContext instance. */
ViewContext createViewContext(
PageContext pageContext,
@ -88,7 +89,8 @@ public interface ExamConfigurationService {
AttributeMapping attributeMapping,
int rows,
boolean readonly,
Runnable valueChageCallback);
boolean isTemplate,
Runnable valueChangeCallback);
Composite createViewGrid(
Composite parent,

View file

@ -44,7 +44,7 @@ public abstract class AbstractTableFieldBuilder implements InputFieldBuilder {
private static final Logger log = LoggerFactory.getLogger(AbstractTableFieldBuilder.class);
private static final int ROW_HEIGHT = 20;
private static final int ROW_HEIGHT = 30;
private static final int NAV_HEIGHT = 40;
private static final int TABLE_WIDTH_SPACE = 50;
@ -65,7 +65,11 @@ public abstract class AbstractTableFieldBuilder implements InputFieldBuilder {
this.inputFieldBuilderSupplier = inputFieldBuilderSupplier;
}
protected Table createTable(final Composite parent, final TableContext tableContext) {
protected Table createTable(
final Composite parent,
final TableContext tableContext,
final boolean isTemplate) {
final Table table = new Table(parent, SWT.NONE | SWT.V_SCROLL);
table.setLayout(new GridLayout());
final GridData gridData = new GridData(
@ -74,7 +78,7 @@ public abstract class AbstractTableFieldBuilder implements InputFieldBuilder {
tableContext.orientation.width(),
tableContext.orientation.height());
gridData.heightHint = tableContext.orientation.height() * ROW_HEIGHT + NAV_HEIGHT;
gridData.heightHint = (isTemplate ? 15 : tableContext.orientation.height()) * ROW_HEIGHT + NAV_HEIGHT;
table.setLayoutData(gridData);
table.setHeaderVisible(true);
table.addListener(SWT.Resize, event -> adaptColumnWidth(table, tableContext));

View file

@ -78,7 +78,7 @@ public class CompositeTableFieldBuilder extends AbstractTableFieldBuilder {
final I18nSupport i18nSupport = viewContext.getI18nSupport();
final TableContext tableContext = createTableContext(attribute, viewContext);
final Table table = createTable(parent, tableContext);
final Table table = createTable(parent, tableContext, viewContext.isTemplate);
final String resources = attribute.getResources();
final String[] columnsAndRows = StringUtils.split(

View file

@ -184,7 +184,8 @@ public class ExamConfigurationServiceImpl implements ExamConfigurationService {
final AttributeMapping attributeMapping,
final int rows,
final boolean readonly,
final Runnable valueChageCallback) {
final boolean isTemplate,
final Runnable valueChangeCallback) {
return new ViewContext(
configuration,
@ -197,9 +198,10 @@ public class ExamConfigurationServiceImpl implements ExamConfigurationService {
this.restService,
this.jsonMapper,
this.valueChangeRules,
valueChageCallback),
valueChangeCallback),
this.widgetFactory.getI18nSupport(),
readonly);
readonly,
isTemplate);
}

View file

@ -76,7 +76,7 @@ public class TableFieldBuilder extends AbstractTableFieldBuilder {
final ViewContext viewContext) {
final TableContext tableContext = createTableContext(attribute, viewContext);
final Table table = createTable(parent, tableContext);
final Table table = createTable(parent, tableContext, viewContext.isTemplate);
for (final ConfigurationAttribute columnAttribute : tableContext.getColumnAttributes()) {
final TableColumn column = this.widgetFactory.tableColumnLocalized(

View file

@ -48,6 +48,7 @@ public final class ViewContext {
final ValueChangeListener valueChangeListener;
final I18nSupport i18nSupport;
final boolean readonly;
final boolean isTemplate;
ViewContext(
final Configuration configuration,
@ -57,7 +58,8 @@ public final class ViewContext {
final AttributeMapping attributeContext,
final ValueChangeListener valueChangeListener,
final I18nSupport i18nSupport,
final boolean readonly) {
final boolean readonly,
final boolean isTemplate) {
Objects.requireNonNull(configuration);
Objects.requireNonNull(view);
@ -74,6 +76,7 @@ public final class ViewContext {
this.valueChangeListener = valueChangeListener;
this.i18nSupport = i18nSupport;
this.readonly = readonly;
this.isTemplate = isTemplate;
}
public boolean isReadonly() {

View file

@ -132,7 +132,7 @@ public class InlineTableConverter implements AttributeValueConverter {
value.configurationId,
configurationAttribute.id,
0,
val[1]);
val.length > 1 ? val[1] : null);
if (xml) {
attributeValueConverter.convertToXML(

View file

@ -813,7 +813,8 @@ sebserver.exam.delete.report.list.empty=No dependencies will be deleted.
sebserver.exam.proctoring.actions.open=Proctoring Settings
sebserver.exam.proctoring.form.title=Exam Proctoring Settings
sebserver.exam.proctoring.form.info.title=Remote Proctoring
sebserver.exam.proctoring.form.sebserver.exam.proctoring.form.enabled=Proctoring enabled
sebserver.exam.proctoring.form.info=This allows to integrate a supported external proctoring service.<br/>To integrate Jitsi Meet, JWT based authentication must be enabled.<br/>To integrate Zoom a Zoom higher-plan account is needed and also JWT based authentication.
sebserver.exam.proctoring.form.enabled=Proctoring enabled
sebserver.exam.proctoring.form.enabled.tooltip=Indicates whether the exam proctoring feature is enabled for this exam or not.
sebserver.exam.proctoring.form.type=Type
sebserver.exam.proctoring.form.type.tooltip=The type and server type of the external proctoring service.