Commit d1312d7d authored by pacome's avatar pacome

[client/angled-project] a better error splash

parent 3085873d
......@@ -740,6 +740,20 @@ The list of existing groups can be edited by the people in charge of the platfor
en: 'Read mode'
},
backToProject: {
fr: `retour au projet`,
nl: 'projectpagina', // nltocheck
en: 'back to project'
},
savingError: {
fr: `Une **erreur de serveur** s'est produite, nous ne pouvons pas faire grand chose maintenant, veuillez réessayer.`,
nl:
'Er is een **serverfout** gebeurd, we kunnen nu niet veel meer doen, probeer het nog eens.', // nltocheck
en:
'A **server error** happened, we can not do much now, please try again.'
},
'nova/desc/refnova': {
fr: 'référence NOVA',
nl: 'NOVA referentie'
......
......@@ -19,12 +19,12 @@ import * as debug from 'debug';
import { DIV, NodeOrOptional } from 'sdi/components/elements';
import header from 'sdi/components/header';
import footer from 'sdi/components/footer';
import { loop, getApiUrl, } from 'sdi/app';
import { loop, getApiUrl } from 'sdi/app';
import { loadUniverse } from 'angled-core/events/universe';
import {
loadAllBaseLayers,
loadAllDatasetMetadata,
loadAllDatasetMetadata
} from 'angled-core/events/map';
import { loadAllRefsDebug } from 'angled-core/events/ref';
import { loadSubscriptions, startNotifications } from 'angled-core/events/sub';
......@@ -63,7 +63,7 @@ const renderDisplayForm = () => wrappedMain('form', form.renderDisplayForm());
const renderSplash = () => wrappedMain('splash', splash());
const renderSaving = () => wrappedMain('saving', saving());
const renderSaving = () => wrappedMain('splash saving', saving());
const renderMain = () => {
// weird, but TS 3.7.2 complains if switch on `getLayout()` - pm
......
import { DIV, H1 } from 'sdi/components/elements';
import tr, { Translated } from 'sdi/locale';
import { getSavingError, getCurrentProjectId } from 'angled-project/src/queries/project';
import tr from 'sdi/locale';
import {
getSavingError,
getCurrentProjectId
} from 'angled-project/src/queries/project';
import { makeLabel } from 'sdi/components/button';
import { clearProjectForm } from 'angled-project/src/events/project';
import { setLayout } from 'angled-project/src/events/app';
import { markdown } from 'sdi/ports/marked';
export const renderSaving = () =>
getSavingError()
.fold(
DIV({
className: 'saving'
}, H1({}, tr.core('saving')),
DIV({ className: 'splash-content' },
DIV({ className: 'loader-anim' }),
)),
renderSavingError
);
getSavingError().fold(
DIV(
{ className: 'splash-content' },
H1({}, tr.core('saving')),
DIV({ className: 'loader-anim' })
),
renderSavingError
);
const navigateFormButton = makeLabel('navigate', 2, () =>
tr.angled('backToProject')
);
const navigateFormButton = makeLabel('navigate', 2, () => '~BackToForm' as Translated);
const navigateFormAction = () => {
getCurrentProjectId().map(clearProjectForm);
setLayout('Form');
};
export const renderSavingError = (
_err: string,
) =>
DIV({
className: 'saving saving-error'
},
export const renderSavingError = (_err: string) =>
DIV(
{
className: 'splash-content saving saving-error'
},
H1({}, 'error'),
DIV({ className: 'info' },
markdown('A **server error** happened, we can not do much now, please try again.')),
navigateFormButton(navigateFormAction),
);
DIV({ className: 'info' }, markdown(tr.angled('savingError'))),
navigateFormButton(navigateFormAction)
);
export default renderSaving;
......@@ -9,8 +9,6 @@
margin-top: 16%;
margin-bottom: 33px;
text-align: center;
display: flex;
flex-direction: column;
h1 {
text-transform: uppercase;
......@@ -18,14 +16,6 @@
}
}
// .loader-anim,
// .splash-spiner {
// width: 120px;
// margin: @margin * 2 auto;
// height: 140px;
// background-image: url('../assets/imgs/loader-large.gif');
// }
.loader-anim,
.splash-spiner {
margin: @margin * 2 auto;
......@@ -40,9 +30,6 @@
}
.loader-anim__small {
// width: auto;
// height: auto;
&:before {
.awsomefont-spin;
color: @loaderColor;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment