diff options
Diffstat (limited to 'app/assets/javascripts/static_site_editor/components')
-rw-r--r-- | app/assets/javascripts/static_site_editor/components/publish_toolbar.vue | 23 | ||||
-rw-r--r-- | app/assets/javascripts/static_site_editor/components/static_site_editor.vue | 19 |
2 files changed, 37 insertions, 5 deletions
diff --git a/app/assets/javascripts/static_site_editor/components/publish_toolbar.vue b/app/assets/javascripts/static_site_editor/components/publish_toolbar.vue new file mode 100644 index 00000000000..83b50b2f8eb --- /dev/null +++ b/app/assets/javascripts/static_site_editor/components/publish_toolbar.vue @@ -0,0 +1,23 @@ +<script> +import { GlNewButton } from '@gitlab/ui'; + +export default { + components: { + GlNewButton, + }, + props: { + saveable: { + type: Boolean, + required: false, + default: false, + }, + }, +}; +</script> +<template> + <div class="d-flex bg-light border-top justify-content-between align-items-center py-3 px-4"> + <gl-new-button variant="success" :disabled="!saveable"> + {{ __('Submit Changes') }} + </gl-new-button> + </div> +</template> diff --git a/app/assets/javascripts/static_site_editor/components/static_site_editor.vue b/app/assets/javascripts/static_site_editor/components/static_site_editor.vue index f06d48ee4f5..80a55d5ee11 100644 --- a/app/assets/javascripts/static_site_editor/components/static_site_editor.vue +++ b/app/assets/javascripts/static_site_editor/components/static_site_editor.vue @@ -3,27 +3,29 @@ import { mapState, mapGetters, mapActions } from 'vuex'; import { GlSkeletonLoader } from '@gitlab/ui'; import EditArea from './edit_area.vue'; +import Toolbar from './publish_toolbar.vue'; export default { components: { EditArea, GlSkeletonLoader, + Toolbar, }, computed: { ...mapState(['content', 'isLoadingContent']), - ...mapGetters(['isContentLoaded']), + ...mapGetters(['isContentLoaded', 'contentChanged']), }, mounted() { this.loadContent(); }, methods: { - ...mapActions(['loadContent']), + ...mapActions(['loadContent', 'setContent']), }, }; </script> <template> - <div class="d-flex justify-content-center h-100"> - <div v-if="isLoadingContent" class="w-50 h-50 mt-2"> + <div class="d-flex justify-content-center h-100 pt-2"> + <div v-if="isLoadingContent" class="w-50 h-50"> <gl-skeleton-loader :width="500" :height="102"> <rect width="500" height="16" rx="4" /> <rect y="20" width="375" height="16" rx="4" /> @@ -33,6 +35,13 @@ export default { <rect x="410" y="40" width="90" height="16" rx="4" /> </gl-skeleton-loader> </div> - <edit-area v-if="isContentLoaded" class="w-75 h-100 shadow-none" :value="content" /> + <div v-if="isContentLoaded" class="d-flex flex-grow-1 flex-column"> + <edit-area + class="w-75 h-100 shadow-none align-self-center" + :value="content" + @input="setContent" + /> + <toolbar :saveable="contentChanged" /> + </div> </div> </template> |