<commit_before><template>
<div class="toolbar">

	<el-tooltip class="item" effect="dark" content="Switch preview mode" placement="top">
		<el-select placeholder="view" v-model="view" class="switch-view">
			<el-option v-for="(view, key) in views" :label="view.label" :value="key" :key="view.label">
				<div class="view-icon">
					<icon :name="view.icon" aria-hidden="true" width="20" height="20" />
				</div>
				<span class="view-label">{{ view.label }}</span>
			</el-option>
		</el-select>
	</el-tooltip>

	<el-button class="toolbar__button-save" type="success" @click="savePage">Save</el-button>

	<el-button class="toolbar__button-preview" :plain="true" type="info" @click="previewPage">Preview <icon name="newwindow" aria-hidden="true" width="14" height="14" class="ico" /></el-button>

	<el-button class="toolbar__button-publish" type="danger" @click="showPublishModal">Publish ...</el-button>

</div>


</template>


<script>
import { mapState, mapMutations, mapActions } from 'vuex';

import Icon from 'components/Icon';
import { undoStackInstance } from 'plugins/undo-redo';

export default {
	name: 'toolbar',

	components: {
		Icon
	},

	computed: {
		...mapState([
			'displayIframeOverlay',
			'undoRedo',
			'currentView'
		]),

		...mapState({
			page: state => state.page.pageData,
			pageLoaded: state => state.page.loaded
		}),

		view: {
			get() {
				return this.currentView;
			},
			set(value) {
				this.changeView(value);
			}
		},

		draftLink() {
			//return ;
			return '/draft/' + `${this.$route.params.page_id}`;
		}
	},

	created() {
		this.views = {
			desktop: {
				icon: 'desktop',
				label: 'Desktop',
				width: '100%',
				height: '100vh'
			},
			tablet: {
				icon: 'tablet',
				label: 'Tablet',
				width: '768px',
				height: '1024px'
			},
			mobile: {
				icon: 'mobile',
				label: 'Mobile',
				width: '320px',
				height: '568px'
			}
		};
	},

	methods: {
		...mapMutations([
			'changeView',
			'showPublishModal',
		]),

		...mapActions([
			'handleSavePage'
		]),

		updateCurrentSavedState() {
			this.$store.commit('updateCurrentSavedState');
		},

		savePage() {
			this.handleSavePage({id: this.$route.params.page_id, message: this.$message});
		},

		/* autosave the page and open a preview window */
		previewPage() {
			/* handleSavePage returns a promise so we here we wait for it to complete before
			opening the preview window */
			this.handleSavePage({id: this.$route.params.page_id, message: this.$message})
				.then(() => {
					window.open(this.draftLink,'_blank');
				});
		},

		undo() {
			return undoStackInstance.undo();
		},

		redo() {
			return undoStackInstance.redo();
		}
	}
<commit_msg>Fix for unwanted id parameter to handleSavePage - forgot to commit this change before<commit_after><template>
<div class="toolbar">

	<el-tooltip class="item" effect="dark" content="Switch preview mode" placement="top">
		<el-select placeholder="view" v-model="view" class="switch-view">
			<el-option v-for="(view, key) in views" :label="view.label" :value="key" :key="view.label">
				<div class="view-icon">
					<icon :name="view.icon" aria-hidden="true" width="20" height="20" />
				</div>
				<span class="view-label">{{ view.label }}</span>
			</el-option>
		</el-select>
	</el-tooltip>

	<el-button class="toolbar__button-save" type="success" @click="savePage">Save</el-button>

	<el-button class="toolbar__button-preview" :plain="true" type="info" @click="previewPage">Preview <icon name="newwindow" aria-hidden="true" width="14" height="14" class="ico" /></el-button>

	<el-button class="toolbar__button-publish" type="danger" @click="showPublishModal">Publish ...</el-button>

</div>


</template>


<script>
import { mapState, mapMutations, mapActions } from 'vuex';

import Icon from 'components/Icon';
import { undoStackInstance } from 'plugins/undo-redo';

export default {
	name: 'toolbar',

	components: {
		Icon
	},

	computed: {
		...mapState([
			'displayIframeOverlay',
			'undoRedo',
			'currentView'
		]),

		...mapState({
			page: state => state.page.pageData,
			pageLoaded: state => state.page.loaded
		}),

		view: {
			get() {
				return this.currentView;
			},
			set(value) {
				this.changeView(value);
			}
		},

		draftLink() {
			//return ;
			return '/draft/' + `${this.$route.params.page_id}`;
		}
	},

	created() {
		this.views = {
			desktop: {
				icon: 'desktop',
				label: 'Desktop',
				width: '100%',
				height: '100vh'
			},
			tablet: {
				icon: 'tablet',
				label: 'Tablet',
				width: '768px',
				height: '1024px'
			},
			mobile: {
				icon: 'mobile',
				label: 'Mobile',
				width: '320px',
				height: '568px'
			}
		};
	},

	methods: {
		...mapMutations([
			'changeView',
			'showPublishModal',
		]),

		...mapActions([
			'handleSavePage'
		]),

		updateCurrentSavedState() {
			this.$store.commit('updateCurrentSavedState');
		},

		savePage() {
			this.handleSavePage({message: this.$message});
		},

		/* autosave the page and open a preview window */
		previewPage() {
			/* handleSavePage returns a promise so we here we wait for it to complete before
			opening the preview window */
			this.handleSavePage({message: this.$message})
				.then(() => {
					window.open(this.draftLink,'_blank');
				});
		},

		undo() {
			return undoStackInstance.undo();
		},

		redo() {
			return undoStackInstance.redo();
		}
	}

{'fraction_non_alphanumeric': 0.1847217033993276, 'fraction_numerical': 0.010085917071348524, 'mean_word_length': 3.451371571072319, 'pattern_counts': {'":': 0, '<': 49, '<?xml version=': 0, '>': 55, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1364605', 'n_tokens_mistral': 2217, 'n_tokens_neox': 1831, 'n_words': 378}