Commit 8471b674 authored by Vladimir Erokhov's avatar Vladimir Erokhov

Merge branch 'feature/delete-unused-files' into 'develop'

Feature/Delete unused files

See merge request !1173
parents fe26e448 ca86a2c6
Pipeline #7301 passed with stage
in 5 minutes and 53 seconds
......@@ -40,6 +40,7 @@
["template", "render"],
"renderError"
]
}]
}],
"import/prefer-default-export": "off"
}
}
......@@ -92,12 +92,6 @@ export default {
}
},
methods: {
updateImpact(entities) {
this.form.impacts = entities.map(entity => entity._id);
},
updateDependencies(entities) {
this.form.dependencies = entities.map(entity => entity._id);
},
async submit() {
this.submitting = true;
const formIsValid = await this.$validator.validateAll();
......
<template lang="pug">
v-card(data-test="createTabModal")
v-card-title.primary.white--text
v-layout(justify-space-between, align-center)
span.headline Create tab
v-card-text
v-text-field(data-test="tabTitleField", v-model="text")
v-divider
v-layout.py-1(justify-end)
v-btn(@click="hideModal", depressed, flat) {{ $t('common.cancel') }}
v-btn.primary(data-test="tabSubmitButton", @click="submit") {{ $t('common.submit') }}
</template>
<script>
import { MODALS } from '@/constants';
import modalInnerMixin from '@/mixins/modal/inner';
export default {
name: MODALS.createViewTab,
mixins: [modalInnerMixin],
data() {
return {
text: this.modal.config.text || '',
};
},
methods: {
async submit() {
if (this.config.action) {
await this.config.action(this.text);
}
this.hideModal();
},
},
};
</script>
......@@ -15,7 +15,7 @@
@click="$emit('update:selectedIds',selectedEntities)"
) Add selection
v-data-table(
:no-data-text="this.$t('tables.noData')",
:no-data-text="$t('tables.noData')",
:headers="headers",
:items="contextEntities",
:loading="pending",
......
......@@ -43,8 +43,6 @@ import parseFilterToRequest from '@/helpers/filter/editor/parse-filter-to-reques
import { checkIfGroupIsEmpty } from '@/helpers/filter/editor/filter-check';
import FilterGroup from './partial/filter-group.vue';
import FilterResultsAlarm from './partial/results/alarm.vue';
import FilterResultsEntity from './partial/results/entity.vue';
/**
* Component to create new MongoDB filter
......@@ -57,8 +55,6 @@ export default {
inject: ['$validator'],
components: {
FilterGroup,
FilterResultsAlarm,
FilterResultsEntity,
},
props: {
value: {
......
<template lang="pug">
v-data-table.elevation-1(
:headers="headers",
:items="items",
:pagination.sync="pagination",
:total-items="meta.total",
:rows-per-page-items="rowsPerPageItems",
:loading="pending"
)
template(slot="items", slot-scope="{ item }")
td {{ item.v.connector }}
td {{ item.v.connector_name }}
td {{ item.v.component }}
td {{ item.v.resource }}
</template>
<script>
import { createNamespacedHelpers } from 'vuex';
import filterEditorResultsMixin from '@/mixins/filter/editor/results';
const { mapActions: alarmMapActions } = createNamespacedHelpers('alarm');
export default {
mixins: [filterEditorResultsMixin],
computed: {
headers() {
return [
{
text: this.$t('filterEditor.resultsTableHeaders.alarm.connector'),
align: 'left',
sortable: false,
},
{
text: this.$t('filterEditor.resultsTableHeaders.alarm.connectorName'),
align: 'left',
sortable: false,
},
{
text: this.$t('filterEditor.resultsTableHeaders.alarm.component'),
align: 'left',
sortable: false,
},
{
text: this.$t('filterEditor.resultsTableHeaders.alarm.resource'),
align: 'left',
sortable: false,
},
];
},
},
methods: {
...alarmMapActions({
fetchAlarmListWithoutStore: 'fetchListWithoutStore',
}),
async fetchList() {
const { rowsPerPage: limit, page } = this.pagination;
this.pending = true;
const { alarms, total } = await this.fetchAlarmListWithoutStore({
params: {
limit,
skip: limit * (page - 1),
filter: this.filter,
},
});
this.pending = false;
this.items = alarms;
this.meta = { total };
},
},
};
</script>
<template lang="pug">
v-data-table.elevation-1(
:headers="headers",
:items="items",
:pagination.sync="pagination",
:total-items="meta.total",
:rows-per-page-items="rowsPerPageItems",
:loading="pending"
)
template(slot="items", slot-scope="{ item }")
td {{ item._id }}
td {{ item.name }}
td {{ item.type }}
</template>
<script>
import { createNamespacedHelpers } from 'vuex';
import filterEditorResultsMixin from '@/mixins/filter/editor/results';
const { mapActions: entityMapActions } = createNamespacedHelpers('entity');
export default {
mixins: [filterEditorResultsMixin],
computed: {
headers() {
return [
{
text: this.$t('filterEditor.resultsTableHeaders.entity.id'),
align: 'left',
sortable: false,
},
{
text: this.$t('filterEditor.resultsTableHeaders.entity.name'),
align: 'left',
sortable: false,
},
{
text: this.$t('filterEditor.resultsTableHeaders.entity.type'),
align: 'left',
sortable: false,
},
];
},
},
methods: {
...entityMapActions({
fetchEntitiesListWithoutStore: 'fetchListWithoutStore',
}),
async fetchList() {
const { rowsPerPage: limit, page } = this.pagination;
this.pending = true;
const { entities, total } = await this.fetchEntitiesListWithoutStore({
params: {
limit,
start: limit * (page - 1),
_filter: this.filter,
},
});
this.pending = false;
this.items = entities;
this.meta = { total };
},
},
};
</script>
......@@ -4,7 +4,7 @@
v-container
filter-selector(
:label="$t('filterSelector.defaultFilter')",
:entitiesType="this.entitiesType",
:entitiesType="entitiesType",
:value="value",
:filters="filters",
:condition="condition",
......
......@@ -65,7 +65,6 @@ export const MODALS = {
textFieldEditor: 'text-field-editor',
selectView: 'select-view',
createView: 'create-view',
createViewTab: 'create-view-tab',
createGroup: 'create-group',
createUser: 'create-user',
createRole: 'create-role',
......
import Vue from 'vue';
export default new Vue();
......@@ -132,12 +132,3 @@ export function findRange(start, stop, ranges = STATS_QUICK_RANGES, defaultValue
return Object.values(ranges)
.find(range => start === range.start && stop === range.stop) || defaultValue;
}
export default {
parseStringToDateInterval,
dateParse,
prepareDateToObject,
prepareStatsStartForMonthPeriod,
prepareStatsStopForMonthPeriod,
findRange,
};
......@@ -81,8 +81,3 @@ export function convertEventsToGroupedEvents({ events, groupByValue = 'hour', ge
return groupedEvent[0];
});
}
export default {
convertAlarmsToEvents,
convertEventsToGroupedEvents,
};
......@@ -35,9 +35,3 @@ export function getRolesSearchByText(text) {
],
};
}
export default {
getContextWidgetSearchByText,
getUsersSearchByText,
getRolesSearchByText,
};
......@@ -551,20 +551,3 @@ export function prepareUserByData(data, user = generateUser()) {
return result;
}
export default {
generateWidgetByType,
generateViewRow,
generateView,
generateUserPreferenceByWidgetAndUser,
generateUser,
generateRole,
generateRight,
generateRoleRightByChecksum,
generateCopyOfViewTab,
generateCopyOfView,
getViewsTabsWidgetsIdsMappings,
getViewsWidgetsIdsMappings,
};
......@@ -20,9 +20,3 @@ export function getFileDataUrlContent(file) {
return getFileReaderResult(reader);
}
export default {
getFileReaderResult,
getFileTextContent,
getFileDataUrlContent,
};
......@@ -36,9 +36,3 @@ registerHelper('internal-link', (options) => {
const link = `<router-link to="${path}" ${prepareAttributes(attributes)}>${text}</router-link>`;
return new Handlebars.SafeString(link);
});
export default {
compile,
registerHelper,
unregisterHelper,
};
......@@ -111,11 +111,3 @@ export function addIn(obj, path, value) {
export function removeIn(obj, path, index) {
return setIn(obj, path, get(obj, path, []).filter((v, i) => i !== index));
}
export default {
setIn,
setInSeveral,
unsetIn,
addIn,
removeIn,
};
......@@ -324,10 +324,3 @@ export function convertWidgetToQuery(widget) {
return {};
}
}
export default {
convertContextWidgetToQuery,
convertContextUserPreferenceToQuery,
convertUserPreferenceToQuery,
convertWidgetToQuery,
};
......@@ -5,7 +5,3 @@ export function checkUserAccess(user, rightId, rightMask) {
return (checksum & rightMask) === rightMask;
}
export default {
checkUserAccess,
};
......@@ -93,9 +93,3 @@ export async function checkUserAccessForRoute(to = {}) {
throw new Error('User don\'t have access to page');
}
export default {
getAppInfoValuePromiseByKey,
checkAppInfoAccessForRoute,
checkUserAccessForRoute,
};
......@@ -65,12 +65,6 @@ export const childMergeStrategy = (entityA, entityB) => {
return result;
};
export default {
parentProcessStrategy,
childProcessStrategy,
childMergeStrategy,
};
/* eslint-disable */
/**
* We reinitialized denormalize method for removing our SCHEMA_EMBEDDED_KEY property if we need
......
......@@ -6,7 +6,3 @@ export function replaceTextNotInQuotes(str, text, value) {
return str.replace(regexp, value);
}
export default {
replaceTextNotInQuotes,
};
......@@ -51,7 +51,3 @@ export function dataTableCustomSortWithNullIgnoring(items, index, isDescending)
return 0;
});
}
export default {
dataTableCustomSortWithNullIgnoring,
};
......@@ -87,8 +87,3 @@ export function cloneSchemaWithEmbedded(schema) {
return newSchema;
}
export default {
prepareEntitiesToDelete,
cloneSchemaWithEmbedded,
};
......@@ -30,9 +30,3 @@ export function objectToTextPairs(object = {}) {
export function defaultTextPairCreator() {
return { key: uid(), text: '', value: '' };
}
export default {
textPairsToObject,
objectToTextPairs,
defaultTextPairCreator,
};
......@@ -36,7 +36,3 @@ export function convertObjectToTreeview(parent, parentKey, parentPath = '', isPa
return { name: parentKey, children };
}
export default {
convertObjectToTreeview,
};
......@@ -18,7 +18,3 @@ export function isParent(child, parent) {
return false;
}
export default {
isParent,
};
import EventBus from '@/event-bus';
import { PAGINATION_LIMIT, PAGINATION_PER_PAGE_VALUES } from '@/config';
export default {
props: {
filter: {
type: Object,
default: () => ({}),
},
},
data() {
return {
items: [],
meta: {},
pending: false,
pagination: {
page: 1,
rowsPerPage: PAGINATION_LIMIT,
},
};
},
computed: {
rowsPerPageItems() {
return PAGINATION_PER_PAGE_VALUES;
},
},
watch: {
pagination(value, oldValue) {
if (value.page !== oldValue.page || value.rowsPerPage !== oldValue.rowsPerPage) {
this.fetchList();
}
},
},
created() {
EventBus.$on('filter-editor:results:fetch', this.fetchList);
},
beforeDestroy() {
EventBus.$off('filter-editor:results:fetch', this.fetchList);
},
};
import { createNamespacedHelpers } from 'vuex';
import authMixin from './auth';
const { mapActions } = createNamespacedHelpers('event');
export default {
mixins: [authMixin],
methods: {
...mapActions({
createEventAction: 'create',
}),
},
};
/**
* Class representing a LocalStorageDataSource
*/
class LocalStorageDataSource {
constructor() {
try {
Object.keys(localStorage).map(key => this[key] = localStorage.getItem(key));
} catch (err) {
console.warn(err);
}
}
/**
* @param {string} key - key localStorage
* @return {string}
*/
getItem(key) {
return this[key];
}
/**
* @param {string} key - key local Storage
* @param {string} value - value local Storage
* @return {LocalStorageDataSource}
*/
setItem(key, value) {
this[key] = value;
try {
localStorage.setItem(key, value);
} catch (err) {
console.warn(err);
}
return this;
}
/**
* @param {string} key - key local Storage
* @return {LocalStorageDataSource}
*/
removeItem(key) {
delete this[key];
try {
localStorage.removeItem(key);
} catch (err) {
console.warn(err);
}
return this;
}
}
export default new LocalStorageDataSource();
......@@ -95,7 +95,7 @@ module.exports = {
browser.assert.elementsCount(rolesPage.elements.dataTableUserItem.selector, 1);
rolesPage.verifyPageRoleBefore(role._id);
}
},
)
.waitForFirstXHR(
API_ROUTES.role.list,
......@@ -104,7 +104,7 @@ module.exports = {
const { data } = JSON.parse(responseData);
browser.assert.ok(data.some(item => item._id !== role._id));
}
},
);
},
......
......@@ -42,7 +42,7 @@ module.exports = {
browser.assert.elementsCount(usersPage.elements.dataTableUserItem.selector, 1);
usersPage.verifyPageUserBefore(user._id);
}
},
)
.waitForFirstXHR(
API_ROUTES.user.list,
......@@ -51,7 +51,7 @@ module.exports = {
const { data } = JSON.parse(responseData);
browser.assert.ok(data.some(item => item._id !== user._id));
}
},
);
},
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment