Skip to content

Commit

Permalink
chore(main): #225 fix sonar issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Marthym committed Aug 25, 2024
1 parent be9b462 commit 748e62f
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public Mono<Entity<WebFeed>> update(@PathVariable("id") String id, @Valid @Reque
sink.next(Entity.identify(WebFeed.builder()
.location(feedLocation)
.description(ff.description())
.tags(Set.of(ff.tags()))
.tags(Set.copyOf(ff.tags()))
.name(ff.name())
.build()).withId(id));
})
Expand All @@ -143,7 +143,7 @@ public Mono<Entity<WebFeed>> update(@PathVariable("id") String id, @Valid @Reque
public Mono<ResponseEntity<Entity<WebFeed>>> subscribe(@Valid @RequestBody Mono<FeedForm> feedForm) {
return feedForm.map(form -> {
URI uri = URI.create(form.location());
Set<String> tags = Optional.ofNullable(form.tags()).map(Set::of).orElseGet(Set::of);
Set<String> tags = Optional.ofNullable(form.tags()).map(Set::copyOf).orElseGet(Set::of);
return Entity.identify(WebFeed.builder()
.location(uri)
.tags(tags)
Expand Down Expand Up @@ -174,7 +174,7 @@ public Flux<Entity<WebFeed>> importFeeds(@RequestBody @Valid Flux<FeedForm> feed
return Entity.identify(WebFeed.builder()
.location(uri)
.name(Optional.ofNullable(form.name()).orElseGet(uri::getHost))
.tags(Set.of(form.tags()))
.tags(Set.copyOf(form.tags()))
.build())
.withId(Hasher.identify(uri));
}).collectList()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
import jakarta.validation.constraints.NotBlank;
import org.hibernate.validator.constraints.URL;

import java.util.Set;

public record FeedForm(
@NotBlank String name,
@NotBlank @URL String location,
String description,
String[] tags
Set<String> tags
) {
}
3 changes: 1 addition & 2 deletions seaside/src/common/components/TagInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
class="input input-ghost input-xs w-32 flex-grow focus:outline-none placeholder:capitalize"
type="text" @keydown="onKeydown">
<ul v-if="displayProposal && proposal.length > 0"
class="py-3 shadow menu bg-neutral border-primary-content border border-opacity-20 dropdown-content w-60"
tabindex="0">
class="py-3 shadow menu bg-neutral border-primary-content border border-opacity-20 dropdown-content w-60">
<li v-for="tag in proposal" v-bind:key="tag"><a
:class="{'proposal-selected': proposal[proposalIndex] === tag}"
@click="selectProposal">{{ tag }}</a></li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
:placeholder="t('config.password.form.old.placeholder')"
autocomplete="current-password"
class="input input-bordered w-full insecureWarning placeholder:capitalize"
tabindex="1"
type="password" @blur.prevent="onBlurOldPassword()"/>
<button class="btn join-item" @click.stop.prevent="onToggleView">
<button class="btn join-item" @click.stop.prevent="onToggleView" tabindex="-1">
<EyeIcon class="h-6 w-6"/>
</button>
</div>
Expand All @@ -19,9 +18,8 @@
:placeholder="t('config.password.form.new.placeholder')"
autocomplete="new-password"
class="input input-bordered join-item w-full placeholder:capitalize"
tabindex="2"
type="password" @blur.prevent="onBlurNewPassword()"/>
<button class="btn join-item" @click.stop.prevent="onToggleView">
<button class="btn join-item" @click.stop.prevent="onToggleView" tabindex="-1">
<EyeIcon class="h-6 w-6"/>
</button>
</div>
Expand All @@ -31,9 +29,9 @@
<div class="join w-full">
<input v-model="confirmPassword" :class="{'input-error': errors.confirm, 'input-success': success.confirm}"
:placeholder="t('config.password.form.confirm.placeholder')"
autocomplete="new-password" class="input input-bordered w-full placeholder:capitalize" tabindex="3"
autocomplete="new-password" class="input input-bordered w-full placeholder:capitalize"
type="password" @blur.prevent="onBlurConfirmPassword()"/>
<button class="btn join-item" @click.stop.prevent="onToggleView">
<button class="btn join-item" @click.stop.prevent="onToggleView" tabindex="-1">
<EyeIcon class="h-6 w-6"/>
</button>
</div>
Expand Down
24 changes: 14 additions & 10 deletions seaside/src/security/pages/LoginPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,28 @@
<div class="card-body">
<form @submit.prevent="onLogin">
<h2 class="card-title">{{ t('main.application') }}</h2>
<div class="form-control">
<label class="label"><span class="label-text">{{ t('login.username') }}</span></label>
<label class="form-control w-full">
<span class="label">
<span class="label-text">{{ t('login.username') }}</span>
</span>
<input ref="usrInput" v-model="username" :class="{'input-error': formValidation}"
:placeholder="t('login.username')"
class="input input-bordered"
tabindex="1"
type="text">
</div>
<div class="form-control mt-4">
<label class="label"><span class="label-text">{{ t('login.password') }}</span>
<a class="label-text-alt" href="#">{{ t('login.password.forget') }}</a></label>
</label>
<label class="form-control w-full">
<span class="label">
<span class="label-text">{{ t('login.password') }}</span>
<span class="label-text-alt"><a tabindex="-1" class="label-text-alt" href="#">{{
t('login.password.forget')
}}</a></span>
</span>
<input v-model="password" :class="{'input-error': formValidation}" :placeholder="t('login.password')"
class="input input-bordered"
tabindex="2"
type="password"
@keyup="formValidation=false">
<button class="btn btn-primary mt-4" tabindex="3" type="submit">{{ t('login.login') }}</button>
</div>
</label>
<button class="btn btn-primary mt-4 w-full mt-8" type="submit">{{ t('login.login') }}</button>
</form>
</div>
</div>
Expand Down

0 comments on commit 748e62f

Please sign in to comment.