Skip to content

Commit 5dbba65

Browse files
committed
Remove useless/unavailable info from AppsIndex
1 parent dc76cc3 commit 5dbba65

File tree

2 files changed

+16
-54
lines changed

2 files changed

+16
-54
lines changed

dashboard/Apps/AppsIndex.react.js

Lines changed: 14 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,6 @@ let CloningNote = ({ app, clone_status, clone_progress }) => {
4545
return <div>Cloning is {progress}% complete</div>
4646
};
4747

48-
let CountsSection = (props) => {
49-
return (
50-
<div className={props.className}>
51-
<div className={styles.section}>{props.title}</div>
52-
{props.children}
53-
</div>
54-
);
55-
};
56-
5748
let Metric = (props) => {
5849
return (
5950
<div className={styles.count}>
@@ -63,46 +54,20 @@ let Metric = (props) => {
6354
);
6455
};
6556

66-
let AppCard = (props) => {
67-
let sharing = null;
68-
if (props.app.collabInfo) {
69-
if (props.app.isOwner()) {
70-
sharing = 'shared with ' + pluralize(props.app.collaboratorCount, 'person', 'people');
71-
} else {
72-
sharing = html`shared by ${props.app.owner}`;
73-
}
74-
}
75-
return (
76-
<li onClick={() => history.pushState(null, html`/apps/${props.app.slug}/browser`)}>
77-
<a className={styles.icon}>
78-
{props.icon ? <img src={props.icon} /> : <Icon width={56} height={56} name='blank-app-outline' fill='#1E384D' />}
79-
</a>
80-
<CountsSection className={styles.plan} title='Current plan'>
81-
<Metric number={dash(props.app.requestLimit)} label='requests/s' />
82-
<Metric number={dash(props.app.requestLimit, Math.floor(props.app.requestLimit / 20))} label='background job' />
83-
<Metric number={dash(props.app.requestLimit, '$' + (props.app.requestLimit - 30) * 10)} label='monthly' />
84-
<a href={html`/apps/${props.app.slug}/settings`} className={styles.edit} onClick={(e) => {
85-
e.stopPropagation();
86-
history.pushState(null, html`/apps/${props.app.slug}/settings`);
87-
}}>Edit</a>
88-
</CountsSection>
89-
<CountsSection className={styles.glance} title='At a glance'>
90-
<Metric number={dash(props.app.requests, prettyNumber(props.app.requests))} label='requests' />
91-
<Metric number={dash(props.app.users, prettyNumber(props.app.users))} label='total users' />
92-
<Metric number={dash(props.app.installations, prettyNumber(props.app.installations))} label='total installations' />
93-
</CountsSection>
94-
<div className={styles.details}>
95-
<a className={styles.appname}>{props.app.name}</a>
96-
{props.app.is_cloning ? <CloningNote
97-
app={props.app}
98-
clone_status={props.app.clone_status}
99-
clone_progress={props.app.clone_progress}/> :
100-
<div>Created <span className={styles.ago}>{howLongAgo(props.app.createdAt)}</span></div>}
101-
</div>
102-
{sharing}
103-
</li>
104-
)
105-
};
57+
let AppCard = ({
58+
app,
59+
icon,
60+
}) => <li onClick={() => history.pushState(null, html`/apps/${app.slug}/browser`)}>
61+
{icon ? <a className={styles.icon}><img src={icon} /></a> : null}
62+
<div className={styles.details}>
63+
<a className={styles.appname}>{app.name}</a>
64+
{app.is_cloning ? <CloningNote
65+
app={app}
66+
clone_status={app.clone_status}
67+
clone_progress={app.clone_progress}/> :
68+
<div>Server version: <span className={styles.ago}>{app.enabledFeatures.serverVersion || 'unknown'}</span></div>}
69+
</div>
70+
</li>
10671

10772
export default class AppsIndex extends React.Component {
10873
constructor() {

dashboard/Apps/AppsIndex.scss

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@
105105
margin: 14px 0;
106106
padding: 0 9px;
107107
height: 74px;
108-
108+
109109
&:hover{
110110
background: #172C3B;
111111
}
@@ -124,13 +124,10 @@
124124
}
125125

126126
.appname {
127+
@include ellipsis();
127128
display: inline-block;
128129
font-size: 22px;
129130
color: white;
130-
max-width: 180px;
131-
overflow: hidden;
132-
text-overflow: ellipsis;
133-
white-space: nowrap;
134131
}
135132

136133
.details {

0 commit comments

Comments
 (0)