Skip to content

Commit

Permalink
Merge pull request #127 from ledgerleapllc/staging
Browse files Browse the repository at this point in the history
Sync staging to master
  • Loading branch information
ledgerleapllc authored Dec 7, 2022
2 parents 7875479 + 69310e1 commit d666e71
Show file tree
Hide file tree
Showing 122 changed files with 7,381 additions and 5,110 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ deployment:

server_name: "{{ lookup('env', 'CA_MEMBER_PORT_FE_SERVER_NAME') | default('localhost') }}"

shufti:
client_id: "{{ lookup('ansible.builtin.env', 'CA_MEMBER_PORT_BE_SHUFTI_CLIENT_ID') }}"
client_secret: "{{ lookup('ansible.builtin.env', 'CA_MEMBER_PORT_BE_SHUFTI_CLIENT_SECRET') }}"
14 changes: 14 additions & 0 deletions ansible/roles/casper-association-portal-frontend/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,20 @@
- update
- first_setup

- name: Create .env file from .env.j2
template:
src: .env.j2
dest: "{{ app.home }}/env/.env.{{ deployment.env }}"
owner: "{{ security.app_user }}"
group: "{{ security.app_user }}"
mode: 0644
become: true
tags:
- config
- update
- first_setup
when: clone_repo.changed

- name: Yarn install
shell: sudo -u {{ security.app_user }} bash -ilc "cd {{ app.home }} && yarn install"
args:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
NEXT_PUBLIC_BASE_URL={{ lookup('ansible.builtin.env', 'CA_MEMBER_PORT_BE_APP_URL') }}
NEXT_PUBLIC_HELLOSIGN_CLIENT_ID={{ lookup('ansible.builtin.env', 'CA_MEMBER_PORT_BE_HELLOSIGN_CLIENT_ID') }}
NEXT_PUBLIC_SHUFTI_CLIENT_ID={{ lookup('ansible.builtin.env', 'CA_MEMBER_PORT_BE_SHUFTI_CLIENT_ID') }}
NEXT_PUBLIC_SHUFTI_CLIENT_SECRET={{ lookup('ansible.builtin.env', 'CA_MEMBER_PORT_BE_SHUFTI_CLIENT_SECRET') }}
317 changes: 143 additions & 174 deletions components/admin/content-admin-home.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { useState, useEffect } from 'react';
import { Link } from 'react-router-dom';
import ArrowDropDown from '@material-ui/icons/ArrowDropDown';
import { Card, Dropdown, Tooltips } from '../partials';
import OpenVotes from '../home/open-votes';
import TrendingDiscussion from '../home/trending-discussion';

