diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-14 15:09:44 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-14 15:09:44 +0000 |
commit | 874ead9c3a50de4c4ca4551eaf5b7eb976d26b50 (patch) | |
tree | 637ee9f2da5e251bc08ebf3e972209d51966bf7c /app/assets/javascripts/static_site_editor | |
parent | 2e4c4055181eec9186458dd5dd3219c937032ec7 (diff) | |
download | gitlab-ce-874ead9c3a50de4c4ca4551eaf5b7eb976d26b50.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/static_site_editor')
4 files changed, 6 insertions, 3 deletions
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 e711510ba44..8deae2f2c8a 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 @@ -12,8 +12,8 @@ export default { Toolbar, }, computed: { - ...mapState(['content', 'isLoadingContent', 'isSavingChanges']), - ...mapGetters(['isContentLoaded', 'contentChanged']), + ...mapState(['content', 'isLoadingContent', 'isSavingChanges', 'isContentLoaded']), + ...mapGetters(['contentChanged']), }, mounted() { this.loadContent(); diff --git a/app/assets/javascripts/static_site_editor/store/getters.js b/app/assets/javascripts/static_site_editor/store/getters.js index 41256201c26..ebc68f8e9e6 100644 --- a/app/assets/javascripts/static_site_editor/store/getters.js +++ b/app/assets/javascripts/static_site_editor/store/getters.js @@ -1,2 +1,2 @@ -export const isContentLoaded = ({ originalContent }) => Boolean(originalContent); +// eslint-disable-next-line import/prefer-default-export export const contentChanged = ({ originalContent, content }) => originalContent !== content; diff --git a/app/assets/javascripts/static_site_editor/store/mutations.js b/app/assets/javascripts/static_site_editor/store/mutations.js index f98177bbc18..4727d04439c 100644 --- a/app/assets/javascripts/static_site_editor/store/mutations.js +++ b/app/assets/javascripts/static_site_editor/store/mutations.js @@ -6,6 +6,7 @@ export default { }, [types.RECEIVE_CONTENT_SUCCESS](state, { title, content }) { state.isLoadingContent = false; + state.isContentLoaded = true; state.title = title; state.content = content; state.originalContent = content; diff --git a/app/assets/javascripts/static_site_editor/store/state.js b/app/assets/javascripts/static_site_editor/store/state.js index 477ec540e02..d48cc8ed1a4 100644 --- a/app/assets/javascripts/static_site_editor/store/state.js +++ b/app/assets/javascripts/static_site_editor/store/state.js @@ -6,6 +6,8 @@ const createState = (initialState = {}) => ({ isLoadingContent: false, isSavingChanges: false, + isContentLoaded: false, + originalContent: '', content: '', title: '', |