Skip to content

Commit

Permalink
Merge pull request #2047 from ORCID/trusted-summary-blocked-users
Browse files Browse the repository at this point in the history
Trusted summary blocked users
  • Loading branch information
leomendoza123 authored Aug 18, 2023
2 parents bf37de2 + e70a28b commit 9b80bb5
Show file tree
Hide file tree
Showing 9 changed files with 169 additions and 64 deletions.
3 changes: 1 addition & 2 deletions src/app/cdk/platform-info/browserlist.regexp.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
// tslint:disable-next-line: max-line-length
export const BROWSERLIST_REGEXP =
/((CPU[ +]OS|iPhone[ +]OS|CPU[ +]iPhone|CPU IPhone OS)[ +]+(13[_.]4|13[_.]([5-9]|\d{2,})|13[_.]7|13[_.]([8-9]|\d{2,})|(1[4-9]|[2-9]\d|\d{3,})[_.]\d+|14[_.]0|14[_.]([1-9]|\d{2,})|14[_.]4|14[_.]([5-9]|\d{2,})|14[_.]8|14[_.](9|\d{2,})|(1[5-9]|[2-9]\d|\d{3,})[_.]\d+|15[_.]0|15[_.]([1-9]|\d{2,})|(1[6-9]|[2-9]\d|\d{3,})[_.]\d+|16[_.]0|16[_.]([1-9]|\d{2,})|(1[7-9]|[2-9]\d|\d{3,})[_.]\d+)(?:[_.]\d+)?)|((?:Chrome).*OPR\/(74|(7[5-9]|[8-9]\d|\d{3,}))\.\d+\.\d+)|(Edge\/(80|(8[1-9]|9\d|\d{3,})|83|(8[4-9]|9\d|\d{3,}))(?:\.\d+)?)|((Chromium|Chrome)\/(80|(8[1-9]|9\d|\d{3,})|83|(8[4-9]|9\d|\d{3,}))\.\d+(?:\.\d+)?)|(Version\/(13\.1|13\.([2-9]|\d{2,})|(1[4-9]|[2-9]\d|\d{3,})\.\d+|14\.0|14\.([1-9]|\d{2,})|(1[5-9]|[2-9]\d|\d{3,})\.\d+|15\.0|15\.([1-9]|\d{2,})|(1[6-9]|[2-9]\d|\d{3,})\.\d+|16\.0|16\.([1-9]|\d{2,})|(1[7-9]|[2-9]\d|\d{3,})\.\d+)(?:\.\d+)? Safari\/)|(Firefox\/(78|(79|[8-9]\d|\d{3,}))\.\d+\.\d+)|(Firefox\/(78|(79|[8-9]\d|\d{3,}))\.\d+(pre|[ab]\d+[a-z]*)?)/
export const BROWSERLIST_REGEXP = /((CPU[ +]OS|iPhone[ +]OS|CPU[ +]iPhone|CPU IPhone OS)[ +]+(13[_.]4|13[_.]([5-9]|\d{2,})|13[_.]7|13[_.]([8-9]|\d{2,})|(1[4-9]|[2-9]\d|\d{3,})[_.]\d+|14[_.]0|14[_.]([1-9]|\d{2,})|14[_.]4|14[_.]([5-9]|\d{2,})|14[_.]8|14[_.](9|\d{2,})|(1[5-9]|[2-9]\d|\d{3,})[_.]\d+|15[_.]0|15[_.]([1-9]|\d{2,})|(1[6-9]|[2-9]\d|\d{3,})[_.]\d+|16[_.]0|16[_.]([1-9]|\d{2,})|(1[7-9]|[2-9]\d|\d{3,})[_.]\d+)(?:[_.]\d+)?)|((?:Chrome).*OPR\/(74|(7[5-9]|[8-9]\d|\d{3,}))\.\d+\.\d+)|(Edge\/(80|(8[1-9]|9\d|\d{3,})|83|(8[4-9]|9\d|\d{3,}))(?:\.\d+)?)|((Chromium|Chrome)\/(80|(8[1-9]|9\d|\d{3,})|83|(8[4-9]|9\d|\d{3,}))\.\d+(?:\.\d+)?)|(Version\/(13\.1|13\.([2-9]|\d{2,})|(1[4-9]|[2-9]\d|\d{3,})\.\d+|14\.0|14\.([1-9]|\d{2,})|(1[5-9]|[2-9]\d|\d{3,})\.\d+|15\.0|15\.([1-9]|\d{2,})|(1[6-9]|[2-9]\d|\d{3,})\.\d+|16\.0|16\.([1-9]|\d{2,})|(1[7-9]|[2-9]\d|\d{3,})\.\d+)(?:\.\d+)? Safari\/)|(Firefox\/(78|(79|[8-9]\d|\d{3,}))\.\d+\.\d+)|(Firefox\/(78|(79|[8-9]\d|\d{3,}))\.\d+(pre|[ab]\d+[a-z]*)?)/
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,27 @@
>
<header class="panel-header">
<!-- orcid logo -->
<img height="40px" src="./assets/vectors/orcid.logo.icon.svg" />
<img
*ngIf="trustedSummary?.status === 'active'"
height="40px"
src="./assets/vectors/orcid.logo.icon.svg"
/>
<img
*ngIf="trustedSummary?.status === 'deprecated'"
height="40px"
src="/assets/vectors/orcid.logo-deprecated.icon.svg"
/>
<img
*ngIf="trustedSummary?.status === 'locked'"
height="40px"
src="./assets/vectors/orcid.logo-locked.icon.svg"
/>
<img
*ngIf="trustedSummary?.status === 'deactivated'"
height="40px"
src="./assets/vectors/orcid.logo-deactivated.icon.svg"
/>

