Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor GUI class #451

Closed
wants to merge 19 commits into from
Closed
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
163 changes: 86 additions & 77 deletions src/app/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,39 @@
* @file api file interface for external plugins
*/

import G3W_CONSTANT from 'constant';
import G3W_CONSTANT from 'constant';

import ApplicationState from 'store/application-state';
import ApplicationService from 'services/application';
import GUI from 'services/gui';

import ApplicationState from 'store/application-state';
import ApplicationService from 'services/application';

/**
* Single File Components
*/
import G3WInput from 'components/InputG3W.vue';
import G3wFormInputs from 'components/InputG3WFormInputs.vue';
import FormBody from 'components/FormBody.vue';
import FormFooter from 'components/FormFooter.vue';
import C3XYLine from 'components/C3XYLine.vue';
import G3WInput from 'components/InputG3W.vue';
import G3wFormInputs from 'components/InputG3WFormInputs.vue';
import FormBody from 'components/FormBody.vue';
import FormFooter from 'components/FormFooter.vue';
import C3XYLine from 'components/C3XYLine.vue';
import G3WField from 'components/FieldG3W.vue';

/**
* CORE modules
*/
import CatalogLayersStoresRegistry from 'store/catalog-layers';
import DataRouterService from 'services/data';
import IFrameRouterService from 'services/iframe';
import MapLayersStoresRegistry from 'store/map-layers';
import PluginsRegistry from 'store/plugins';
import ProjectsRegistry from 'store/projects';
import RelationsService from 'services/relations';
import TaskService from 'services/tasks';
import WorkflowsStack from 'services/workflows';
import ApiService from 'services/api';
import RouterService from 'services/router';
import CatalogLayersStoresRegistry from 'store/catalog-layers';
import DataRouterService from 'services/data';
import IFrameRouterService from 'services/iframe';
import MapLayersStoresRegistry from 'store/map-layers';
import PluginsRegistry from 'store/plugins';
import ProjectsRegistry from 'store/projects';
import RelationsService from 'services/relations';
import TaskService from 'services/tasks';
import WorkflowsStack from 'services/workflows';
import ApiService from 'services/api';
import RouterService from 'services/router';

import GUI from 'services/gui';
//MIXINS
import Mixins from 'mixins';
import Mixins from 'mixins';

import { reverseGeometry } from 'utils/reverseGeometry';
import { getExtentForViewAndSize } from 'utils/getExtentForViewAndSize';
Expand All @@ -54,67 +55,77 @@ import { getResolutionFromScale } from 'utils/getResolutionFromScale';
import { getScaleFromResolution } from 'utils/getScaleFromResolution';
import { mergeOptions } from 'utils/mergeOptions';

const G3WObject = require('core/g3wobject');
const utils = require('utils');
const geoutils = require('utils/geo');
const i18n = require('core/i18n/i18n.service');
const Server = require('core/errors/parser/servererrorparser');
const Geom = require('utils/geo');
const { Geometry } = require('utils/geo');
const Project = require('core/project/project');
const LayersStoreRegistry = require('core/layers/layersstoresregistry');
const LayersStore = require('core/layers/layersstore');
const Layer = require('core/layers/layer');
const LayerFactory = require('core/layers/layerfactory');
const TableLayer = require('core/layers/tablelayer');
const VectorLayer = require('core/layers/vectorlayer');
const ImageLayer = require('core/layers/imagelayer');
const WmsLayer = require('core/layers/map/wmslayer');
const XYZLayer = require('core/layers/map/xyzlayer');
const MapLayer = require('core/layers/map/maplayer');
const Feature = require('core/layers/features/feature');
const FeaturesStore = require('core/layers/features/featuresstore');
const OlFeaturesStore = require('core/layers/features/olfeaturesstore');
const Filter = require('core/layers/filter/filter');
const Expression = require('core/layers/filter/expression');
const Plugin = require('core/plugin/plugin');
const PluginService = require('core/plugin/pluginservice');
const Task = require('core/workflow/task');
const Step = require('core/workflow/step');
const Flow = require('core/workflow/flow');
const Workflow = require('core/workflow/workflow');
import G3WObject from 'core/g3wobject';
import LayersStoreRegistry from 'core/layers/layersstoresregistry';

