Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] Initial loading feedback was missing #10028

Merged
merged 2 commits into from
Mar 7, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions packages/rocketchat-livechat/.app/client/views/loading.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<template name="loading">
<div class="loading-animation">
{{_ "Connecting to an Agent"}}
<div class="bounce1"></div>
<div class="bounce2"></div>
<div class="bounce3"></div>
<div class="bounce bounce1"></div>
<div class="bounce bounce2"></div>
<div class="bounce bounce3"></div>
</div>
</template>
</template>
51 changes: 51 additions & 0 deletions packages/rocketchat-theme/client/imports/general/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ body {
font-size: var(--text-small-size);
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;

background-color: var(--rc-color-primary)
}

:focus {
Expand Down Expand Up @@ -205,3 +207,52 @@ button {
.hidden {
display: none;
}

.loading-animation {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;

display: flex;

text-align: center;
align-items: center;
justify-content: center;
}

.loading-animation > .bounce {
display: inline-block;

width: 10px;
height: 10px;
margin: 2px;

animation: loading-bouncedelay 1.4s infinite ease-in-out both;

border-radius: 100%;
background-color: rgba(255, 255, 255, 0.6);
}

.loading-animation .bounce1 {
-webkit-animation-delay: -0.32s;
animation-delay: -0.32s;
}

.loading-animation .bounce2 {
-webkit-animation-delay: -0.16s;
animation-delay: -0.16s;
}

@keyframes loading-bouncedelay {
0%,
80%,
100% {
transform: scale(0);
}

40% {
transform: scale(1);
}
}
1 change: 0 additions & 1 deletion packages/rocketchat-ui-master/package.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,4 @@ Package.onUse(function(api) {

api.addFiles('server/inject.js', 'server');
api.addAssets('public/icons.svg', 'server');
api.addAssets('public/loading.css', 'server');
});
48 changes: 0 additions & 48 deletions packages/rocketchat-ui-master/public/loading.css

This file was deleted.

11 changes: 4 additions & 7 deletions packages/rocketchat-ui-master/server/inject.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,14 @@ RocketChat.models.Settings.find({_id:/theme-color-rc/i}, {fields: { value: 1}}).

Inject.rawHead('dynamic', `<script>(${ require('./dynamic-css.js').default.toString().replace(/\/\/.*?\n/g, '') })()</script>`);

Inject.rawHead('page-loading', `<style>${ Assets.getText('public/loading.css') }</style>`);

Inject.rawBody('icons', Assets.getText('public/icons.svg'));

Inject.rawBody('page-loading-div', `
<div id="initial-page-loading" class="page-loading">
<div class="loading-animation">
<div class="bounce1"></div>
<div class="bounce2"></div>
<div class="bounce3"></div>
<div class="bounce bounce1"></div>
<div class="bounce bounce2"></div>
<div class="bounce bounce3"></div>
</div>
</div>`);

Expand Down Expand Up @@ -71,8 +69,7 @@ RocketChat.settings.get('Assets_SvgFavicon_Enable', (key, value) => {
});

RocketChat.settings.get('theme-color-sidebar-background', (key, value) => {
Inject.rawHead(key, `<style>body { background-color: ${ value };}</style>` +
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any reason removing it from here and adding it to "external" CSS? the idea was just this, not need to wait for the whole CSS to apply the initial background color

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When you load the app the css is up already, but I forgot that you can change this color... in that case the app will load the default color. I'll fix that.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the first time you enter on a server, his css is not up already 😉

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was wrong on my comment. @ggazzo made a dynamic css loader script that runs before that, so it will work with the colors that the user set on DB.

`<meta name="msapplication-TileColor" content="${ value }" />` +
Inject.rawHead(key, `<meta name="msapplication-TileColor" content="${ value }" />` +
`<meta name="theme-color" content="${ value }" />`);
});

Expand Down