<div *ngIf="trustedSummary">
<a
class="orc-font-body-small cursor-pointer header-name"
Expand All @@ -17,14 +37,35 @@
rel="noopener noreferrer"
>
<h1 class="orc-font-body-large">
<ng-container *ngIf="trustedSummary.status === 'active'">
<ng-container
*ngIf="!trustedSummary?.name"
i18n="@@summary.nameIsPrivateOrLimited"
>Name is private or limited</ng-container
>
<ng-container *ngIf="trustedSummary?.name">{{
trustedSummary.name
}}</ng-container>
</ng-container>
<ng-container
*ngIf="trustedSummary.status === 'locked'"
i18n="@@summary.recordIsLocked"
>
This record is locked
</ng-container>
<ng-container
*ngIf="trustedSummary.status === 'deprecated'"
i18n="@@summary.recordIsDeprecated"
>
This record has been deprecated
</ng-container>

<ng-container
*ngIf="!trustedSummary?.name"
i18n="@@summary.nameIsPrivateOrLimited"
>Name is private or limited</ng-container
*ngIf="trustedSummary.status === 'deactivated'"
i18n="@@summary.recordIsDeactivated"
>
<ng-container *ngIf="trustedSummary?.name">{{
trustedSummary.name
}}</ng-container>
This record has been deactivated
</ng-container>
</h1>

<div class="label-with-icon">
Expand Down Expand Up @@ -90,53 +131,51 @@ <h2 class="orc-font-small-print" i18n="@@summary.affiliations">
[moreLabelSingular]="labelMoreAffiliation"
></app-summary-panel>
</ng-container>

<h2 class="orc-font-small-print" i18n="@@summary.keyDates">KEY DATES</h2>
<div class="card-container">
<ul>
<li>
<div
class="date-item"
[ngClass]="{
'last-date': !lastUpdateDate
}"
>
<label
class="orc-font-small-print caption"
i18n="@@summary.recordCreated"
>Record created</label
>
<label class="orc-font-body-small" *ngIf="!createdToday">{{
creationDateWithOffset | date
}}</label>
<label
class="orc-font-body-small"
*ngIf="createdToday"
i18n="@@shared.today"
>Today</label
>
</div>
</li>
<li>
<div class="date-item last-date" *ngIf="lastUpdateDate">
<label
class="orc-font-small-print caption"
i18n="@@summary.lastUpdated"
>Last updated</label
<ng-container *ngIf="lastUpdateDate || creationDateWithOffset">
<h2 class="orc-font-small-print" i18n="@@summary.keyDates">
KEY DATES
</h2>
<div class="card-container">
<ul>
<li>
<div
*ngIf="creationDateWithOffset"
class="date-item"
[ngClass]="{
'last-date': !lastUpdateDate
}"
>
<label class="orc-font-body-small" *ngIf="!modifiedToday">{{
lastUpdateDate | date
}}</label>
<label
class="orc-font-body-small"
*ngIf="modifiedToday"
i18n="@@shared.today"
>Today</label
>
</div>
</li>
</ul>
</div>
<label
class="orc-font-small-print caption"
i18n="@@summary.recordCreated"
>Record created</label
>
<label class="orc-font-body-small">{{
creationDateWithOffset | date
}}</label>
</div>
</li>
<li *ngIf="lastUpdateDate">
<div class="date-item last-date">
<label
class="orc-font-small-print caption"
i18n="@@summary.lastUpdated"
>Last updated</label
>
<label class="orc-font-body-small" *ngIf="!modifiedToday">{{
lastUpdateDate | date
}}</label>
<label
class="orc-font-body-small"
*ngIf="modifiedToday"
i18n="@@shared.today"
>Today</label
>
</div>
</li>
</ul>
</div>
</ng-container>
</div>
<div
class="column"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
$foreground: map-get($theme, foreground);
$background: map-get($theme, background);

