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

Semantics FE catalog integration #291

Merged
merged 35 commits into from
Jul 2, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
3850914
Polish 'old-semantics' mock data:
and0111 Jun 28, 2018
7359655
Polish 'old-semantics' redux's actions:
and0111 Jun 28, 2018
be87573
Polish 'old-semantics' redux's reducer:
and0111 Jun 28, 2018
8fc0856
Polish 'old-semantics' ontologies views:
and0111 Jun 28, 2018
8e97e8b
Polish 'old-semantics' vocabularies views:
and0111 Jun 28, 2018
a846086
Polish 'old-semantics' routes
and0111 Jun 29, 2018
306a81a
Polish 'old-semantics' Sidebar entry
and0111 Jun 29, 2018
4396d05
Polish 'old-sematics' routes from App's router
and0111 Jun 29, 2018
3b5778e
Polish 'old-semantics' PrivateRoutes
and0111 Jun 29, 2018
36620b2
Ontologies containers components integration
and0111 Jul 2, 2018
cb7c4e2
Vacabularies containers components integration
and0111 Jul 2, 2018
81e708d
Semantics redux's structure integration
and0111 Jul 2, 2018
e42c7cb
Sematics data parser integration
and0111 Jul 2, 2018
2bace12
Semantics API config integration
and0111 Jul 2, 2018
12aef4c
Semantics redux's structure integration: reducers
and0111 Jul 2, 2018
2a61ff8
Add 'initialStates' config
and0111 Jul 2, 2018
063e6b5
Add semantics common Utilities
and0111 Jul 2, 2018
d6e586e
Ontologies List UI component integration
and0111 Jul 2, 2018
8dab768
Ontologies Detail UI component integration
and0111 Jul 2, 2018
6383bc7
Vocabularies List UI component integration
and0111 Jul 2, 2018
c1837e4
Vocabularies Detail UI component integration
and0111 Jul 2, 2018
d4df045
Semantics LinkWrap UI component integration
and0111 Jul 2, 2018
6841e9c
Semantics Error UI component integration
and0111 Jul 2, 2018
401c354
Add semantics routes to App router
and0111 Jul 2, 2018
ecc645b
Add semantics PrivateRoutes
and0111 Jul 2, 2018
e6657e7
Add 'new-semantics' routes in `./src/routes.js`
and0111 Jul 2, 2018
37ad896
Semantics redux's structure integration: rootReducer
and0111 Jul 2, 2018
c122551
Semantics sidebar entry integration
and0111 Jul 2, 2018
bd7504c
UI dependencies update
and0111 Jul 2, 2018
705beeb
Merge branch 'semantic-fe-integration'
and0111 Jul 2, 2018
d3436fe
Resolve merge conflits in routes
and0111 Jul 2, 2018
0e699e5
Hotfix: Add missing dependecies
and0111 Jul 2, 2018
2b89054
Merge branch 'hotfix-missing-dependencies'
and0111 Jul 2, 2018
00159ae
Update API's URLs
and0111 Jul 2, 2018
95f16bb
Merge branch 'new-semantics-api-url'
and0111 Jul 2, 2018
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
4,755 changes: 2,384 additions & 2,371 deletions package-lock.json

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"react-autosize-textarea": "^0.4.8",
"react-autosuggest": "^9.3.1",
"react-chartjs": "^0.8.0",
"react-collapsible": "^2.2.0",
"react-copy-to-clipboard": "^5.0.1",
"react-datepicker": "^1.2.2",
"react-dates": "^16.3.6",
Expand Down Expand Up @@ -59,7 +60,7 @@
"react-through": "^1.1.0",
"react-timestamp": "^4.3.1",
"react-transition-group": "^2.2.1",
"reactstrap": "^4.8.0",
"reactstrap": "^5.0.0-beta",
"recharts": "^1.0.0-alpha.4",
"redux": "^3.7.0",
"redux-file-upload": "0.0.18",
Expand Down
65 changes: 0 additions & 65 deletions src/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import { serviceurl } from './config/serviceurl.js'
// MOCK
//import page from './data/dataset'
//import det from './data/datasetdetail'
import ont from './data/ontologies'
import voc from './data/vocabulary'
import settings from './data/settings'

export const REQUEST_DATASETS = 'REQUEST_DATASETS'
Expand All @@ -29,8 +27,6 @@ export const RECEIVE_RESET_ERROR = 'RECEIVE_RESET_ERROR'
export const RECEIVE_ACTIVATION = 'RECEIVE_ACTIVATION'
export const RECEIVE_ACTIVATION_ERROR = 'RECEIVE_ACTIVATION_ERROR'
export const RECEIVE_ADD_DATASET = 'RECEIVE_ADD_DATASET'
export const RECEIVE_ONTOLOGIES = 'RECEIVE_ONTOLOGIES'
export const RECEIVE_VOCABULARY = 'RECEIVE_VOCABULARY'
export const RECEIVE_PROPERTIES = 'RECEIVE_PROPERTIES'
export const REQUEST_PROPERTIES = 'REQUEST_PROPERTIES'
export const REQUEST_REGISTRATION = 'REQUEST_REGISTRATION'
Expand Down Expand Up @@ -195,29 +191,6 @@ export function receiveLogin(response) {
}
}

