Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/stable'
Browse files Browse the repository at this point in the history
  • Loading branch information
TheGamerzs committed Mar 20, 2021
2 parents 6fb088e + 2a6145a commit 750f0b9
Show file tree
Hide file tree
Showing 10 changed files with 1,780 additions and 2,733 deletions.
36 changes: 17 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,46 +3,44 @@
"version": "2.0.3",
"scripts": {
"start": "nuxt start",
"dev": "node languageUpdater && nuxt-ts",
"build": "rimraf src/langs/* && node languageUpdater && nuxt-ts build && node cryptify",
"dev": "node languageUpdater && nuxt",
"build": "rimraf src/langs/* && node languageUpdater && nuxt build && node cryptify",
"pretty": "prettier --write **/*.vue **/*.js **/*.json **/*.scss"
},
"dependencies": {
"@nuxt/components": "1.2.2",
"@nuxt/typescript-runtime": "2.0.0",
"@nuxt/components": "2.1.2",
"@nuxtjs/auth": "4.9.1",
"@nuxtjs/axios": "5.12.5",
"@nuxtjs/device": "^1.2.7",
"@nuxtjs/axios": "5.13.1",
"@nuxtjs/google-adsense": "1.3.0",
"animejs": "3.2.1",
"axios": "0.21.1",
"chart.js": "2.9.4",
"marked": "1.2.7",
"marked": "2.0.1",
"moment": "2.29.1",
"node-sass": "5.0.0",
"nuxt": "2.14.12",
"nuxt-lazy-load": "1.2.4",
"sass-loader": "10.1.0",
"nuxt": "2.15.2",
"nuxt-lazy-load": "1.2.5",
"tinycolor2": "1.4.2",
"ts-loader": "^8.0.17",
"vue-animejs": "2.1.1",
"vue-carousel-3d": "1.0.1",
"vue-chartjs": "3.5.1",
"vue-i18n": "8.22.2",
"vue-i18n": "8.23.0",
"vue-js-modal": "2.0.0-rc.6",
"vue-scrollmagic": "1.2.0",
"vue-tippy": "4.7.2",
"vue-tippy": "4.7.3",
"vuejs-noty": "0.1.3",
"vuejs-paginate": "2.1.0"
},
"devDependencies": {
"@nuxt/types": "^2.14.12",
"@nuxt/typescript-build": "2.0.4",
"@nuxt/typescript-build": "2.0.6",
"@nuxtjs/google-analytics": "2.4.0",
"@types/chart.js": "2.9.29",
"@types/node": "14.14.17",
"fast-glob": "3.2.4",
"@types/chart.js": "2.9.31",
"@types/node": "14.14.31",
"fast-glob": "3.2.5",
"fibers": "^5.0.0",
"prettier": "2.2.1",
"rimraf": "3.0.2",
"ts-loader": "^8.0.14"
"sass": "^1.32.8",
"sass-loader": "10"
}
}
Binary file added src/assets/images/partners/atomicradio-icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
160 changes: 100 additions & 60 deletions src/components/staff/StaffActivity.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<LineChart
v-if="sU.ready"
:chartdata="sU.chartdata"
:options="options"
:options="sU.options"
class="userChart"
/>
</div>
Expand Down Expand Up @@ -54,7 +54,7 @@
fontColor: "#eaeaea",
stepSize: 2,
min: 0,
max: 16
max: 20
}
}
],
Expand All @@ -65,46 +65,52 @@
}
}
]
},
legend: {
display: true,
labels: {
fontColor: "#ffffff"
}
}
}
};
},
beforeMount() {
this.$graphql(
`{
tickets(token: "${this.$auth.$storage._state["_token.discord"]}") {
ticketId
userId
timestamp
created
accepter
status
supporters
lastUserMessage
messages {
tickets(token: "${this.$auth.$storage._state["_token.discord"]}") {
ticketId
userId
content
sent
}
}
credits {
user {
id
name
tag
avatar
role
roleColor
timestamp
created
accepter
status
supporters
lastUserMessage
messages {
userId
content
sent
}
}
roles {
id
credits {
user {
id
name
tag
avatar
role
roleColor
}
roles {
id
}
}
}
}
`
`
).then(async data => {
let credits = data.credits;
let tickets = data.tickets;
let credits = data.credits,
tickets = data.tickets;
credits.map(user => {
if (
Expand All @@ -114,58 +120,92 @@
}
});
this.tickets = tickets;
this.tickets = tickets.filter(
ticket =>
ticket.timestamp >
new Date(new Date().getTime() - 10 * 24 * 60 * 60 * 1000).valueOf()
);
this.staffMembers.map(sU => {
sU.tickets = this.tickets.filter(
ticket => ticket.accepter === sU.user.id
);
let userTickets = {
acceptedTickets: this.tickets.filter(
ticket => ticket.accepter === sU.user.id
),
joinedTickets: this.tickets.filter(
ticket =>
ticket.accepter !== sU.user.id &&
ticket.supporters &&
ticket.supporters.find(s => s === sU.user.id)
),
a: { allDates: [], counts: {} },
j: { allDates: [], counts: {} }
},
accepted = [],
joined = [];
sU.allDates = [];
userTickets.acceptedTickets.forEach(t =>
userTickets.a.allDates.push(this.formatDate(new Date(t.timestamp)))
);
sU.tickets.map(ticket => {
let date = new Date(ticket.timestamp);
let fDate = this.formatDate(date);
userTickets.joinedTickets.forEach(t =>
userTickets.j.allDates.push(this.formatDate(new Date(t.timestamp)))
);
sU.allDates.push(fDate);
});
userTickets.a.allDates.forEach(
d => (userTickets.a.counts[d] = (userTickets.a.counts[d] || 0) + 1)
);
userTickets.j.allDates.forEach(
d => (userTickets.j.counts[d] = (userTickets.j.counts[d] || 0) + 1)
);
sU.counts = {};
this.last14Days().forEach(d => {
if (userTickets.a.counts[d]) accepted.push(userTickets.a.counts[d]);
else accepted.push(0);
sU.allDates.map(d => {
sU.counts[d] = (sU.counts[d] || 0) + 1;
if (userTickets.j.counts[d]) joined.push(userTickets.j.counts[d]);
else joined.push(0);
});
let last14Days = this.last14Days(),
acceptedTickets = [];
sU.chartdata = {
labels: [],
labels: this.last14Days(),
datasets: [
{
label: "Accepted tickets",
backgroundColor: "rgba(114, 137, 218, 0.5)",
borderColor: "rgba(1, 116, 188, 0.50)",
pointBackgroundColor: "#b3aeff",
fontColor: "white",
data: []
borderColor: "#7289da",
pointBackgroundColor: "#7289da",
pointRadius: 3,
data: accepted
},
{
label: "Joined tickets",
borderColor: "rgba(126, 81, 194, 1)",
borderDash: [5, 5],
pointBackgroundColor: "#7E51C2",
pointRadius: 3,
data: joined
}
]
};
sU.chartdata.labels = last14Days;
sU.options = this.options;
last14Days.forEach(d => {
if (sU.counts[d]) acceptedTickets.push(sU.counts[d]);
else acceptedTickets.push(0);
});
//! Find something that doesn't break.
// let total = {
// accepted: 0,
// joined: 0
// };
sU.chartdata.datasets[0].data = acceptedTickets;
// accepted.forEach(a => (total.accepted += a));
// joined.forEach(j => (total.joined += j));
sU.ready = true;
// sU.options.scales.yAxes[0].ticks.max = Math.max.apply(
// this,
// total.accepted > total.joined ? accepted : joined
// );
console.log(sU);
sU.ready = true;
});
this.loaded = true;
});
},
Expand Down
1 change: 1 addition & 0 deletions src/pages/contributors.vue
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@
"673681900476432387", // Marketing Director
"685969048399249459", // Administrator
"630445337143935009", // Reviewer
"811262682408943616", // Localization Manager
"691396820236107837", // Developer
"691386502566903850", // Designer
"514546359865442304", // Moderator
Expand Down
4 changes: 3 additions & 1 deletion src/pages/partners.vue
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@
import erisly_icon from "~/assets/images/partners/erisly-icon.png";
import onlyhit_icon from "~/assets/images/partners/onlyhit-icon.png";
import reyfm_icon from "~/assets/images/partners/reyfm-icon.jpg";
import atomicradio_icon from "~/assets/images/partners/atomicradio-icon.png";
export default {
name: "Partners",
Expand All @@ -185,7 +186,8 @@
taigabot_icon,
erisly_icon,
onlyhit_icon,
reyfm_icon
reyfm_icon,
atomicradio_icon
],
showModal: false,
hovered: {}
Expand Down
55 changes: 33 additions & 22 deletions src/pages/staff.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class="staff-panel">
<div class="staff-panel" v-if="show">
<div class="flex">
<LoggedIn :user="user" />
<Bar :page="page" />
Expand All @@ -26,26 +26,23 @@
<StaffHandbook v-if="page === 'Staff Handbook'" />
</div>
</div>
<div class="staff-panel" v-else>
<h2 class="text-highlight" style="text-align: center">
Getting data from the API...
</h2>
</div>
</template>

<script>
export default {
name: "Staff",
auth: true,
data() {
return {
user: {},
page: "Staff",
application: null,
sortBy: false
};
},
beforeMount() {
if (this.$auth.loggedIn) {
this.$graphql(
`
async asyncData(context) {
if (context.$auth.loggedIn) {
let { credits } = await context.app.$graphql(
`
{
credits(id: "${this.$auth.user.id}") {
credits(id: "${context.$auth.user.id}") {
user {
id
name
Expand All @@ -60,18 +57,32 @@
}
}
`
).then(data => {
let user = data.credits[0];
),
user = credits[0];
if (user.roles.find(r => r.id === "656913616100130816").length === 0)
this.$router.push("/");
if (user.roles.find(r => r.id === "656913616100130816").length === 0)
context.redirect("/");
this.user = user.user;
});
} else this.$router.push("/login");
return {
user: user.user,
show: true
};
} else context.redirect("/login");
},
data() {
return {
user: {},
page: "Staff",
application: null,
sortBy: false,
show: false
};
},
beforeMount() {},
mounted() {
this.page = "Applications";
console.log(this.show);
this.page = "Staff Handbook";
},
methods: {
updatePage(event) {
Expand Down

0 comments on commit 750f0b9

Please sign in to comment.