:host {
.main {
background-color: map-get($background, 'ui-background-lightest');
}

Expand All @@ -22,10 +22,8 @@

.panel,
.panel-header {
border-color: mat.get-color-from-palette(
$background,
ui-background-darkest
);
border-color: mat.get-color-from-palette($background,
ui-background-darkest);
}

.panel-header {
Expand All @@ -45,4 +43,4 @@
}
}

@include theme($orcid-app-theme);
@include theme($orcid-app-theme);
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ export class TrustedSummaryComponent implements OnInit, OnDestroy {
this.creationDateWithOffset = this.dateWithOffset(
this.trustedSummary.creation
)
console.log('this.creationDateWithOffset', this.creationDateWithOffset)
// if record was created today
if (
this.creationDateWithOffset.toDateString() ===
Expand Down Expand Up @@ -170,7 +171,7 @@ export class TrustedSummaryComponent implements OnInit, OnDestroy {
: this.labelpublicationgrant,
})
}
this.externalIdentifiers = this.trustedSummary.externalIdentifiers.map(
this.externalIdentifiers = this.trustedSummary.externalIdentifiers?.map(
(id) => {
return {
verified: id.validated,
Expand All @@ -184,7 +185,7 @@ export class TrustedSummaryComponent implements OnInit, OnDestroy {
(this.works.length > 0 ||
this.funds.length > 0 ||
this.peerReviews.length > 0) &&
(this.externalIdentifiers.length > 0 ||
(this.externalIdentifiers?.length > 0 ||
this.trustedSummary.professionalActivitiesCount > 0 ||
this.trustedSummary.externalIdentifiers.length > 0)
) {
Expand All @@ -193,7 +194,7 @@ export class TrustedSummaryComponent implements OnInit, OnDestroy {
this.works.length > 0 ||
this.funds.length > 0 ||
this.peerReviews.length > 0 ||
this.externalIdentifiers.length > 0 ||
this.externalIdentifiers?.length > 0 ||
this.trustedSummary.professionalActivitiesCount > 0
) {
this.twoColumns = true
Expand Down
1 change: 1 addition & 0 deletions src/app/types/trust-summary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export interface TrustedSummary {
professionalActivities: ActivitySummary[]
professionalActivitiesCount: number
externalIdentifiers: ExternalIdentifierSummary[]
status: "locked" | "deprecated" | "deactivated" | "active"
}

export interface ActivitySummary {
Expand Down
21 changes: 21 additions & 0 deletions src/assets/vectors/orcid.logo-deactivated.icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions src/assets/vectors/orcid.logo-deprecated.icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions src/assets/vectors/orcid.logo-locked.icon.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 src/locale/properties/summary/summary.en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,7 @@ summary.moreProfessionalActivities=more Professional activities
summary.moreOtherIdentifiers=more Other Identifiers
summary.moreProfessionalActivitie=more Professional activity
summary.moreOtherIdentifier=more Other Identifier
summary.nameIsPrivateOrLimited=Name is private or limited
summary.recordIsLocked=This record is locked
summary.recordIsDeprecated=This record has been deprecated
summary.recordIsDeactivated=This record has been deactivated

0 comments on commit 9b80bb5

Please sign in to comment.