Skip to content

Commit

Permalink
Admin / DOI / Move username to main form so that reset password only …
Browse files Browse the repository at this point in the history
…takes care of password.
  • Loading branch information
fxprunayre committed Jun 19, 2024
1 parent d0b1135 commit 0f117f7
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 48 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ public void updateDoiServer(
entity.setName(doiServer.getName());
entity.setDescription(doiServer.getDescription());
entity.setUrl(doiServer.getUrl());
entity.setUsername(doiServer.getUsername());
entity.setPublicUrl(doiServer.getPublicUrl());
entity.setLandingPageTemplate(doiServer.getLandingPageTemplate());
entity.setPattern(doiServer.getPattern());
Expand Down Expand Up @@ -305,11 +306,6 @@ public void updateDoiServerAuth(
required = true,
example = "")
@PathVariable Integer doiServerId,
@Parameter(
description = "User name",
required = true)
@RequestParam
String username,
@Parameter(
description = "Password",
required = true)
Expand All @@ -319,7 +315,6 @@ public void updateDoiServerAuth(
Optional<DoiServer> existingMapserverOpt = doiServerRepository.findOneById(doiServerId);
if (existingMapserverOpt.isPresent()) {
doiServerRepository.update(doiServerId, entity -> {
entity.setUsername(username);
entity.setPassword(password);
});
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public AnonymousDoiServer(DoiServerDto doiServer) {
this
.setId(doiServer.getId())
.setName(doiServer.getName())
.setUsername(doiServer.getUsername())
.setDescription(doiServer.getDescription())
.setUrl(doiServer.getUrl())
.setLandingPageTemplate(doiServer.getLandingPageTemplate())
Expand All @@ -39,11 +40,6 @@ public AnonymousDoiServer(DoiServerDto doiServer) {
.setPublicationGroups(doiServer.getPublicationGroups());
}

@Override
public String getUsername() {
return "***";
}

@Override
public String getPassword() {
return "***";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,36 +212,36 @@
</div>
</div>

<div data-ng-show="!isUpdate">
<div
class="form-group"
data-ng-class="gnDoiServerEdit.username.$error.required ||
(gnDoiServerEdit.username.$touched && gnDoiServerEdit.username.$invalid) ? 'has-error' : ''"
<div
class="form-group"
data-ng-class="gnDoiServerEdit.username.$error.required ||
(gnDoiServerEdit.username.$touched && gnDoiServerEdit.username.$invalid) ? 'has-error' : ''"
>
<label class="control-label col-sm-3" data-translate="" for="username"
>doiserver-username</label
>
<label class="control-label col-sm-3" data-translate="" for="username"
>doiserver-username</label
>

<div class="col-sm-9">
<input
type="text"
class="form-control"
required=""
id="username"
name="username"
data-ng-model="doiServerSelected.username"
/>
<div class="col-sm-9">
<input
type="text"
class="form-control"
required=""
id="username"
name="username"
data-ng-model="doiServerSelected.username"
/>

<div
class="help-block"
data-ng-messages="gnDoiServerEdit.username.$error"
data-ng-if="gnDoiServerEdit.username.$touched"
>
<p data-ng-message="required" data-translate="">fieldRequired</p>
</div>
<div
class="help-block"
data-ng-messages="gnDoiServerEdit.username.$error"
data-ng-if="gnDoiServerEdit.username.$touched"
>
<p data-ng-message="required" data-translate="">fieldRequired</p>
</div>
</div>
</div>

<div data-ng-show="!isUpdate">
<div
class="form-group"
data-ng-class="gnDoiServerEdit.password.$error.required ||
Expand Down Expand Up @@ -450,19 +450,6 @@
<form id="gn-password-reset" class="form-horizontal" name="gnPasswordReset">
<div class="form-group">
<input type="hidden" name="_csrf" value="{{csrf}}" />
<label class="control-label col-sm-3" data-translate="">username</label>

<div class="col-sm-9">
<input
type="text"
class="form-control"
required=""
data-ng-model="resetUsername"
/>
</div>
</div>

<div class="form-group">
<label class="control-label col-sm-3" data-translate="">password</label>

<div class="col-sm-9">
Expand Down

0 comments on commit 0f117f7

Please sign in to comment.