function receiveOntologies(response) {
return {
type: RECEIVE_ONTOLOGIES,
//ontologies: response,
ontologies: ont,
error: '',
receivedAt: Date.now(),
ope: 'RECEIVE_ONTOLOGIES'
}
}

function receiveVocabulary(response) {
return {
type: RECEIVE_VOCABULARY,
//vocabulary: response,
vocabulary: voc,
ontologies: ont,
error: '',
receivedAt: Date.now(),
ope: 'RECEIVE_VOCABULARY'
}
}

function receiveOrganization(response) {
return {
type: RECEIVE_ORGANIZATION,
Expand Down Expand Up @@ -1061,44 +1034,6 @@ function fetchDatasetDetail(datasetname, query, isPublic) {

/******************************************************************************* */

export function loadOntologies() {
console.log('Load Ontologies');
/*var url = 'http://localhost:3001/catalog-manager/v1/ontologies';
return dispatch => {
return fetch(url, {
method: 'GET',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
}
})
.then(response => response.json())
.then(json => dispatch(receiveOntologies(json)))
}*/
return dispatch => {
dispatch(receiveOntologies(undefined));
}
}

export function loadVocabulary() {
console.log('Load Vocabulary');
/*var url = 'http://localhost:3001/catalog-manager/v1/ontologies';
return dispatch => {
return fetch(url, {
method: 'GET',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
}
})
.then(response => response.json())
.then(json => dispatch(receiveOntologies(json)))
}*/
return dispatch => {
dispatch(receiveVocabulary(undefined));
}
}

export function getSchema(filesToUpload, typeFile) {
console.log('getSchema');
var url = serviceurl.apiURLDatiGov + "/infer/kylo/" + typeFile
Expand Down
21 changes: 16 additions & 5 deletions src/components/Sidebar/Sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,11 +217,22 @@ class Sidebar extends Component {
<li className="nav-title text-secondary">
INFO
</li>
<li className="nav-item" onClick={(e) => {
e.preventDefault();
document.body.classList.toggle('sidebar-mobile-show');
}}>
<NavLink to={'/private/vocabulary/list'} className="nav-link" activeClassName="nav-link-primary"><i className="fa fa-book text-secondary"></i> Dizionari e standard</NavLink>
<li className="nav-item nav-dropdown b-r-1">
<a className="nav-link nav-link-light nav-dropdown-toggle" onClick={this.handleClick.bind(this)}><i className="fa fa-sitemap fa-lg text-secondary"></i> Semantica</a>
<ul className="nav-dropdown-items bg-light">
<li className="nav-item" onClick={(e) => {
e.preventDefault();
document.body.classList.toggle('sidebar-mobile-show');
}}>
<NavLink to={'/private/ontologies'} className="nav-link" activeClassName="nav-link-primary"><i className="fas fa-book fa-lg text-secondary" /> Ontologie</NavLink>
</li>
<li className="nav-item" onClick={(e) => {
e.preventDefault();
document.body.classList.toggle('sidebar-mobile-show');
}}>
<NavLink to={'/private/vocabularies'} className="nav-link" activeClassName="nav-link-primary"><i className="fas fa-book fa-lg text-secondary" /> Vocabolari</NavLink>
</li>
</ul>
</li>
<li className="nav-item" onClick={(e) => {
e.preventDefault();
Expand Down
6 changes: 4 additions & 2 deletions src/containers/App/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,10 @@ class App extends Component {
<Route path="/private/dashboard" name="Dashboard" component={Full} />
<Route path="/private/widget" name="Widget" component={Full} />
<Route path="/private/ingestionwizzard" name="Ingestion" component={Full} />
<Route path="/private/ontologies" name="Ontologies" component={Full} />
<Route path="/private/vocabulary" name="Vocabulary" component={Full} />
<Route path="/private/ontologies" name="Ontologies" exact component={Full} />
<Route path="/private/ontologies/:filter" name="Ontology" component={Full} />
<Route path="/private/vocabularies" name="Vocabularies" exact component={Full} />
<Route path="/private/vocabularies/:filter" name="Vocabulary" component={Full} />
<Route exact path="/private/dataset" name="Dataset" component={Full} />
<Route exact path="/private/dataset_old" name="Dataset" component={Full} />
{<Route exact path="/private/search" name="Search" component={Full} />}
Expand Down
14 changes: 10 additions & 4 deletions src/containers/Full/Full.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ import Aside from '../../components/Aside/';
import Footer from '../../components/Footer/';
import Home from '../../views/Home/Home';
import IngestionWizard from '../../views/IngestionWizard/';
import Ontologies from '../../views/Ontologies/';
import Vocabulary from '../../views/Vocabulary/';
import Dashboard from '../../views/Dashboard/';
import Dataset from '../../views/Dataset/';
import DatasetList from '../../views/DataseList/';
Expand All @@ -35,6 +33,12 @@ import Crea from "../../views/Crea/Crea";
import Widgets from '../../views/Widgets/Widgets';
import SearchBar from '../../components/SearchBar/SearchBar';

// semantic's containers imports
import Vocabularies from '../../semantics/containers/Vocabularies.js'
import Vocabulary from '../../semantics/containers/Vocabulary.js'
import Ontologies from '../../semantics/containers/Ontologies.js'
import Ontology from '../../semantics/containers/Ontology.js'

function PrivateRoute({ component: Component, authed, ...rest }) {
return (
<Route
Expand Down Expand Up @@ -571,8 +575,10 @@ class Full extends Component {
<Switch>
<PrivateRoute authed={this.state.authed} path="/private/home" name="Home" exact component={Home}/>
<PrivateRouteEditor authed={this.state.authed} role={role} path="/private/ingestionwizzard" name="Forms" component={IngestionWizard} history={history} />
<PrivateRoute authed={this.state.authed} path="/private/ontologies" name="Ontologies" component={Ontologies} />
<PrivateRoute authed={this.state.authed} path="/private/vocabulary" name="Vocabulary" component={Vocabulary} />
<PrivateRoute authed={this.state.authed} path="/private/ontologies/" name="Ontologies" exact component={Ontologies} />
<PrivateRoute authed={this.state.authed} path="/private/ontologies/:filter" name="Ontology" component={Ontology} />
<PrivateRoute authed={this.state.authed} path="/private/vocabularies" name="Vocabularies" exact component={Vocabularies} />
<PrivateRoute authed={this.state.authed} path="/private/vocabularies/:filter" name="Vocabulary" component={Vocabulary} />
<PrivateRoute authed={this.state.authed} path="/private/dashboard" name="Dashboard manager" component={DashboardManager} />
<PrivateRoute authed={this.state.authed} path="/private/userstory" name="User Story" component={UserStory} />
<PrivateRoute authed={this.state.authed} path="/private/widget" name="Widget" component={Widgets} />
Expand Down
65 changes: 0 additions & 65 deletions src/data/ontologies.js

This file was deleted.

20 changes: 0 additions & 20 deletions src/data/vocabulary.js

This file was deleted.

31 changes: 16 additions & 15 deletions src/reducers.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ import {
RECEIVE_ACTIVATION,
RECEIVE_ACTIVATION_ERROR,
RECEIVE_ADD_DATASET,
RECEIVE_ONTOLOGIES,
RECEIVE_VOCABULARY,
RECEIVE_PROPERTIES,
REQUEST_PROPERTIES,
REQUEST_REGISTRATION,
Expand All @@ -35,6 +33,16 @@ import {
dataApplicationsReducer
} from './views/Public/DataApplication/reducers/dataApplicationsReducer'

// semantic's reducers
import {
ontListReducer,
ontDetailReducer
} from "./semantics/reducers/ontologiesReducers";
import {
vocListReducer,
vocDetailReducer
} from "./semantics/reducers/vocabulariesReducers";

//Object.assign({}, state, .. create a new copy of the state
function datasets(state = { isFetching: false, didInvalidate: false, items: [], dataset: null, ope: '' }, action
) {
Expand Down Expand Up @@ -201,17 +209,6 @@ function userReducer(state = {}, action) {
}
}

function ontologiesReducer(state = {}, action) {
switch (action.type) {
case RECEIVE_ONTOLOGIES:
return Object.assign({}, state, { 'ont': { 'ontologies': action.ontologies, 'error': action.error } })
case RECEIVE_VOCABULARY:
return Object.assign({}, state, { 'voc': { 'ontologies': action.ontologies, 'vocabulary': action.vocabulary, 'error': action.error } })
default:
return state
}
}

function searchReducer(state = {}, action) {
switch (action.type) {
case REQUEST_SEARCH:
Expand All @@ -230,10 +227,14 @@ const rootReducer = combineReducers({
datasetReducer,
userReducer,
searchReducer,
ontologiesReducer,
propertiesReducer,
toastr: toastrReducer, // <- Mounted at toastr.
dataApplicationsList: dataApplicationsReducer
dataApplicationsList: dataApplicationsReducer,
// semantic's reducers
ontologiesList: ontListReducer,
ontologyDetail: ontDetailReducer,
vocabulariesList: vocListReducer,
vocabularyDetail: vocDetailReducer
})

export default rootReducer
3 changes: 2 additions & 1 deletion src/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ const routes = {
'/private/userstory/list': 'Storie',
'/private/userstory/create': 'Nuova storia',
'/private/ingestionwizzard': 'Nuovo dataset',
'/private/vocabulary/list': 'Vocabolari e standard',
'/private/ontologies': 'Ontologie',
'/private/vocabularies': 'Vocabolari',
'/private/dataset':'Dataset',
'/private/widget' : 'Widget',
'/private/search': 'Ricerca',
Expand Down
Loading