Skip to content
This repository was archived by the owner on Dec 18, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
f04187d
upgrade bootstrap package and update first half of styles
Vakmeth May 30, 2023
7f979cd
update margin-right and padding to fit bootstrap version 5.3.0-alpha3
Vakmeth May 30, 2023
b8b29fc
upgrade ember bootstrap version to 5
kcinay055679 May 31, 2023
463a85c
start debuging version
kcinay055679 May 31, 2023
07f0eb6
update bootstrap
kcinay055679 Jul 25, 2023
79ee378
fixing radio buttons
kcinay055679 Jul 26, 2023
67e1c22
fix styling
kcinay055679 Jul 26, 2023
a025de7
remove math random and implement to use custom length and digits for …
njaeggi May 22, 2023
39ef7f9
Password gets generated on default
kcinay055679 May 23, 2023
04181ec
styling
kcinay055679 May 23, 2023
09c8ab1
should work
kcinay055679 May 23, 2023
fdf48d6
styling
kcinay055679 May 23, 2023
6608a9a
Password gets generated correctly
kcinay055679 May 24, 2023
606bf8e
fix tests
kcinay055679 May 24, 2023
0ea01d6
write tests
kcinay055679 May 24, 2023
08916a5
fix prettier and last integration test
njaeggi May 25, 2023
bcb9bc2
remove input change manually and remove generating new random passwor…
njaeggi May 25, 2023
8aa61f3
implement feedback and change workflow of generating passwords
njaeggi May 25, 2023
4ad7ab0
fix frontend specs
njaeggi May 25, 2023
50a9468
adjust styling of generate secure password button
njaeggi May 26, 2023
1c8b82b
improve design
kcinay055679 May 30, 2023
06d632d
change color of switch
kcinay055679 May 30, 2023
e58bf68
improve style of range and switch
kcinay055679 May 30, 2023
2871e6c
remove arrows from number spinner
kcinay055679 May 30, 2023
eca1f82
fix bug in layout on rezize
kcinay055679 May 30, 2023
0758d73
add every hardcoded string to the translation files
kcinay055679 May 30, 2023
a914350
fix linter
kcinay055679 May 30, 2023
cfad883
fix test
kcinay055679 May 30, 2023
4986711
fix translation file
kcinay055679 May 30, 2023
41a60be
implement feedback from marc
kcinay055679 May 30, 2023
5f23b6d
remove unused css class
kcinay055679 May 30, 2023
08bdea8
start adding accordion to the password generator
kcinay055679 May 30, 2023
5ac0788
autoclose accordeon after generating password
kcinay055679 May 31, 2023
07a87d2
fix after rebase
kcinay055679 Jul 26, 2023
257ed50
clean up passoword generator
kcinay055679 Jul 26, 2023
171fe26
Do not generate a password per default
kcinay055679 Jul 26, 2023
ad8ff59
fix tests
kcinay055679 Jul 28, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 42 additions & 15 deletions frontend/app/components/encryptable/form.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import {action} from "@ember/object";
import { action } from "@ember/object";
import AccountValidations from "../../validations/encryptable";
import lookupValidator from "ember-changeset-validations";
import Changeset from "ember-changeset";
import {inject as service} from "@ember/service";
import {tracked} from "@glimmer/tracking";
import { inject as service } from "@ember/service";
import { tracked } from "@glimmer/tracking";
import BaseFormComponent from "../base-form-component";
import {isPresent} from "@ember/utils";
import {capitalize} from "@ember/string";
import {A} from "@ember/array";
import { capitalize } from "@ember/string";
import { A } from "@ember/array";
import { addObserver } from "@ember/object/observers";
import { isEmpty, isPresent } from "@ember/utils";

export default class Form extends BaseFormComponent {
@service store;
Expand All @@ -24,6 +25,11 @@ export default class Form extends BaseFormComponent {

@tracked errors;

@tracked withSymbols = true;
@tracked passwordLength = 14;

@tracked isGenExpanded = false;

AccountValidations = AccountValidations;

//create array proxy that ember checks the changes in each loop for dropdown, ember's rendering engine
Expand Down Expand Up @@ -79,6 +85,8 @@ export default class Form extends BaseFormComponent {
AccountValidations
);

this.presetTeamAndFolder();

this.store.findAll("team").then((teams) => {
this.assignableTeams = teams;
});
Expand All @@ -89,13 +97,25 @@ export default class Form extends BaseFormComponent {
this.store.findRecord("encryptable-credential", this.record.id);
}

presetTeamAndFolder() {
let selectedFolder = this.args.folder || this.navService.selectedFolder;
let selectedTeam =
selectedFolder?.get("team") || this.navService.selectedTeam;

if (!isEmpty(selectedTeam)) {
this.selectedTeam = selectedTeam;
}
if (!isEmpty(selectedFolder)) {
this.selectedFolder = selectedFolder;
}
}
get availableFolders() {
return isPresent(this.selectedTeam)
? this.store
.peekAll("folder")
.filter(
(folder) => folder.team.get("id") === this.selectedTeam.get("id")
)
.peekAll("folder")
.filter(
(folder) => folder.team.get("id") === this.selectedTeam.get("id")
)
: [];
}

Expand All @@ -105,17 +125,24 @@ export default class Form extends BaseFormComponent {
this.args.onAbort();
}
}

@action
togglePwGen() {
this.isGenExpanded = !this.isGenExpanded;
}
@action
setRandomPassword() {
let pass = "";
const array = new Uint32Array(1);
const PASSWORD_CHARS =
"abcdefghijklmnopqrstuvwxyz!@#$%^&*()-+<>ABCDEFGHIJKLMNOP1234567890";
for (let i = 0; i < 14; i++) {
let r = Math.floor(Math.random() * PASSWORD_CHARS.length);
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOP1234567890".concat(
this.withSymbols ? "!@#$%^&*()-+<>" : ""
);
for (let i = 0; i < this.passwordLength; i++) {
window.crypto.getRandomValues(array);
let r = array[0] % PASSWORD_CHARS.length;
pass += PASSWORD_CHARS.charAt(r);
}
this.changeset.cleartextPassword = pass;
this.changeset.set("cleartextPassword", pass);
}

@action
Expand Down
61 changes: 32 additions & 29 deletions frontend/app/styles/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,6 @@ $font-family-sans-serif: var(--pzsh-font-family) !default;
flex-direction: row;
}

.float-right {
float: right !important;
}

.pt-10 {
padding-top: 10%;
}
Expand All @@ -71,13 +67,6 @@ $font-family-sans-serif: var(--pzsh-font-family) !default;
margin-top: 1%;
}

.ml-2 {
margin-left: 2%;
}
.ml-5 {
margin-left: 5%;
}

.mb-2 {
margin-bottom: 2%;
}
Expand Down Expand Up @@ -122,24 +111,10 @@ li a {
margin-bottom: 5px !important;
}

.ml-5 {
margin-left: 5%;
}

.mt-32 {
margin-top: 32px;
}

.ml-15 {
margin-left: 15px;
}

.ml-254 {
margin-left: 254px !important;
}
.ml-238 {
margin-left: 238px !important;
}
.mt-60 {
margin-top: 54px !important;
}
Expand Down Expand Up @@ -298,10 +273,6 @@ li a {
background-color: #f8f8f8;
}

.pl-none {
padding-left: 0 !important;
}

.search-badge {
padding: 5px 10px 3px 8px !important;
margin-left: 10px;
Expand Down Expand Up @@ -498,6 +469,9 @@ h5, h6 {
text-align: center;
}

#cleartext-password{
margin-bottom: 0.5em;
}
.changelog-container h2 {
font-size: 1.5rem;
}
Expand All @@ -517,3 +491,32 @@ h5, h6 {
color: white !important;
}


.x-toggle:checked + label > .x-toggle-material.x-toggle-btn::after{
background-color: #1b8dc6;
}

.x-toggle:not(:checked) + label > .x-toggle-material.x-toggle-btn::after {
border: lightslategray solid 1px;
}

.x-toggle-component.x-toggle-focused .x-toggle-btn:not(.x-toggle-disabled) {
&::after, &::before {
box-shadow: none;
}
}


.password-range {
&::-moz-range-progress{
background-color: #1e5a96;
}
}

.password-length {
-moz-appearance: textfield;
&::-webkit-outer-spin-button, &::-webkit-inner-spin-button{
-webkit-appearance: none;
margin: 0;
}
}
2 changes: 2 additions & 0 deletions frontend/app/styles/custom-bootstrap.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
$btn-color: #ff0000;
$btn-color: #ff0000
1 change: 0 additions & 1 deletion frontend/app/styles/encryptable-form.scss
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
width: 100%;
max-width: 100%;
height: 35px;
margin-left: 5%;
}

.d-flex .ember-basic-dropdown {
Expand Down
4 changes: 0 additions & 4 deletions frontend/app/styles/nav-bar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,6 @@
padding-left: 32px !important;
}

.ml-238 {
margin-left: 238px !important;
}

.side-nav-bar-teams-list .list-group-item:hover {
cursor: pointer;
background-color: #1E5A96 !important;
Expand Down
3 changes: 3 additions & 0 deletions frontend/app/styles/password-strength-meter.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,6 @@
width: 100% !important;
background-color: #4dd100 !important;
}
.progress-height{
height: 0.3rem;
}
8 changes: 3 additions & 5 deletions frontend/app/styles/side-nav-bar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
background-color: white;
}

.toggle-button.active {
.toggle-button-active {
background-color: white !important;
border-color: #238BCA !important;
}
Expand Down Expand Up @@ -142,7 +142,7 @@
background-color: rgba(0, 0, 0, 0.12) !important;
}

