Tweak insights to support organizations
This commit is contained in:
@@ -66,7 +66,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<div class="rankeds">
|
<div class="rankeds" v-if="account.type === 'user'">
|
||||||
<div v-for="{icon, title, text, rank, progress, value, leaderboard = null} in ranked" class="ranked" :class="{[rank.charAt(0).toLocaleLowerCase()]:rank !== '$', secret:rank === '$'}">
|
<div v-for="{icon, title, text, rank, progress, value, leaderboard = null} in ranked" class="ranked" :class="{[rank.charAt(0).toLocaleLowerCase()]:rank !== '$', secret:rank === '$'}">
|
||||||
<div class="icon">
|
<div class="icon">
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 60" height="44" width="44">
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 60" height="44" width="44">
|
||||||
@@ -91,7 +91,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<section class="container" v-if="contributions.length">
|
<section class="container" v-if="(account.type === 'user')&&(contributions.length)">
|
||||||
<h2>
|
<h2>
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M1 2.5A2.5 2.5 0 013.5 0h8.75a.75.75 0 01.75.75v3.5a.75.75 0 01-1.5 0V1.5h-8a1 1 0 00-1 1v6.708A2.492 2.492 0 013.5 9h3.25a.75.75 0 010 1.5H3.5a1 1 0 100 2h5.75a.75.75 0 010 1.5H3.5A2.5 2.5 0 011 11.5v-9zm13.23 7.79a.75.75 0 001.06-1.06l-2.505-2.505a.75.75 0 00-1.06 0L9.22 9.229a.75.75 0 001.06 1.061l1.225-1.224v6.184a.75.75 0 001.5 0V9.066l1.224 1.224z"></path></svg>
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M1 2.5A2.5 2.5 0 013.5 0h8.75a.75.75 0 01.75.75v3.5a.75.75 0 01-1.5 0V1.5h-8a1 1 0 00-1 1v6.708A2.492 2.492 0 013.5 9h3.25a.75.75 0 010 1.5H3.5a1 1 0 100 2h5.75a.75.75 0 010 1.5H3.5A2.5 2.5 0 011 11.5v-9zm13.23 7.79a.75.75 0 001.06-1.06l-2.505-2.505a.75.75 0 00-1.06 0L9.22 9.229a.75.75 0 001.06 1.061l1.225-1.224v6.184a.75.75 0 001.5 0V9.066l1.224 1.224z"></path></svg>
|
||||||
Notable contributions
|
Notable contributions
|
||||||
@@ -104,7 +104,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section class="container">
|
<section class="container" v-if="account.type === 'user'">
|
||||||
<h2>
|
<h2>
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"><path d="M8.5.75a.75.75 0 00-1.5 0v5.19L4.391 3.33a.75.75 0 10-1.06 1.061L5.939 7H.75a.75.75 0 000 1.5h5.19l-2.61 2.609a.75.75 0 101.061 1.06L7 9.561v5.189a.75.75 0 001.5 0V9.56l2.609 2.61a.75.75 0 101.06-1.061L9.561 8.5h5.189a.75.75 0 000-1.5H9.56l2.61-2.609a.75.75 0 00-1.061-1.06L8.5 5.939V.75z"></path></svg>
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"><path d="M8.5.75a.75.75 0 00-1.5 0v5.19L4.391 3.33a.75.75 0 10-1.06 1.061L5.939 7H.75a.75.75 0 000 1.5h5.19l-2.61 2.609a.75.75 0 101.061 1.06L7 9.561v5.189a.75.75 0 001.5 0V9.56l2.609 2.61a.75.75 0 101.06-1.061L9.561 8.5h5.189a.75.75 0 000-1.5H9.56l2.61-2.609a.75.75 0 00-1.061-1.06L8.5 5.939V.75z"></path></svg>
|
||||||
Highlights
|
Highlights
|
||||||
@@ -155,7 +155,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section class="container">
|
<section class="container" v-if="account.type === 'user'">
|
||||||
<div class="isocalendar">
|
<div class="isocalendar">
|
||||||
<h2>
|
<h2>
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M4.75 0a.75.75 0 01.75.75V2h5V.75a.75.75 0 011.5 0V2h1.25c.966 0 1.75.784 1.75 1.75v10.5A1.75 1.75 0 0113.25 16H2.75A1.75 1.75 0 011 14.25V3.75C1 2.784 1.784 2 2.75 2H4V.75A.75.75 0 014.75 0zm0 3.5h8.5a.25.25 0 01.25.25V6h-11V3.75a.25.25 0 01.25-.25h2zm-2.25 4v6.75c0 .138.112.25.25.25h10.5a.25.25 0 00.25-.25V7.5h-11z"></path></svg>
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M4.75 0a.75.75 0 01.75.75V2h5V.75a.75.75 0 011.5 0V2h1.25c.966 0 1.75.784 1.75 1.75v10.5A1.75 1.75 0 0113.25 16H2.75A1.75 1.75 0 011 14.25V3.75C1 2.784 1.784 2 2.75 2H4V.75A.75.75 0 014.75 0zm0 3.5h8.5a.25.25 0 01.25.25V6h-11V3.75a.25.25 0 01.25-.25h2zm-2.25 4v6.75c0 .138.112.25.25.25h10.5a.25.25 0 00.25-.25V7.5h-11z"></path></svg>
|
||||||
|
|||||||
@@ -64,33 +64,33 @@
|
|||||||
//Computed properties
|
//Computed properties
|
||||||
computed:{
|
computed:{
|
||||||
ranked() {
|
ranked() {
|
||||||
return this.metrics?.rendered.plugins.achievements.list.filter(({leaderboard}) => leaderboard).sort((a, b) => a.leaderboard.type.localeCompare(b.leaderboard.type))
|
return this.metrics?.rendered.plugins.achievements.list?.filter(({leaderboard}) => leaderboard).sort((a, b) => a.leaderboard.type.localeCompare(b.leaderboard.type)) ?? []
|
||||||
},
|
},
|
||||||
achievements() {
|
achievements() {
|
||||||
return this.metrics?.rendered.plugins.achievements.list.filter(({leaderboard}) => !leaderboard).filter(({title}) => !/(?:automater|octonaut|infographile)/i.test(title))
|
return this.metrics?.rendered.plugins.achievements.list?.filter(({leaderboard}) => !leaderboard).filter(({title}) => !/(?:automater|octonaut|infographile)/i.test(title)) ?? []
|
||||||
},
|
},
|
||||||
isocalendar() {
|
isocalendar() {
|
||||||
return this.metrics?.rendered.plugins.isocalendar.svg
|
return (this.metrics?.rendered.plugins.isocalendar.svg ?? "")
|
||||||
.replace(/#ebedf0/gi, "var(--color-calendar-graph-day-bg)")
|
.replace(/#ebedf0/gi, "var(--color-calendar-graph-day-bg)")
|
||||||
.replace(/#9be9a8/gi, "var(--color-calendar-graph-day-L1-bg)")
|
.replace(/#9be9a8/gi, "var(--color-calendar-graph-day-L1-bg)")
|
||||||
.replace(/#40c463/gi, "var(--color-calendar-graph-day-L2-bg)")
|
.replace(/#40c463/gi, "var(--color-calendar-graph-day-L2-bg)")
|
||||||
.replace(/#30a14e/gi, "var(--color-calendar-graph-day-L3-bg)")
|
.replace(/#30a14e/gi, "var(--color-calendar-graph-day-L3-bg)")
|
||||||
.replace(/#216e39/gi, "var(--color-calendar-graph-day-L4-bg)")
|
.replace(/#216e39/gi, "var(--color-calendar-graph-day-L4-bg)")
|
||||||
},
|
},
|
||||||
languages() {
|
languages() {
|
||||||
return this.metrics?.rendered.plugins.languages.favorites
|
return this.metrics?.rendered.plugins.languages.favorites ?? []
|
||||||
},
|
},
|
||||||
activity() {
|
activity() {
|
||||||
return this.metrics?.rendered.plugins.activity.events
|
return this.metrics?.rendered.plugins.activity.events ?? []
|
||||||
},
|
},
|
||||||
contributions() {
|
contributions() {
|
||||||
return this.metrics?.rendered.plugins.notable.contributions
|
return this.metrics?.rendered.plugins.notable.contributions ?? []
|
||||||
},
|
},
|
||||||
account() {
|
account() {
|
||||||
if (!this.metrics)
|
if (!this.metrics)
|
||||||
return null
|
return null
|
||||||
const {login, name} = this.metrics.rendered.user
|
const {login, name} = this.metrics.rendered.user
|
||||||
return {login, name, avatar:this.metrics.rendered.computed.avatar}
|
return {login, name, avatar:this.metrics.rendered.computed.avatar, type:this.metrics?.rendered.account}
|
||||||
},
|
},
|
||||||
url() {
|
url() {
|
||||||
return `${window.location.protocol}//${window.location.host}/about/${this.user}`
|
return `${window.location.protocol}//${window.location.host}/about/${this.user}`
|
||||||
|
|||||||
Reference in New Issue
Block a user