Skip to content

Commit

Permalink
Revert "feat(map): download collection metrics [EP-3002] (#328)" (#332)
Browse files Browse the repository at this point in the history
This reverts commit 7815e82.
  • Loading branch information
dan-qc authored Nov 27, 2020
1 parent 7815e82 commit a6da184
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 355 deletions.
2 changes: 0 additions & 2 deletions packages/earth-map/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,8 @@
"@types/react-redux": "^7.1.7",
"chroma-js": "^2.1.0",
"core-js": "^3.6.5",
"file-saver": "^2.0.5",
"fuse.js": "^3.4.4",
"i18next": "^19.8.3",
"jszip": "^3.5.0",
"lodash": "^4.17.15",
"orbit-controls-es6": "^2.0.0",
"prettier": "^1.19.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ import {
import CollectionDelete from '../collection-delete';
import { CollectionEditPlaces } from '../collection-editplaces';
import { CollectionRename } from '../collection-rename';
import { CollectionDownloadMetrics } from '../collection-downloadmetrics';
import './styles.scss';

interface IProps {
Expand All @@ -55,9 +54,6 @@ const CollectionDetails = (props: IProps) => {
const [isAddingPlaces, setIsAddingPlaces] = useState(false);
const [isRenaming, setIsRenaming] = useState(false);
const [isDeleting, setIsDeleting] = useState(false);
const [isOnDownloadMetrics, setIsOnDownloadMetrics] = useState(false);
const [isDownloadingMetrics, setIsDownloadingMetrics] = useState(false);
const [downloadError, setDownloadError] = useState('');

const canEdit = privateGroups.includes(data.organization);

Expand Down Expand Up @@ -98,66 +94,30 @@ const CollectionDetails = (props: IProps) => {
</Card>

{hasLocations ? (
<>
<Card className="c-legend-item-group">
{canEdit && (
<button
className="marapp-qa-actioneditinline ng-button ng-button-link ng-edit-card-button ng-text-transform-remove"
onClick={toggleEditPlaces}
>
{t('edit')}
</button>
)}
<h2 className="ng-text-display-s ng-body-color ng-margin-medium-bottom ng-margin-top-remove">
{t('Collection places')} ({locations.length})
</h2>
<p>
{locations
.filter((x) => !!x)
.map((location) => (
<Pill
label={location.name}
key={location.id}
className="marapp-qa-locationpill ng-margin-small-right ng-margin-small-bottom"
/>
))}
</p>
</Card>
<Card className="c-legend-item-group ng-margin-top">
<h2 className="ng-text-display-s ng-body-color ng-margin-medium-bottom ng-margin-top-remove">
{t('Download metrics')}
&nbsp;
<i className="ng-icon-download-outline ng-vertical-align-middle" />
</h2>
<p>
{isDownloadingMetrics ? (
<>{t('Your selected metric files should be ready soon')}.</>
) : (
<>
{t(
'Individual metrics related to each of the places in your collection can be viewed once downloaded'
)}
.{t('Select single or multiple metric data files for download')}.
</>
)}
</p>
<Card className="c-legend-item-group">
{canEdit && (
<button
className="marapp-qa-actiondownloadmetrics ng-button ng-button-secondary"
onClick={() => setIsOnDownloadMetrics(true)}
disabled={isDownloadingMetrics}
className="marapp-qa-actioneditinline ng-button ng-button-link ng-edit-card-button ng-text-transform-remove"
onClick={toggleEditPlaces}
>
{isDownloadingMetrics ? (
<>
<Spinner size="nano" position="relative" className="ng-display-inline" />
{t('Downloading metrics')}
</>
) : (
<>{t('Download metric data files')}</>
)}
{t('edit')}
</button>
{downloadError && <p className="ng-form-error-block ng-margin-top">{downloadError}</p>}
</Card>
</>
)}
<h2 className="ng-text-display-s ng-body-color ng-margin-medium-bottom ng-margin-top-remove">
{t('Collection places')} ({locations.length})
</h2>
<p>
{locations
.filter((x) => !!x)
.map((location) => (
<Pill
label={location.name}
key={location.id}
className="marapp-qa-locationpill ng-margin-small-right ng-margin-small-bottom"
/>
))}
</p>
</Card>
) : (
<Card className="c-legend-item-group">
<h2 className="ng-text-display-s ng-body-color ng-margin-bottom">
Expand Down Expand Up @@ -198,17 +158,6 @@ const CollectionDetails = (props: IProps) => {
{isDeleting && (
<CollectionDelete collection={data} isDeleting={isDeleting} setIsDeleting={setIsDeleting} />
)}

{isOnDownloadMetrics && (
<CollectionDownloadMetrics
collection={data}
onCancel={() => setIsOnDownloadMetrics(false)}
onDownloadStart={() => [setIsDownloadingMetrics(true), setIsOnDownloadMetrics(false)]}
onDownloadEnd={() => setIsDownloadingMetrics(false)}
onDownloadError={setDownloadError}
onDownloadSuccess={() => setDownloadError('')}
/>
)}
</div>
);

Expand Down

This file was deleted.

This file was deleted.

10 changes: 0 additions & 10 deletions packages/earth-map/src/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,6 @@
"Renaming collection": "Renaming collection",
"Delete": "Delete",
"Are you sure you want to permanently delete this collection": "Are you sure you want to permanently delete this collection",
"Download metrics": "Download metrics",
"Downloading metrics": "Downloading metrics",
"Individual metrics related to each of the places in your collection can be viewed once downloaded": "Individual metrics related to each of the places in your collection can be viewed once downloaded",
"Select single or multiple metric data files for download": "Select single or multiple metric data files for download",
"Download metric data files": "Download metric data files",
"Your selected metric files should be ready soon": "Your selected metric files should be ready soon",
"Select metrics for download": "Select metrics for download",
"Select metrics to download data files": "Select metrics to download data files",
"Select a file type for download": "Select a file type for download",
"Download": "Download",
"Search results": "Search results",
"Download metric as a": "Download metric as a",
"Featured places": "Featured places",
Expand Down
10 changes: 0 additions & 10 deletions packages/earth-map/src/locales/es/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,6 @@
"Renaming collection": "Renombrar colección",
"Delete": "Eliminar",
"Are you sure you want to permanently delete this collection": "¿Estás seguro de que deseas eliminar esta colección de forma permanente",
"Download metrics": "Descargar métricas",
"Downloading metrics": "Descarga de métricas",
"Individual metrics related to each of the places in your collection can be viewed once downloaded": "Las métricas individuales relacionadas con cada uno de los lugares de su colección se pueden ver una vez descargadas",
"Select single or multiple metric data files for download": "Seleccione archivos de datos de métricas únicos o múltiples para descargar",
"Download metric data files": "Descargar archivos de datos de métricas",
"Your selected metric files should be ready soon": "Sus archivos de métricas seleccionados deberían estar listos pronto",
"Select metrics for download": "Seleccionar métricas para descargar",
"Select metrics to download data files": "Seleccionar métricas para descargar archivos de datos",
"Select a file type for download": "Seleccione un tipo de archivo para descargar",
"Download": "Descargar",
"Search results": "Resultados de la búsqueda",
"Download metric as a": "Descargar métrica como",
"Featured places": "Lugares destacados",
Expand Down
Loading

0 comments on commit a6da184

Please sign in to comment.