.toggle-button.active {
.toggle-button-active {
background-color: rgba(0, 0, 0, 0.12) !important;
border-color: #116289 !important;
}
Expand All @@ -169,7 +169,6 @@
border-bottom-right-radius: 0;
border-color: rgba(167, 167, 167, 0.44) !important;
}

}

@media screen and (min-width: 1501px) {
Expand All @@ -189,15 +188,14 @@
border-bottom-right-radius: 0;
border-color: rgba(167, 167, 167, 0.44) !important;
}

}

@media screen and (min-width: 992px) {
.sidebar {
background-color: #ffffff;
}

.toggle-button.active {
.toggle-button-active {
background-color: #fff !important;
border-color: #238BCA !important;
}
Expand Down
12 changes: 6 additions & 6 deletions frontend/app/templates/components/admin/user/table.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -4,37 +4,37 @@
<th>
{{t "admin.users.index.username"}}
<span role="button" {{action "sortBy" "username"}} id="sort-username">
<img class="icon-big-button float-right" src="/assets/images/angle-down-blue.svg" alt="v">
<img class="icon-big-button float-end" src="/assets/images/angle-down-blue.svg" alt="v">
</span>
</th>
<th>
{{t "admin.users.index.name"}}
<span role="button" {{action "sortBy" "givenname"}} id="sort-name">
<img class="icon-big-button float-right" src="/assets/images/angle-down-blue.svg" alt="v">
<img class="icon-big-button float-end" src="/assets/images/angle-down-blue.svg" alt="v">
</span>
</th>
<th>
{{t "admin.users.index.last_login_at"}}
<span role="button" {{action "sortBy" "last_login_at"}} id="sort-login-at">
<img class="icon-big-button float-right" src="/assets/images/angle-down-blue.svg" alt="v">
<img class="icon-big-button float-end" src="/assets/images/angle-down-blue.svg" alt="v">
</span>
</th>
<th>
{{t "admin.users.index.last_login_from"}}
<span role="button" {{action "sortBy" "last_login_from"}} id="sort-login-from">
<img class="icon-big-button float-right" src="/assets/images/angle-down-blue.svg" alt="v">
<img class="icon-big-button float-end" src="/assets/images/angle-down-blue.svg" alt="v">
</span>
</th>
<th>
{{t "admin.users.index.auth"}} {{t "admin.users.index.provider_uid"}}
<span role="button" {{action "sortBy" "auth"}} id="sort-auth">
<img class="icon-big-button float-right" src="/assets/images/angle-down-blue.svg" alt="v">
<img class="icon-big-button float-end" src="/assets/images/angle-down-blue.svg" alt="v">
</span>
</th>
<th width="200">
{{t "admin.users.index.role"}}
<span role="button" {{action "sortBy" "role"}} id="sort-role">
<img class="icon-big-button float-right" src="/assets/images/angle-down-blue.svg" alt="v">
<img class="icon-big-button float-end" src="/assets/images/angle-down-blue.svg" alt="v">
</span>
</th>
<th>{{t "admin.users.index.action"}}</th>
Expand Down
8 changes: 4 additions & 4 deletions frontend/app/templates/components/encryptable/card-show.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</div>
</div>
<div class="col-auto">
<img class="img d-inline w-30 float-left icon-big-button" src="/assets/images/key.svg" alt="key">
<img class="img d-inline w-30 float-start icon-big-button" src="/assets/images/key.svg" alt="key">
</div>
</div>
</div>
Expand All @@ -22,12 +22,12 @@
{{else}}
<div class="card encryptable-card encryptable-detail">
<div role="button" class="card-header" {{on "click" this.swapToPreview}}>
<img class="img d-inline mr-2 icon-button" src="/assets/images/key.svg" alt="key">
<img class="img d-inline me-2 icon-button" src="/assets/images/key.svg" alt="key">
<p class="d-inline">{{@encryptable.name}}</p>
</div>
<div class="card-body">
<div class="row mb-2">
<div class="col-sm-8 pr-0">
<div class="col-sm-8 pe-0">
<Input class="d-inline form-control" disabled="true" @value={{@encryptable.cleartextUsername}} />
</div>
<div class="col-sm-3">
Expand All @@ -37,7 +37,7 @@
</div>
</div>
<div class="row">
<div class="col-sm-8 pr-0">
<div class="col-sm-8 pe-0">
<div class="password-wrapper">
<Input class="d-inline form-control" disabled="true" @value={{@encryptable.cleartextPassword}} />
<div role="button" class="show-password-link show-password-link-sm {{if this.isPasswordVisible "visibility-hidden"}}" {{on "click" this.showPassword}} href="#">{{t "encryptable/credentials.show.show_password"}}</div>
Expand Down
Loading