Skip to content

Initial implementation for loading animation and skeleton placeholders for components on Person canvas. (CFM-205) #76

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
13 changes: 11 additions & 2 deletions app/templates/element/mveaJs.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@
status: '<?= __d('field', 'datepicker.hour') ?>',
unverified: '<?= __d('field', 'unverified') ?>',
visit: '<?= __d('information', 'global.visit.link') ?>'
}
},
isLoading: true
}
},
components: {
Expand Down Expand Up @@ -121,8 +122,16 @@
<div id="<?= $htmlId ?>" class="col cm-mvea-col">
<div class="card h-100">
<div class="card-body">
<h2 class="card-title"><?= $title ?></h2>
<h2 class="card-title">
<?= $title ?>
<span v-show="isLoading" class="co-loading-mini" role="status">
<span></span><span></span><span></span>
</span>
</h2>
<div class="card-text">
<ul v-show="isLoading" class="cm-mvea fields data-list skeleton-list">
<li><span class="visually-hidden">Loading...</span></li>
</ul>
<mveas
:mveas="this.mveas"
:core="this.core"
Expand Down
5 changes: 4 additions & 1 deletion app/webroot/css/co-base.css
Original file line number Diff line number Diff line change
Expand Up @@ -1506,7 +1506,7 @@ table.list-mode .read-only-link-container {
color: var(--cmg-color-gray-003);
padding: 0 0.5em;
}
/* LOADING ANIMATION */
/* LOADING ANIMATION & SKELETONS */
@keyframes loading {
0% { opacity: 0.3; }
30% { opacity: 1.0; }
Expand Down Expand Up @@ -1576,6 +1576,9 @@ table.list-mode .read-only-link-container {
.co-loading-mini span:nth-child(3) {
animation-delay: 0.4s;
}
.skeleton-list li {
height: 2.2rem;
}
/* BUTTONS */
.btn {
text-transform: uppercase;
Expand Down
3 changes: 3 additions & 0 deletions app/webroot/js/comanage/components/mvea/mvea-item.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ export default {
return constructLanguageString(lang)
}
},
mounted() {
this.$parent.$parent.isLoading = false;
},
template: `
<!-- Names -->
<li class="field-data-container" v-if="this.core.mveaType == 'names'">
Expand Down