Skip to content

Commit

Permalink
SEBSERV-461 fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
anhefti committed Dec 4, 2023
1 parent dd9a038 commit 4cc1eca
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ public void compose(final PageContext pageContext) {
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(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ public void compose(final PageContext pageContext) {
attributes,
30,
readonly,
false,
publishedMessagePanelViewCallback);
viewContexts.add(viewContext);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ Result<AttributeMapping> getAttributes(
* @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,
Expand All @@ -88,7 +89,8 @@ ViewContext createViewContext(
AttributeMapping attributeMapping,
int rows,
boolean readonly,
Runnable valueChageCallback);
boolean isTemplate,
Runnable valueChangeCallback);

Composite createViewGrid(
Composite parent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -65,7 +65,11 @@ public void init(final InputFieldBuilderSupplier inputFieldBuilderSupplier) {
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(
Expand All @@ -74,7 +78,7 @@ protected Table createTable(final Composite parent, final TableContext tableCont
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));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public InputField createInputField(

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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,8 @@ public ViewContext createViewContext(
final AttributeMapping attributeMapping,
final int rows,
final boolean readonly,
final Runnable valueChageCallback) {
final boolean isTemplate,
final Runnable valueChangeCallback) {

return new ViewContext(
configuration,
Expand All @@ -197,9 +198,10 @@ public ViewContext createViewContext(
this.restService,
this.jsonMapper,
this.valueChangeRules,
valueChageCallback),
valueChangeCallback),
this.widgetFactory.getI18nSupport(),
readonly);
readonly,
isTemplate);

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public InputField createInputField(
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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public final class ViewContext {
final ValueChangeListener valueChangeListener;
final I18nSupport i18nSupport;
final boolean readonly;
final boolean isTemplate;

ViewContext(
final Configuration configuration,
Expand All @@ -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);
Expand All @@ -74,6 +76,7 @@ public final class ViewContext {
this.valueChangeListener = valueChangeListener;
this.i18nSupport = i18nSupport;
this.readonly = readonly;
this.isTemplate = isTemplate;
}

public boolean isReadonly() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ private void convert(
value.configurationId,
configurationAttribute.id,
0,
val[1]);
val.length > 1 ? val[1] : null);

if (xml) {
attributeValueConverter.convertToXML(
Expand Down
3 changes: 2 additions & 1 deletion src/main/resources/messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 4cc1eca

Please sign in to comment.