Skip to content

Commit

Permalink
CSCEXAM-1406 Revert semantics of minor/major update
Browse files Browse the repository at this point in the history
  • Loading branch information
lupari committed Feb 4, 2025
1 parent a3689ec commit 8f3e62b
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/controllers/admin/SettingsController.java
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ public Result updateUserAgreement(Http.Request request) {
JsonNode body = request.body().asJson();
String eula = body.get("value").asText();
GeneralSettings gs = getOrCreateSettings("eula", eula, null);
if (!body.get("majorUpdate").asBoolean()) {
if (!body.get("minorUpdate").asBoolean()) {
// Since the EULA has changed, force users to accept it again.
String updStatement = "update app_user set user_agreement_accepted = :hasNot";
Update<User> update = DB.createUpdate(User.class, updStatement);
Expand Down
2 changes: 1 addition & 1 deletion ui/src/app/administrative/settings/settings.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<label class="form-check-label ms-2" for="exclude-update">{{
'i18n_minor_agreement_update' | translate
}}</label>
<input id="exclude-update" class="form-check-input" type="checkbox" [(ngModel)]="majorAgreementUpdate" />
<input id="exclude-update" class="form-check-input" type="checkbox" [(ngModel)]="minorAgreementUpdate" />
</div>
</div>

Expand Down
4 changes: 2 additions & 2 deletions ui/src/app/administrative/settings/settings.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import { SettingsService } from './settings.service';
export class SettingsComponent implements OnInit {
config!: AppConfig;
attributes: string[] = [];
majorAgreementUpdate = false;
minorAgreementUpdate = false;

constructor(
private Settings: SettingsService,
Expand All @@ -46,7 +46,7 @@ export class SettingsComponent implements OnInit {
}

updateAgreement = () =>
this.Settings.updateAgreement$(this.config, this.majorAgreementUpdate).subscribe({
this.Settings.updateAgreement$(this.config, this.minorAgreementUpdate).subscribe({
next: this.onSuccess,
error: this.onError,
});
Expand Down
2 changes: 1 addition & 1 deletion ui/src/app/administrative/settings/settings.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export class SettingsService {
constructor(private http: HttpClient) {}

updateAgreement$ = (config: AppConfig, bypassAgreementUpdate = false) =>
this.http.put('/app/settings/agreement', { value: config.eula, majorUpdate: bypassAgreementUpdate });
this.http.put('/app/settings/agreement', { value: config.eula, minorUpdate: bypassAgreementUpdate });

updateDeadline$ = (config: AppConfig) => this.http.put('/app/settings/deadline', { value: config.reviewDeadline });

Expand Down

0 comments on commit 8f3e62b

Please sign in to comment.