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

Order and wording fixes #207

Merged
merged 5 commits into from
May 10, 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
4 changes: 2 additions & 2 deletions apps/browser/src/_locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -733,10 +733,10 @@
"message": "List card items on the Tab page for easy auto-fill."
},
"showIdentitiesCurrentTab": {
"message": "Show profiles on Tab page"
"message": "Show contacts on Tab page"
},
"showIdentitiesCurrentTabDesc": {
"message": "List profiles on the Tab page for easy auto-fill."
"message": "List contacts on the Tab page for easy auto-fill."
},
"clearClipboard": {
"message": "Clear clipboard",
Expand Down
4 changes: 2 additions & 2 deletions apps/browser/src/_locales/fr/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -736,10 +736,10 @@
"message": "Lister les éléments de la carte sur la page de l'onglet pour faciliter la saisie automatique."
},
"showIdentitiesCurrentTab": {
"message": "Afficher les profils sur la page Onglet courant"
"message": "Afficher les contacts sur la page Onglet courant"
},
"showIdentitiesCurrentTabDesc": {
"message": "Lister les profils sur la page de l'onglet en cours pour faciliter la saisie automatique."
"message": "Lister les contacts sur la page de l'onglet en cours pour faciliter la saisie automatique."
},
"clearClipboard": {
"message": "Effacer le presse-papiers",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,9 @@ <h2 class="box-header">
</div>
</div>
</div>
<div class="box list">
<!-- Cozy customization -->
<!-- Disable Cards if type is hidden -->
<div class="box list" *ngIf="!dontShowCards">
<h2 class="box-header">
{{ "cards" | i18n }}
<!-- Cozy custo : commented
Expand Down Expand Up @@ -153,63 +155,63 @@ <h2 class="box-header">
</div>
</div>
<!-- Cozy customization -->
<!-- Disable Profiles if empty as they will be replaced by Cozy Contacts -->
<div class="box list" *ngIf="identityCiphers.length > 0">
<!-- Add me and favorite Cozy Contacts -->
<div class="box list" *ngIf="!dontShowIdentities">
<!---->
<h2 class="box-header">
{{ "identities" | i18n }}
<!-- Cozy custo : commented
<span class="flex-right">{{ identityCiphers.length }}</span>
-->
{{ "typeContacts" | i18n }}
</h2>
<div class="box-content">
<app-cipher-row
*ngFor="let identityCipher of identityCiphers"
[cipher]="identityCipher"
*ngFor="let contactCipher of contactCiphers"
[cipher]="contactCipher"
title="{{ 'viewItem' | i18n }}"
[showView]="false"
(onSelected)="viewCipher($event)"
(onView)="viewCipher($event)"
(onAutofill)="fillCipher(identityCipher)"
(onAutofill)="fillCipher(contactCipher)"
></app-cipher-row>
<!-- Cozy custo -->
<div
class="box-content-row padded no-hover"
*ngIf="identityCiphers && !identityCiphers.length"
*ngIf="contactCiphers && !contactCiphers.length"
>
<p class="text-center">{{ "addIdentityExplanation" | i18n }}</p>
<button type="button" class="btn link block" (click)="addIdentityCipher()">
{{ "addIdentity" | i18n }}
<p class="text-center">{{ "addContactExplanation" | i18n }}</p>
<button type="button" class="btn link block" (click)="addContactCipher()">
{{ "addContact" | i18n }}
</button>
</div>
<!-- end custo -->
</div>
</div>
<!-- Cozy customization -->
<!-- Add me and favorite Cozy Contacts -->
<div class="box list">
<!-- Disable Profiles if type is hidden or if empty as they will be replaced by Cozy Contacts -->
<div class="box list" *ngIf="!dontShowIdentities && identityCiphers.length > 0">
<!---->
<h2 class="box-header">
{{ "typeContacts" | i18n }}
{{ "identities" | i18n }}
<!-- Cozy custo : commented
<span class="flex-right">{{ identityCiphers.length }}</span>
-->
</h2>
<div class="box-content">
<app-cipher-row
*ngFor="let contactCipher of contactCiphers"
[cipher]="contactCipher"
*ngFor="let identityCipher of identityCiphers"
[cipher]="identityCipher"
title="{{ 'viewItem' | i18n }}"
[showView]="false"
(onSelected)="viewCipher($event)"
(onView)="viewCipher($event)"
(onAutofill)="fillCipher(contactCipher)"
(onAutofill)="fillCipher(identityCipher)"
></app-cipher-row>
<!-- Cozy custo -->
<div
class="box-content-row padded no-hover"
*ngIf="contactCiphers && !contactCiphers.length"
*ngIf="identityCiphers && !identityCiphers.length"
>
<p class="text-center">{{ "addContactExplanation" | i18n }}</p>
<button type="button" class="btn link block" (click)="addContactCipher()">
{{ "addContact" | i18n }}
<p class="text-center">{{ "addIdentityExplanation" | i18n }}</p>
<button type="button" class="btn link block" (click)="addIdentityCipher()">
{{ "addIdentity" | i18n }}
</button>
</div>
<!-- end custo -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ export class CurrentTabComponent implements OnInit, OnDestroy {
autofillCalloutText: string[] = ["", ""];
protected search$ = new Subject<void>();
private destroy$ = new Subject<void>();
dontShowCards = false;
dontShowIdentities = false;

private totpCode: string;
private totpTimeout: number;
Expand Down Expand Up @@ -334,6 +336,11 @@ export class CurrentTabComponent implements OnInit, OnDestroy {
otherTypes.push(CipherType.Contact);
}

// Cozy customization, forward dontShowCards and dontShowIdentities
// to view to hide completely these types if we do not want to show them
this.dontShowCards = dontShowCards;
this.dontShowIdentities = dontShowIdentities;

const ciphers = await this.cipherService.getAllDecryptedForUrl(
this.url,
otherTypes.length > 0 ? otherTypes : null
Expand Down
4 changes: 4 additions & 0 deletions libs/common/src/vault/services/cipher.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,10 @@ export class CipherService implements CipherServiceAbstraction {
cipher.reprompt = model.reprompt;
cipher.edit = model.edit;

// Cozy customization; creationDate is not forwarded during encrypt contrary to revisionDate.
// I did not understand why. We need it so we forward it here.
cipher.creationDate = model.creationDate;

if (key == null && cipher.organizationId != null) {
key = await this.cryptoService.getOrgKey(cipher.organizationId);
if (key == null) {
Expand Down
8 changes: 7 additions & 1 deletion libs/cozy/contact.helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,15 @@ export const convertContactToCipherData = async (
cipherView.contact.initials = getInitials(contact);
cipherView.contact.primaryEmail = getPrimaryEmail(contact);
cipherView.contact.primaryPhone = getPrimaryPhone(contact);
cipherView.favorite = !!cozyMetadata?.favorite;
cipherView.fields = buildFieldsFromContact(i18nService, contact);
cipherView.contact.me = contact.me;

if (cozyMetadata?.favorite === undefined && contact.me) {
cipherView.favorite = true;
} else {
cipherView.favorite = !!cozyMetadata?.favorite;
}

if (cozyMetadata?.createdAt) {
cipherView.creationDate = new Date(cozyMetadata.createdAt);
}
Expand Down
Loading