Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add encrypted info tooltip and icons #178

Merged
merged 7 commits into from
Apr 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
35 changes: 35 additions & 0 deletions .github/workflows/quality_checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Quality Checks

on:
workflow_dispatch:
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
quality_checks:
name: Quality Checks
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: '16.15.0'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Lint
run : npm run lint

- name: Test
run: |
cd apps/browser/
yarn test
16 changes: 0 additions & 16 deletions .travis.yml

This file was deleted.

12 changes: 12 additions & 0 deletions apps/browser/src/_locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -2411,5 +2411,17 @@
},
"profileMigrationAction": {
"message": "More details"
},
"encryptedInfoTitle": {
"message": "End-to-end encryption"
},
"encryptedInfoContent": {
"message": "Don't lose your Cozy password. Your logins and passwords are encrypted from end-to-end. No one but you can access them, not even Cozy Cloud."
},
"encryptedInfoMoreDetails": {
"message": "More details"
},
"encryptedInfoDismiss": {
"message": "I understand"
}
}
12 changes: 12 additions & 0 deletions apps/browser/src/_locales/fr/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -2459,5 +2459,17 @@
},
"profileMigrationAction": {
"message": "En savoir plus"
},
"encryptedInfoTitle": {
"message": "Chiffré de bout en bout"
},
"encryptedInfoContent": {
"message": "Attention, ne perdez pas votre mot de passe Cozy. Vos identifiants et mots de passe sont chiffrés de bout en bout. Personne d’autre que vous ne peut y accéder, pas même Cozy Cloud."
},
"encryptedInfoMoreDetails": {
"message": "En savoir plus"
},
"encryptedInfoDismiss": {
"message": "J'ai compris"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<div class="encryptedInfo" *ngIf="!tooltipDismissed">
<div class="alert info">
<div class="alert-icon icon-encrypted"></div>
<div class="alert-message">
<div class="alert-title">{{ "encryptedInfoTitle" | i18n }}</div>
<div>{{ "encryptedInfoContent" | i18n }}</div>
</div>
<div class="alert-action">
<button type="button" class="btn link" (click)="moreInfo()">
{{ "encryptedInfoMoreDetails" | i18n }}
</button>
<button type="button" class="btn link" (click)="dismiss()">
{{ "encryptedInfoDismiss" | i18n }}
</button>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import { Component, OnInit } from "@angular/core";

import { I18nService } from "@bitwarden/common/abstractions/i18n.service";
import { StateService } from "@bitwarden/common/abstractions/state.service";
import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service";

import { CozyClientService } from "../../../popup/services/cozyClient.service";

const TOOLTIP_EXPLAIN_ENCRYPTION_DISMISSED = "tooltip_explain_encryption_dismissed";

@Component({
selector: "app-encrypted-info",
templateUrl: "encrypted-info.component.html",
})
export class EncryptedInfoComponent implements OnInit {
tooltipDismissed = true;

constructor(
protected cipherService: CipherService,
protected i18nService: I18nService,
protected stateService: StateService,
protected cozyClientService: CozyClientService
) {}

async ngOnInit() {
const client = await this.cozyClientService.getClientInstance();
const settings = await client.getSettings("passwords", [TOOLTIP_EXPLAIN_ENCRYPTION_DISMISSED]);
this.tooltipDismissed = settings.tooltip_explain_encryption_dismissed;
}

async moreInfo() {
const infoUrl =
"https://support.cozy.io/394-comment-puis-je-parametrer-mon-gestionnaire-de-mot-de-passe/";
window.open(infoUrl);
}

async dismiss() {
const client = await this.cozyClientService.getClientInstance();
await client.saveAfterFetchSettings("passwords", {
tooltip_explain_encryption_dismissed: true,
});

this.tooltipDismissed = true;
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="profileMigration" *ngIf="ready && profilesCount > 0">
<div class="alert">
<div class="alert warning">
<div class="alert-icon cozy-icon-info"></div>
<div class="alert-message">
<div class="alert-title">{{ "profileMigrationTitle" | i18n }}</div>
Expand Down
2 changes: 2 additions & 0 deletions apps/browser/src/popup/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ import { AddGenericComponent } from "../cozy/components/add-generic/add-generic.
import { ViewExpirationDateComponent } from "../vault/popup/components/vault/view-expiration-date.component";
import { ContactAvatarComponent } from "../vault/popup/components/vault/contact-avatar.component";
import { ProfilesMigrationComponent } from "../cozy/components/profiles-migration/profiles-migration.component";
import { EncryptedInfoComponent } from "../cozy/components/encrypted-info/encrypted-info.component";
/* eslint-enable */
/* end Cozy imports */

Expand Down Expand Up @@ -171,6 +172,7 @@ import { ProfilesMigrationComponent } from "../cozy/components/profiles-migratio
ViewExpirationDateComponent,
ContactAvatarComponent,
ProfilesMigrationComponent,
EncryptedInfoComponent,
/* end Cozy components */
],
providers: [CurrencyPipe, DatePipe],
Expand Down
4 changes: 4 additions & 0 deletions apps/browser/src/popup/images/icon-encrypted.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions apps/browser/src/popup/images/icon-unencrypted.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions apps/browser/src/popup/scss/box.scss
Original file line number Diff line number Diff line change
Expand Up @@ -918,4 +918,8 @@ select:focus-visible {
outline: 1px solid themed("boxBackgroundHoverColor");
}
}

.box.list .box-content .box-content-row .no-white-space {
white-space: normal !important;
}
/* end custo */
109 changes: 109 additions & 0 deletions apps/browser/src/popup/scss/cozy-alert.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
.alert {
&.warning {
@include themify($themes) {
background-color: change-color(themed("warningColor"), $alpha: 0.12);
}
.alert-icon {
@include themify($themes) {
background-color: themed("warningColor");
color: themed("warningColor");
}
}
.alert-action {
.btn.link {
@include themify($themes) {
color: themed("warningColor") !important;
}
}
}
}
&.info {
@include themify($themes) {
background-color: change-color(themed("primaryColor"), $alpha: 0.12);
}
.alert-icon {
@include themify($themes) {
background-color: themed("primaryColor");
color: themed("primaryColor");
}
}
.alert-action {
.btn.link {
@include themify($themes) {
color: themed("primaryColor") !important;
}
}
}
}
display: flex;
flex-wrap: wrap;

padding: 8px 16px;

border-radius: 8px;

.alert-icon {
display: flex;

height: 16px;
width: 16px;

margin-right: 12px;
margin-top: 9px;
padding: 7px 0;

font-size: 22px;

@include themify($themes) {
background-color: themed("warningColor");
color: themed("warningColor");
}
}

.alert-message {
display: flex;
flex-wrap: wrap;
flex: auto;
align-items: center;

max-width: calc(100% - 28px);

padding: 8px 0;

.alert-title {
width: 100%;

margin-bottom: 0.35em;
margin-top: -2px;

font-weight: bold;
}
}

.alert-action {
display: block;

width: 100%;

margin-left: auto;
margin-right: -6px;
padding-left: 0;

text-align: right;
text-transform: uppercase;

.btn.link {
@include themify($themes) {
color: themed("warningColor") !important;
}
}
}
}

.profileMigration,
.encryptedInfo {
@include themify($themes) {
background-color: themed("backgroundColorAlt");
}
padding: 16px;
}
75 changes: 0 additions & 75 deletions apps/browser/src/popup/scss/cozy-profiles-migration.scss

This file was deleted.

Loading
Loading