Skip to content

Commit ebfc3c9

Browse files
committed
Show notice when custom configurations apply to the draft
1 parent 32c0c02 commit ebfc3c9

File tree

8 files changed

+20
-33
lines changed

8 files changed

+20
-33
lines changed

src/SIL.XForge.Scripture/ClientApp/src/app/serval-administration/serval-projects.component.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
<mat-label>Filter projects...</mat-label>
44
<input matInput (keyup)="updateSearchTerm($event.target)" id="project-filter" />
55
</mat-form-field>
6+
<mat-checkbox [(ngModel)]="showProjectsWithCustomServalConfig" (change)="updateServalConfigFilter()">
7+
Projects with custom Serval Configuration only
8+
</mat-checkbox>
69
</div>
7-
<mat-checkbox [(ngModel)]="showProjectsWithCustomServalConfig" (change)="updateServalConfigFilter()"
8-
>Projects with custom serval configs only</mat-checkbox
9-
>
1010
@if (!isLoading) {
1111
@if (length > 0) {
1212
<table mat-table id="projects-table" [dataSource]="rows">

src/SIL.XForge.Scripture/ClientApp/src/app/serval-administration/serval-projects.component.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,9 @@ mat-form-field {
1212
gap: 4px;
1313
white-space: nowrap;
1414
}
15+
16+
.projects-controls {
17+
display: flex;
18+
align-items: center;
19+
justify-content: space-between;
20+
}

src/SIL.XForge.Scripture/ClientApp/src/app/translate/draft-generation/draft-generation-steps/_draft-generation-steps-theme.scss

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
--mat-stepper-header-icon-foreground-color: #{mat.get-theme-color($theme, neutral, if($is-dark, 90, 98))};
99
--mat-stepper-header-edit-state-icon-background-color: #{mat.get-theme-color($theme, primary, if($is-dark, 30, 10))};
1010
--mat-stepper-header-edit-state-icon-foreground-color: #{mat.get-theme-color($theme, neutral, if($is-dark, 90, 98))};
11-
--mat-stepper-link-color: #{mat.get-theme-color($theme, primary, if($is-dark, 60, 50))};
12-
--mat-stepper-link-hover-color: #{mat.get-theme-color($theme, primary, if($is-dark, 70, 60))};
1311
}
1412

1513
@mixin theme($theme) {

src/SIL.XForge.Scripture/ClientApp/src/app/translate/draft-generation/draft-generation-steps/draft-generation-steps.component.html

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -307,16 +307,6 @@ <h2>
307307
<div class="confirm-translate confirm-books">
308308
{{ selectedTranslateBooksAsString() }}
309309
</div>
310-
@if (servalConfig != null) {
311-
<div class="serval-config-toggle">
312-
<u (click)="showCustomConfig = !showCustomConfig">{{
313-
showCustomConfig ? t("hide_custom_serval_config") : t("show_custom_config")
314-
}}</u>
315-
</div>
316-
@if (showCustomConfig) {
317-
<pre class="custom-config">{{ servalConfig | json }}</pre>
318-
}
319-
}
320310
</mat-card>
321311
<h2>{{ t("summary_notifications") }}</h2>
322312
@if (currentUserEmail != null) {
@@ -328,6 +318,11 @@ <h2>{{ t("summary_notifications") }}</h2>
328318
</div>
329319
</mat-card>
330320
}
321+
@if (isCustomConfigSet) {
322+
<app-notice icon="info" type="info">
323+
{{ t("custom_configurations_apply") }}
324+
</app-notice>
325+
}
331326

332327
<div class="button-strip">
333328
<button mat-stroked-button matStepperPrevious>

src/SIL.XForge.Scripture/ClientApp/src/app/translate/draft-generation/draft-generation-steps/draft-generation-steps.component.scss

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -159,11 +159,3 @@ app-notice {
159159
--mat-table-row-item-outline-width: 0;
160160
padding-top: 16px;
161161
}
162-
163-
.serval-config-toggle {
164-
color: var(--mat-stepper-link-color);
165-
:hover {
166-
cursor: pointer;
167-
color: var(--mat-stepper-link-hover-color);
168-
}
169-
}

src/SIL.XForge.Scripture/ClientApp/src/app/translate/draft-generation/draft-generation-steps/draft-generation-steps.component.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1359,8 +1359,8 @@ describe('DraftGenerationStepsComponent', () => {
13591359
expect(trainingGroups[1].ranges[1]).toEqual('1 Samuel');
13601360
});
13611361

1362-
it('records the custom serval config', () => {
1363-
expect(component['servalConfig']).toEqual('{ "custom": "value" }');
1362+
it('sets the custom serval config flag', () => {
1363+
expect(component['isCustomConfigSet']).toEqual(true);
13641364
});
13651365
});
13661366

src/SIL.XForge.Scripture/ClientApp/src/app/translate/draft-generation/draft-generation-steps/draft-generation-steps.component.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { JsonPipe } from '@angular/common';
21
import { Component, DestroyRef, EventEmitter, OnInit, Output, ViewChild } from '@angular/core';
32
import { FormsModule } from '@angular/forms';
43
import { MatButton } from '@angular/material/button';
@@ -117,8 +116,7 @@ interface ProjectPendingUpdate {
117116
TranslocoModule,
118117
TranslocoMarkupModule,
119118
BookMultiSelectComponent,
120-
ConfirmSourcesComponent,
121-
JsonPipe
119+
ConfirmSourcesComponent
122120
]
123121
})
124122
export class DraftGenerationStepsComponent implements OnInit {
@@ -153,7 +151,6 @@ export class DraftGenerationStepsComponent implements OnInit {
153151
expandUnusableTranslateBooks = false;
154152
expandUnusableTrainingBooks = false;
155153
isStepsCompleted = false;
156-
showCustomConfig = false;
157154

158155
protected nextClickedOnLanguageVerification = false;
159156
protected hasLoaded = false;
@@ -162,7 +159,7 @@ export class DraftGenerationStepsComponent implements OnInit {
162159
protected trainingSources: DraftSource[] = [];
163160
protected trainingTargets: DraftSource[] = [];
164161
protected trainingDataFiles: Readonly<TrainingData>[] = [];
165-
protected servalConfig?: string;
162+
protected isCustomConfigSet = false;
166163

167164
private trainingDataQuery?: RealtimeQuery<TrainingDataDoc>;
168165
private trainingDataQuerySubscription?: Subscription;
@@ -293,7 +290,7 @@ export class DraftGenerationStepsComponent implements OnInit {
293290
// See if there is an existing training scripture range
294291
const draftConfig: DraftConfig | undefined =
295292
this.activatedProject.projectDoc?.data?.translateConfig.draftConfig;
296-
this.servalConfig = draftConfig?.servalConfig;
293+
this.isCustomConfigSet = draftConfig?.servalConfig != null;
297294
const hasPreviousTrainingRange: boolean =
298295
(draftConfig?.lastSelectedTrainingScriptureRanges ?? []).length > 0;
299296

src/SIL.XForge.Scripture/ClientApp/src/assets/i18n/non_checking_en.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,11 +242,11 @@
242242
"configure_advanced_settings_header": "Advanced",
243243
"configure_advanced_settings_title": "Advanced settings",
244244
"confirm_codes_correct_to_continue": "Please confirm the language codes are correct before continuing",
245+
"custom_configurations_apply": "Custom draft configurations have been applied by an administrator.",
245246
"email_me": "Email me at {{ email }} when the draft is finished.",
246247
"fast_training_warning": "Enabling this will save time but greatly reduce accuracy.",
247248
"fast_training": "Enable Fast Training",
248249
"generate_draft": "Generate draft",
249-
"hide_custom_serval_config": "Hide custom serval configuration",
250250
"loading": "Loading...",
251251
"loading_projects": "Loading project sync status...",
252252
"next": "Next",
@@ -257,7 +257,6 @@
257257
"reference_books": "Reference books",
258258
"remote_changes": "The source configuration for draft generation has been modified. Please start a new draft and review the latest source configuration.",
259259
"remote_changes_start_over": "Start over",
260-
"show_custom_config": "Show custom serval configuration",
261260
"summary_header": "Summary",
262261
"summary_notifications": "Notifications",
263262
"summary_title": "Summary",

0 commit comments

Comments
 (0)