const utils = require('core/utils/utils');
const geoutils = require('core/utils/geo');
const i18n = require('core/i18n/i18n.service');
const Server = require('core/errors/parser/servererrorparser');
const Session = require('core/editing/session');
const Editor = require('core/editing/editor');
const Geom = require('core/utils/geo');
const { Geometry } = require('core/utils/geo');
const Project = require('core/project/project');
const LayersStore = require('core/layers/layersstore');
const Layer = require('core/layers/layer');
const LayerFactory = require('core/layers/layerfactory');
const TableLayer = require('core/layers/tablelayer');
const VectorLayer = require('core/layers/vectorlayer');
const ImageLayer = require('core/layers/imagelayer');
const WmsLayer = require('core/layers/map/wmslayer');
const XYZLayer = require('core/layers/map/xyzlayer');
const MapLayer = require('core/layers/map/maplayer');
const Feature = require('core/layers/features/feature');
const FeaturesStore = require('core/layers/features/featuresstore');
const OlFeaturesStore = require('core/layers/features/olfeaturesstore');
const Filter = require('core/layers/filter/filter');
const Expression = require('core/layers/filter/expression');
const Plugin = require('core/plugin/plugin');
const PluginService = require('core/plugin/pluginservice');
const Task = require('core/workflow/task');
const Step = require('core/workflow/step');
const Flow = require('core/workflow/flow');
const Workflow = require('core/workflow/workflow');

/**
* GUI modules
*/
const Panel = require('gui/panel');
const { ControlFactory } = require('gui/map/mapservice');
const ComponentsFactory = require('gui/component/componentsfactory');
const FieldsService = require('gui/fields/fieldsservice');
const Component = require('gui/component/component');
const MetadataComponent = require('gui/metadata/vue/metadata');
const SearchComponent = require('gui/search/vue/search');
const SearchPanel = require('gui/search/vue/panel/searchpanel');
const PrintComponent = require('gui/print/vue/print');
const CatalogComponent = require('gui/catalog/vue/catalog');
const MapComponent = require('gui/map/vue/map');
const ToolsComponent = require('gui/tools/vue/tools');
const QueryResultsComponent = require('gui/queryresults/vue/queryresults');
const FormComponent = require('gui/form/vue/form');
const FormService = require('gui/form/formservice');
const InputsComponents = require('gui/inputs/inputs');
const ChartsFactory = require('gui/charts/chartsfactory');
const Fields = require('gui/fields/fields');
const SearchPanelService = require('gui/search/vue/panel/searchservice');
const Panel = require('gui/panel');
const { ControlFactory } = require('gui/map/mapservice');
const ComponentsFactory = require('gui/component/componentsfactory');
const FieldsService = Mixins.fieldsMixin.methods.getFieldService();
const Component = require('gui/component/component');
const MetadataComponent = require('gui/metadata/vue/metadata');
const SearchComponent = require('gui/search/vue/search');
const SearchPanel = require('gui/search/vue/panel/searchpanel');
const PrintComponent = require('gui/print/vue/print');
const CatalogComponent = require('gui/catalog/vue/catalog');
const MapComponent = require('gui/map/vue/map');
const ToolsComponent = require('gui/tools/vue/tools');
const QueryResultsComponent = require('gui/queryresults/vue/queryresults');
const FormComponent = require('gui/form/vue/form');
const FormService = require('gui/form/formservice');
const ChartsFactory = require('gui/charts/chartsfactory');
const Fields = G3WField.components;
const InputsComponents = G3WInput.components;
const SearchPanelService = require('gui/search/vue/panel/searchservice');

/**
* G3W-OL modules
*/
const PickFeatureInteraction = require('g3w-ol/interactions/pickfeatureinteraction');
const PickCoordinatesInteraction = require('g3w-ol/interactions/pickcoordinatesinteraction');
const DeleteFeatureInteraction = require('g3w-ol/interactions/deletefeatureinteraction');
const AreaInteraction = require('g3w-ol/interactions/areainteraction');
const LengthInteraction = require('g3w-ol/interactions/lengthinteraction');
const PickFeatureInteraction = require('g3w-ol/interactions/pickfeatureinteraction');
const PickCoordinatesInteraction = require('g3w-ol/interactions/pickcoordinatesinteraction');
const DeleteFeatureInteraction = require('g3w-ol/interactions/deletefeatureinteraction');
const AreaInteraction = require('g3w-ol/interactions/areainteraction');
const LengthInteraction = require('g3w-ol/interactions/lengthinteraction');

/**
* Test assertions
*/
console.assert(undefined !== InputsComponents, 'InputsComponents is undefined');
console.assert(undefined !== FieldsService, 'FieldsService is undefined');
console.assert(undefined !== Fields, 'Fields is undefined');

module.exports = {

Expand Down Expand Up @@ -229,9 +240,7 @@ module.exports = {
MapComponent,
ToolsComponent,
QueryResultsComponent,
// main Form Component
FormComponent,
// Form Components
FormComponents: {
Body: FormBody,
Footer: FormFooter
Expand Down
Loading