Skip to content
This repository has been archived by the owner on Mar 22, 2024. It is now read-only.

Commit

Permalink
feat(stats): update stats base date (#120)
Browse files Browse the repository at this point in the history
  • Loading branch information
Alezco authored Dec 18, 2020
1 parent 767d375 commit 53e5226
Show file tree
Hide file tree
Showing 10 changed files with 78 additions and 71 deletions.
2 changes: 1 addition & 1 deletion .k8s/components/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import env from "@kosko/env";
import { create } from "@socialgouv/kosko-charts/components/nginx";

const manifests = create("app", {
env
env,
});

export default manifests;
28 changes: 16 additions & 12 deletions src/components/download-latest-version-button.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
import { defaultOperatingSystem, getOperatingSystem, OS } from '../utils/os-util'
import versions from '../display-data/versions'
import GetAppIcon from '@material-ui/icons/GetApp'
import { Button, Theme } from '@material-ui/core'
import React, { useEffect, useState } from 'react'
import { trackAppDownload } from '../tracker'
import { makeStyles } from '@material-ui/styles'
import { Button } from "@material-ui/core";
import GetAppIcon from "@material-ui/icons/GetApp";
import { makeStyles } from "@material-ui/styles";
import React, { useEffect, useState } from "react";

const useStyles = makeStyles((theme: Theme) => ({
import versions from "../display-data/versions";
import { trackAppDownload } from "../tracker";
import {
defaultOperatingSystem,
getOperatingSystem,
OS,
} from "../utils/os-util";

const useStyles = makeStyles(() => ({
downloadButton: {
fontWeight: "bold",
},
Expand All @@ -25,14 +30,13 @@ const getDownloadLink = (): string => {
return lastVersionPlatform.url;
};


const DownloadLatestVersionButton = () => {
const classes = useStyles();
const [downloadLink, setDownloadLink] = useState(getDownloadLink());

useEffect(() => {
setDownloadLink(getDownloadLink());
}, [setDownloadLink])
}, [setDownloadLink]);

const onDownloadClick = () => {
const userOperatingSystem = OS[getOperatingSystem()];
Expand All @@ -58,7 +62,7 @@ const DownloadLatestVersionButton = () => {
>
Télécharger
</Button>
)
}
);
};

export default DownloadLatestVersionButton;
18 changes: 9 additions & 9 deletions src/display-data/statistics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,48 +2,48 @@ import { StatisticConfig } from "../types/statistic-types";

export const statisticsConfig: StatisticConfig[] = [
{
label: "Téléchargements d'Archifiltre",
fields: ["download", "appDownload"],
label: "Téléchargements d'Archifiltre",
type: "aggregated",
},
{
label: "Exports CSV (avec empreinte...)",
fields: ["CSV Export", "CSV with hashes Export", "Tree CSV Export"],
label: "Exports CSV (avec empreinte...)",
type: "aggregated",
},
{
label: "Exports Excel (depuis le 26/10/2020)",
field: "Excel Export",
label: "Exports Excel (depuis le 26/10/2020)",
type: "simple",
},
{
label: "Exports METS/RESIP (pour transfert vers SAE)",
fields: ["METS Export", "RESIP Export"],
label: "Exports METS/RESIP (pour transfert vers SAE)",
type: "aggregated",
},
{
label: "Analyses effectuées",
field: "FileTreeDrop",
label: "Analyses effectuées",
type: "simple",
},
{
label: "Rapports d'audit générés",
field: "Audit report export",
label: "Rapports d'audit générés",
type: "simple",
},
{
label: "Vues sur la chaîne Youtube",
field: "youtubeViews",
label: "Vues sur la chaîne Youtube",
type: "simple",
},
{
label: "Visites sur le site (depuis le 09/12/2019)",
field: "visitsCount",
label: "Visites sur le site",
type: "simple",
},
{
label: "Vues sur le Wiki Archifiltre (14 derniers jours)",
field: "wikiViews",
label: "Vues sur le Wiki Archifiltre (14 derniers jours)",
type: "simple",
},
];
24 changes: 12 additions & 12 deletions src/display-data/versions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,32 +9,32 @@ export default [
{
id: OS.WIN64,
url:
"https://github.com/SocialGouv/archifiltre/releases/download/v3.1.1/archifiltre-3.1.1.exe",
"https://github.com/SocialGouv/archifiltre/releases/download/v3.1.1/archifiltre-3.1.1.exe",
},
{
id: OS.WIN32,
url:
"https://github.com/SocialGouv/archifiltre/releases/download/v3.1.1/archifiltre-3.1.1-32bit.exe",
"https://github.com/SocialGouv/archifiltre/releases/download/v3.1.1/archifiltre-3.1.1-32bit.exe",
},
{
id: OS.LINUX,
url:
"https://github.com/SocialGouv/archifiltre/releases/download/v3.1.1/archifiltre-3.1.1.AppImage",
"https://github.com/SocialGouv/archifiltre/releases/download/v3.1.1/archifiltre-3.1.1.AppImage",
},
{
id: OS.MAC,
url:
"https://github.com/SocialGouv/archifiltre/releases/download/v3.1.1/archifiltre-3.1.1.dmg",
"https://github.com/SocialGouv/archifiltre/releases/download/v3.1.1/archifiltre-3.1.1.dmg",
},
{
id: OS.MSI64,
url:
"https://github.com/SocialGouv/archifiltre/releases/download/v3.1.1/archifiltre-3.1.1.msi",
"https://github.com/SocialGouv/archifiltre/releases/download/v3.1.1/archifiltre-3.1.1.msi",
},
{
id: OS.MSI32,
url:
"https://github.com/SocialGouv/archifiltre/releases/download/v3.1.1/archifiltre-3.1.1-32bit.msi",
"https://github.com/SocialGouv/archifiltre/releases/download/v3.1.1/archifiltre-3.1.1-32bit.msi",
},
],
},
Expand All @@ -46,32 +46,32 @@ export default [
{
id: OS.WIN64,
url:
"https://github.com/SocialGouv/archifiltre/releases/download/v3.1.0/archifiltre-3.1.0.exe",
"https://github.com/SocialGouv/archifiltre/releases/download/v3.1.0/archifiltre-3.1.0.exe",
},
{
id: OS.WIN32,
url:
"https://github.com/SocialGouv/archifiltre/releases/download/v3.1.0/archifiltre-3.1.0-32bit.exe",
"https://github.com/SocialGouv/archifiltre/releases/download/v3.1.0/archifiltre-3.1.0-32bit.exe",
},
{
id: OS.LINUX,
url:
"https://github.com/SocialGouv/archifiltre/releases/download/v3.1.0/archifiltre-3.1.0.AppImage",
"https://github.com/SocialGouv/archifiltre/releases/download/v3.1.0/archifiltre-3.1.0.AppImage",
},
{
id: OS.MAC,
url:
"https://github.com/SocialGouv/archifiltre/releases/download/v3.1.0/archifiltre-3.1.0.dmg",
"https://github.com/SocialGouv/archifiltre/releases/download/v3.1.0/archifiltre-3.1.0.dmg",
},
{
id: OS.MSI64,
url:
"https://github.com/SocialGouv/archifiltre/releases/download/v3.1.0/archifiltre-3.1.0.msi",
"https://github.com/SocialGouv/archifiltre/releases/download/v3.1.0/archifiltre-3.1.0.msi",
},
{
id: OS.MSI32,
url:
"https://github.com/SocialGouv/archifiltre/releases/download/v3.1.0/archifiltre-3.1.0-32bit.msi",
"https://github.com/SocialGouv/archifiltre/releases/download/v3.1.0/archifiltre-3.1.0-32bit.msi",
},
],
},
Expand Down
10 changes: 5 additions & 5 deletions src/layout/footer.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
import { Button, Container, Grid, Link, Theme } from "@material-ui/core";
import GitHubIcon from "@material-ui/icons/GitHub";
import LinkedInIcon from "@material-ui/icons/LinkedIn";
import RecordVoiceOverIcon from "@material-ui/icons/RecordVoiceOver";
import TwitterIcon from "@material-ui/icons/Twitter";
import YouTubeIcon from "@material-ui/icons/YouTube";
import RecordVoiceOverIcon from "@material-ui/icons/RecordVoiceOver";
import LinkedInIcon from "@material-ui/icons/LinkedIn";
import { makeStyles } from "@material-ui/styles";
import { Link as GatsbyLink } from "gatsby";
import React, { FC } from "react";

const useStyles = makeStyles((theme: Theme) => ({
feedback: {
padding: theme.spacing(2),
},
footer: {
backgroundColor: theme.palette.background.paper,
marginTop: "auto",
padding: theme.spacing(3, 2),
},
feedback: {
padding: theme.spacing(2),
},
}));

const Footer: FC = () => {
Expand Down
33 changes: 17 additions & 16 deletions src/pages/co-construction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Button, Theme } from "@material-ui/core";
import Box from "@material-ui/core/Box";
import Grid from "@material-ui/core/Grid";
import Typography from "@material-ui/core/Typography";
import MailIcon from "@material-ui/icons/Mail";
import { makeStyles } from "@material-ui/styles";
import { graphql } from "gatsby";
import Img from "gatsby-image";
Expand All @@ -10,7 +11,6 @@ import React, { FC } from "react";
import SEO from "../components/seo";
import ThemeImage from "../components/theme-image";
import Layout from "../layout";
import MailIcon from "@material-ui/icons/Mail";

const useStyles = makeStyles((theme: Theme) => ({
grid: {
Expand Down Expand Up @@ -76,12 +76,13 @@ const CoConstruction: FC<CoConstructionProps> = ({ data }) => {
<strong>Qu’est-ce qu’un Openlab ?</strong>
</Typography>
<p>
Un Openlab est un <strong>moment d’échanges</strong>, le temps d’une journée
ou d’un atelier, entre l’équipe projet Archifiltre et les utilisateur·trice·s,
à propos de l’outil Archifiltre. Durant cet openlab, des ateliers de
co-construction ont lieu afin de discuter des fonctionnalités et de
l’interface de l’outil, des attentes des utilisateur·trice·s et des
cas d’usage rencontrés. Quelques exemples d’ateliers :
Un Openlab est un <strong>moment d’échanges</strong>, le temps d’une
journée ou d’un atelier, entre l’équipe projet Archifiltre et les
utilisateur·trice·s, à propos de l’outil Archifiltre. Durant cet
openlab, des ateliers de co-construction ont lieu afin de discuter
des fonctionnalités et de l’interface de l’outil, des attentes des
utilisateur·trice·s et des cas d’usage rencontrés. Quelques exemples
d’ateliers :
</p>
<ul>
<li>
Expand All @@ -98,13 +99,13 @@ const CoConstruction: FC<CoConstructionProps> = ({ data }) => {
<strong>Quand et où ?</strong>
</Typography>
<p>
Les openlabs peuvent se dérouler <strong>à Paris, en
présentiel</strong> sur une journée, <strong>ou en
visioconférence</strong> sur des temps d'ateliers plus
Les openlabs peuvent se dérouler{" "}
<strong>à Paris, en présentiel</strong> sur une journée,{" "}
<strong>ou en visioconférence</strong> sur des temps d'ateliers plus
courts (maximum 2 heures). La mise en place d’openlabs en
visioconférence avec des outils interactifs nous permet de
multiplier le nombre d’ateliers et d’être en contact avec
l’ensemble de nos utilisateur·trice·s.
multiplier le nombre d’ateliers et d’être en contact avec l’ensemble
de nos utilisateur·trice·s.
</p>
<Typography variant="h6">
<strong>Comment s’inscrire ?</strong>
Expand All @@ -113,10 +114,10 @@ const CoConstruction: FC<CoConstructionProps> = ({ data }) => {
Un mail est envoyé par l’équipe Archifiltre via les listes de
diffusions ou sur les réseaux sociaux (Twitter ou LinkedIn)
indiquant l'organisation d'un nouvel openlab. Les conditions
d’inscription sont communiquées dans ces communications. Dès
la publication ou la réception du message, n’hésitez pas à
vous inscrire très rapidement car <strong>le nombre de places
est limité</strong>.
d’inscription sont communiquées dans ces communications. Dès la
publication ou la réception du message, n’hésitez pas à vous
inscrire très rapidement car{" "}
<strong>le nombre de places est limité</strong>.
</p>
</Grid>
<Grid item md={4} className={classes.image}>
Expand Down
4 changes: 2 additions & 2 deletions src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ import Typography from "@material-ui/core/Typography";
import ArrowForwardIcon from "@material-ui/icons/ArrowForward";
import { makeStyles } from "@material-ui/styles";
import { Link as GatsbyLink } from "gatsby";
import React, { FC } from 'react'
import React, { FC } from "react";

import DownloadLatestVersionButton from "../components/download-latest-version-button";
import HomepageHeader from "../components/homepage-header";
import HomepageTweets from "../components/homepage-tweets";
import Presentation from "../components/presentation";
import ProductFeatures from "../components/product-features";
import SEO from "../components/seo";
import Layout from "../layout";
import DownloadLatestVersionButton from "../components/download-latest-version-button";

const useStyles = makeStyles((theme: Theme) => ({
downloadLink: {
Expand Down
23 changes: 12 additions & 11 deletions src/pages/statistiques.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
import React, { useEffect, useState } from "react";
import SEO from "../components/seo";
import Box from "@material-ui/core/Box";
import Typography from "@material-ui/core/Typography";
import Card from "@material-ui/core/Card";
import CardContent from "@material-ui/core/CardContent";
import Grid from "@material-ui/core/Grid";
import Layout from "../layout";
import axios from "axios";
import { sanitizeStatistics } from "../utils/statistics-util";
import CircularProgress from "@material-ui/core/CircularProgress";
import Grid from "@material-ui/core/Grid";
import Typography from "@material-ui/core/Typography";
import { createStyles, makeStyles } from "@material-ui/styles";
import axios from "axios";
import React, { useEffect, useState } from "react";

import SEO from "../components/seo";
import Layout from "../layout";
import { Statistic } from "../types/statistic-types";
import { sanitizeStatistics } from "../utils/statistics-util";

const useStyles = makeStyles(() =>
createStyles({
grid: {
width: "100%",
},
card: {
display: "flex",
flexDirection: "column",
Expand All @@ -25,6 +23,9 @@ const useStyles = makeStyles(() =>
minHeight: 120,
minWidth: 200,
},
grid: {
width: "100%",
},
statsCount: {
textAlign: "center",
},
Expand Down Expand Up @@ -54,7 +55,7 @@ const Statistiques = () => {
<SEO title="Statistiques" />
<Box p={3} textAlign="center">
<Typography component="h1" variant="h4" color="textPrimary">
Statistiques (depuis le 17 avril 2019)
Statistiques (depuis le 1 janvier 2020)
</Typography>
</Box>
{isLoading ? (
Expand Down
6 changes: 3 additions & 3 deletions src/utils/os-util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ export const operatingSystems = [
{
id: OS.MSI32,
key: "Msi32",
name: "Windows MSI 32 bits"
name: "Windows MSI 32 bits",
},
{
id: OS.MSI64,
key: "Msi64",
name: "Windows MSI 64 bits"
}
name: "Windows MSI 64 bits",
},
];

export const defaultOperatingSystem = OS.WIN64;
Expand Down
1 change: 1 addition & 0 deletions src/utils/statistics-util.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { compose, map, sum } from "lodash/fp";

import { statisticsConfig } from "../display-data/statistics";
import {
AggregatedStatisticConfig,
Expand Down

0 comments on commit 53e5226

Please sign in to comment.