const durations = [
Expand All @@ -27,7 +26,6 @@ const durations = [
];

const ContentAdminHome = ({ stats, changeFrame }) => {
const [showOpenVotes, setShowOpenVotes] = useState(false);
const [timeframe, setTimeframe] = useState({
timeframe_perk: 'last_24hs',
timeframe_comments: 'last_24hs',
Expand All @@ -50,188 +48,159 @@ const ContentAdminHome = ({ stats, changeFrame }) => {
const getLabel = key => durations.find(x => x.key === timeframe[key])?.label;

return (
<div id="dashboard-content-admin-home">
<div id="dashboard-content-admin-homeInner">
<div id="custom-card-wrapper">
<Card className="custom-card-box">
<div className="flex flex-col justify-between p-6 h-full text-center">
<Tooltips
placement="top"
title="Users that are new to the platform or existing users that wish to be verified. usually requires admin approval."
arrow
>
<p className="text-lg font-medium">KYC for Review</p>
</Tooltips>
<p className="text-3xl font-thin">{stats?.totalNewUserReady}</p>
<p className="text-base font-thin">new user ready</p>
<p className="text-3xl font-thin">
{stats?.totalUserVerification}
</p>
<p className="text-base font-thin">ID Verification to Review</p>
<Link
to="/admin/intake"
className="text-lg text-white w-full h-12 flex items-center justify-center rounded-full bg-primary shadow-md focus:outline-none hover:opacity-40"
style={{ marginTop: '10px' }}
>
Review
</Link>
</div>
</Card>
<Card className="custom-card-box">
<div className="flex flex-col justify-between p-6 h-full text-center">
<Tooltips
placement="top"
title="Nodes that fall outside the minimum requirements set by the administrator appear here."
arrow
>
<p className="text-lg font-medium">Failing Nodes</p>
</Tooltips>
<p className="text-5xl font-thin">{stats?.totalFailNode}</p>
{!!stats?.totalFailNode && (
<Link to="/dashboard/nodes?node_failing=1">
<span className="text-lg text-white w-full h-12 flex items-center justify-center rounded-full bg-primary shadow-md focus:outline-none hover:opacity-40">
Review
</span>
</Link>
)}
{!stats?.totalFailNode && <p className="h-12" />}
</div>
</Card>
<Card className="custom-card-box">
<div className="flex flex-col justify-between p-6 h-full text-center">
<Tooltips
placement="top"
title="Tracks the number of user clicks on the perks."
arrow
>
<p className="text-lg font-medium">Perks Viewed</p>
</Tooltips>
<p className="text-5xl font-thin">{stats?.totalPerksViews}</p>
<Dropdown
trigger={
<div
<div className="w-full h-full flex flex-col gap-5">
<div className="w-full flex flex-col xl:flex-row gap-5">
<Card className="w-full xl:w-1/4">
<div className="flex flex-col justify-between p-6 h-full text-center">
<Tooltips
disableTheme
placement="top"
title="Users that are new to the platform or existing users that wish to be verified. usually requires admin approval."
arrow
>
<p className="text-lg font-medium">KYC for Review</p>
</Tooltips>
<p className="text-3xl font-thin">{stats?.new_users_ready}</p>
<p className="text-base font-thin">new user ready</p>
<p className="text-3xl font-thin">{stats?.id_to_review}</p>
<p className="text-base font-thin">ID Verification to Review</p>
<Link
to="/admin/intake"
className="text-lg text-white w-full h-12 flex items-center justify-center rounded-full bg-primary shadow-md focus:outline-none hover:opacity-40"
style={{ marginTop: '10px' }}
>
Review
</Link>
</div>
</Card>
<Card className="w-full xl:w-1/4">
<div className="flex flex-col justify-between p-6 h-full text-center">
<Tooltips
disableTheme
placement="top"
title="Tracks the number of user clicks on the perks."
arrow
>
<p className="text-lg font-medium">Perks Viewed</p>
</Tooltips>
<p className="text-5xl font-thin">{stats?.perks_views}</p>
<Dropdown
trigger={
<div
style={{
position: 'relative',
}}
className="flex justify-center items-center w-full relative h-14"
>
<ArrowDropDown
style={{
position: 'relative',
position: 'absolute',
top: '15px',
right: 0,
}}
className="flex justify-center items-center w-full relative h-14"
/>
( {getLabel('timeframe_perk')} )
</div>
}
>
<ul>
{durations.map((duration, index) => (
<li
className="p-2 hover:text-primary cursor-pointer"
onClick={() =>
appendTimeframe('timeframe_perk', duration.key)
}
key={index}
>
<ArrowDropDown
style={{
position: 'absolute',
top: '15px',
right: 0,
}}
/>
( {getLabel('timeframe_perk')} )
</div>
}
>
<ul>
{durations.map((duration, index) => (
<li
className="p-2 hover:text-primary cursor-pointer"
onClick={() =>
appendTimeframe('timeframe_perk', duration.key)
}
key={index}
>
<p className="w-full relative h-6">{duration.label}</p>
</li>
))}
</ul>
</Dropdown>
</div>
</Card>
<Card className="custom-card-box">
<div className="flex flex-col justify-between p-6 h-full text-center">
<p className="text-lg font-medium">New Comments</p>
<p className="text-5xl font-thin">{stats?.totalNewComments}</p>
<Dropdown
customInnerStyle={{ width: '180px' }}
trigger={
<div
className="flex justify-center items-center w-full relative h-14"
<p className="w-full relative h-6">{duration.label}</p>
</li>
))}
</ul>
</Dropdown>
</div>
</Card>
<Card className="w-full xl:w-1/4">
<div className="flex flex-col justify-between p-6 h-full text-center">
<p className="text-lg font-medium">New Comments</p>
<p className="text-5xl font-thin">{stats?.new_comments}</p>
<Dropdown
trigger={
<div
className="flex justify-center items-center w-full relative h-14"
style={{
position: 'relative',
}}
>
<ArrowDropDown
style={{
position: 'relative',
position: 'absolute',
top: '15px',
right: 0,
}}
/>
( {getLabel('timeframe_comments')} )
</div>
}
>
<ul>
{durations.map((duration, index) => (
<li
className="p-2 hover:text-primary cursor-pointer"
onClick={() =>
appendTimeframe('timeframe_comments', duration.key)
}
key={index}
>
<ArrowDropDown
style={{
position: 'absolute',
top: '15px',
right: 0,
}}
/>
( {getLabel('timeframe_comments')} )
</div>
}
>
<ul>
{durations.map((duration, index) => (
<li
className="p-2 hover:text-primary cursor-pointer"
onClick={() =>
appendTimeframe('timeframe_comments', duration.key)
}
key={index}
>
<p className="w-full relative h-6">{duration.label}</p>
</li>
))}
</ul>
</Dropdown>
</div>
</Card>
<Card className="custom-card-box">
<div className="flex flex-col justify-between p-6 h-full text-center">
<p className="text-lg font-medium">New Threads</p>
<p className="text-5xl font-thin">{stats?.totalNewDiscussions}</p>
<Dropdown
customInnerStyle={{ width: '180px' }}
trigger={
<div
className="flex justify-center items-center w-full relative h-14"
<p className="w-full relative h-6">{duration.label}</p>
</li>
))}
</ul>
</Dropdown>
</div>
</Card>
<Card className="w-full xl:w-1/4">
<div className="flex flex-col justify-between p-6 h-full text-center">
<p className="text-lg font-medium">New Threads</p>
<p className="text-5xl font-thin">{stats?.new_threads}</p>
<Dropdown
trigger={
<div
className="flex justify-center items-center w-full relative h-14"
style={{
position: 'relative',
}}
>
<ArrowDropDown
style={{
position: 'relative',
position: 'absolute',
top: '15px',
right: 0,
}}
/>
( {getLabel('timeframe_discussions')} )
</div>
}
>
<ul>
{durations.map((duration, index) => (
<li
className="p-2 hover:text-primary cursor-pointer"
onClick={() =>
appendTimeframe('timeframe_discussions', duration.key)
}
key={index}
>
<ArrowDropDown
style={{
position: 'absolute',
top: '15px',
right: 0,
}}
/>
( {getLabel('timeframe_discussions')} )
</div>
}
>
<ul>
{durations.map((duration, index) => (
<li
className="p-2 hover:text-primary cursor-pointer"
onClick={() =>
appendTimeframe('timeframe_discussions', duration.key)
}
key={index}
>
<p className="w-full relative h-6">{duration.label}</p>
</li>
))}
</ul>
</Dropdown>
</div>
</Card>
</div>
<div id="custom-card-wrapper2">
<Card className="card-trending-discussion">
<TrendingDiscussion />
</Card>
<Card className={`${showOpenVotes ? 'card-open-votes' : 'hidden'}`}>
<OpenVotes toggleOpenVotes={setShowOpenVotes} />
</Card>
</div>
<p className="w-full relative h-6">{duration.label}</p>
</li>
))}
</ul>
</Dropdown>
</div>
</Card>
</div>
<Card className="w-full h-full overflow-hidden min-h-300px">
<TrendingDiscussion />
</Card>
</div>
);
};
Expand Down
Loading

0 comments on commit d666e71

Please sign in to comment.