Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
anonymize some urls
Browse files Browse the repository at this point in the history
  • Loading branch information
indyarni committed Dec 13, 2017
1 parent 5087beb commit d7c96e5
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 70 deletions.
100 changes: 50 additions & 50 deletions src/main/javascript/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import mime from 'rest/interceptor/mime';
import rest from 'rest';
import ReactDOM from 'react-dom';
import React from 'react';
import { Provider } from 'react-redux';
import {Provider} from 'react-redux';
import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider';
import injectTapEventPlugin from 'react-tap-event-plugin';
import MicroserviceFilterBox from './components/microserviceFilterbox';
Expand All @@ -13,7 +13,7 @@ import AddEditDialog from './components/addEditDialog';
import MicroserviceDeleteServiceDialog from './components/microserviceDeleteServiceDialog';
import LoginDialog from './components/loginDialog';
import store from './stores/microserviceStore';
import { getRequiredPropertyNames } from './shared/requiredPropertyUtil';
import {getRequiredPropertyNames} from './shared/requiredPropertyUtil';

// see http://www.material-ui.com/#/get-started/installation
injectTapEventPlugin();
Expand All @@ -23,19 +23,19 @@ class App extends React.Component {
componentDidMount() {

let client = rest.wrap(mime).wrap(errorCode);
client({ path: '/selavi/services/stages' }).then(response => {
client({path: '/selavi/services/stages'}).then(response => {
store.dispatch({
type: 'FETCH_AVAILABLE_STAGES_SUCCESS',
response: response
});
client({ path: '/selavi/services/' + store.getState().stage }).then(response => {
client({path: '/selavi/services/' + store.getState().stage}).then(response => {
store.dispatch({
type: 'FETCH_MICROSERVICES_SUCCESS',
response: response
});
});
});
client({ path: '/selavi/user' }).then(response => {
client({path: '/selavi/user'}).then(response => {
store.dispatch({
type: 'LOGIN_SUCCESS',
loggedInUser: response.entity
Expand All @@ -45,15 +45,15 @@ class App extends React.Component {

render() {
const serviceBusinessInputFields = {
"id": { label: "Service ID *", hint: "eg. \"ZOE\"", required: true },
"label": { label: "Label *", hint: "eg. \"ZOE\"", required: true },
"id": {label: "Service ID *", hint: "eg. \"ZOE\"", required: true},
"label": {label: "Label *", hint: "eg. \"ZOE\"", required: true},
"fdOwner": {
label: "Contact Person *",
hint: "eg. \"Altmann, Erik\"",
required: true,
searchEndpoint: "/selavi/person/search"
},
"tags": { label: "Tags", hint: "eg. \"dm-pos-belege, produktdaten\"", required: false },
"tags": {label: "Tags", hint: "eg. \"dm-pos-belege, produktdaten\"", required: false},
"description": {
label: "Description *",
hint: "eg. \"ZKDB Online Echtzeitf\u00e4hig\"",
Expand All @@ -63,89 +63,89 @@ class App extends React.Component {
};

const serviceTechInputFields = {
"microserviceUrl": { label: "URL", hint: "eg. \"https://zoe.dm.de\"", required: false },
"ipAddress": { label: "IP address(es)", hint: "eg. \"172.23.68.213\"", required: false },
"networkZone": { label: "Network zone", hint: "eg. \"LAN\"", required: false },
"external": { type: "toggle", label: "External service (eg., not a microservice)" }
"microserviceUrl": {label: "URL", hint: "eg. \"https://example.organization.de\"", required: false},
"ipAddress": {label: "IP address(es)", hint: "eg. \"172.23.68.213\"", required: false},
"networkZone": {label: "Network zone", hint: "eg. \"LAN\"", required: false},
"external": {type: "toggle", label: "External service (eg., not a microservice)"}
};

const serviceDocumentationInputFields = {
"documentationLink": {
label: "Link to documentation *",
hint: "eg. \"https://wiki.dm.de/ZOE\"",
hint: "eg. \"https://wiki.example.de/ZOE\"",
required: true,
isLink: true
},
"buildMonitorLink": {
label: "Link to Build Monitor",
hint: "eg. \"https://zoe-jenkins.dm.de\"",
hint: "eg. \"https://example-jenkins.organization.de\"",
required: false,
isLink: true
},
"monitoringLink": {
label: "Link to Monitoring",
hint: "eg. \"https://elk-kibana.dm.de\"",
hint: "eg. \"https://kibana.organization.de\"",
required: false,
isLink: true
},
"bitbucketUrl": {
label: "Bitbucket URL *",
hint: "eg. \"https://stash.dm.de/projects/ZOE/repos/zoe\"",
hint: "eg. \"https://stash.example.de/projects/ZOE/repos/zoe\"",
required: true,
isLink: true
}
};


const serviceInputTabs = [
{ label: "Business", inputFields: serviceBusinessInputFields },
{ label: "Technical", inputFields: serviceTechInputFields },
{ label: "Documentation", inputFields: serviceDocumentationInputFields }
{label: "Business", inputFields: serviceBusinessInputFields},
{label: "Technical", inputFields: serviceTechInputFields},
{label: "Documentation", inputFields: serviceDocumentationInputFields}
];

const serviceRequiredProperties = getRequiredPropertyNames(serviceInputTabs);

const relationBasicFields = {
"target": { label: "Consumed service", required: true, disabled: true },
"type": { label: "Type of relation", hint: "eg. \"REST\", \"SOAP\"", required: false }
"target": {label: "Consumed service", required: true, disabled: true},
"type": {label: "Type of relation", hint: "eg. \"REST\", \"SOAP\"", required: false}
};

const relationInputTabs = [
{ label: "Basic", inputFields: relationBasicFields }
{label: "Basic", inputFields: relationBasicFields}
];

return (
<div className="appcontainer">
<div className="appheader">
<MicroserviceFilterBox serviceRequiredProperties={serviceRequiredProperties}/>
</div>
<div className="appcontent">
<MicroserviceMindmap serviceRequiredProperties={serviceRequiredProperties}/>
</div>
<div className="appfooter">
<MicroserviceSnackbar/>
<AddEditDialog inputTabs={serviceInputTabs}
addMenuMode="ADD_SERVICE"
editMenuMode="EDIT_SERVICE"
showMenuMode="SHOW_SERVICE"
entityDisplayName="Service"/>
<AddEditDialog inputTabs={relationInputTabs}
addMenuMode="ADD_RELATION"
editMenuMode="EDIT_RELATION"
entityDisplayName="Link"/>
<MicroserviceDeleteServiceDialog/>
<LoginDialog/>
</div>
</div>
<div className="appcontainer">
<div className="appheader">
<MicroserviceFilterBox serviceRequiredProperties={serviceRequiredProperties}/>
</div>
<div className="appcontent">
<MicroserviceMindmap serviceRequiredProperties={serviceRequiredProperties}/>
</div>
<div className="appfooter">
<MicroserviceSnackbar/>
<AddEditDialog inputTabs={serviceInputTabs}
addMenuMode="ADD_SERVICE"
editMenuMode="EDIT_SERVICE"
showMenuMode="SHOW_SERVICE"
entityDisplayName="Service"/>
<AddEditDialog inputTabs={relationInputTabs}
addMenuMode="ADD_RELATION"
editMenuMode="EDIT_RELATION"
entityDisplayName="Link"/>
<MicroserviceDeleteServiceDialog/>
<LoginDialog/>
</div>
</div>
)
}
}

ReactDOM.render(
<MuiThemeProvider>
<Provider store={store}>
<App />
</Provider>
</MuiThemeProvider>,
document.getElementById('react')
<MuiThemeProvider>
<Provider store={store}>
<App/>
</Provider>
</MuiThemeProvider>,
document.getElementById('react')
);
37 changes: 17 additions & 20 deletions src/test/javascript/shared/requiredPropertyUtil.spec.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,20 @@
import chai from 'chai';
import {
getRequiredPropertyNames,
hasAllRequiredProperties
} from '../../../main/javascript/shared/requiredPropertyUtil';
import {getRequiredPropertyNames, hasAllRequiredProperties} from '../../../main/javascript/shared/requiredPropertyUtil';

describe('requiredPropertyUtil', function () {
describe('getRequiredPropertyNames', function () {
it('returns array of required property names', function () {

const serviceBusinessInputFields = {
"id": { label: "Service ID *", hint: "eg. \"ZOE\"", required: true },
"label": { label: "Label *", hint: "eg. \"ZOE\"", required: true },
"id": {label: "Service ID *", hint: "eg. \"ZOE\"", required: true},
"label": {label: "Label *", hint: "eg. \"ZOE\"", required: true},
"fdOwner": {
label: "Contact Person *",
hint: "eg. \"Altmann, Erik\"",
required: true,
searchEndpoint: "/selavi/person/search"
},
"tags": { label: "Tags", hint: "eg. \"dm-pos-belege, produktdaten\"", required: false },
"tags": {label: "Tags", hint: "eg. \"dm-pos-belege, produktdaten\"", required: false},
"description": {
label: "Description",
hint: "eg. \"ZKDB Online Echtzeitf\u00e4hig\"",
Expand All @@ -27,44 +24,44 @@ describe('requiredPropertyUtil', function () {
};

const serviceTechInputFields = {
"microserviceUrl": { label: "URL", hint: "eg. \"https://zoe.dm.de\"", required: false },
"ipAddress": { label: "IP address(es)", hint: "eg. \"172.23.68.213\"", required: false },
"networkZone": { label: "Network zone", hint: "eg. \"LAN\"", required: false },
"external": { type: "toggle", label: "External service (eg., not a microservice)" }
"microserviceUrl": {label: "URL", hint: "eg. \"https://zoe.organization.de\"", required: false},
"ipAddress": {label: "IP address(es)", hint: "eg. \"172.23.68.213\"", required: false},
"networkZone": {label: "Network zone", hint: "eg. \"LAN\"", required: false},
"external": {type: "toggle", label: "External service (eg., not a microservice)"}
};

const serviceDocumentationInputFields = {
"documentationLink": {
label: "Link to documentation",
hint: "eg. \"https://wiki.dm.de/ZOE\"",
hint: "eg. \"https://wiki.organization.de/ZOE\"",
required: false,
isLink: true
},
"buildMonitorLink": {
label: "Link to Build Monitor",
hint: "eg. \"https://zoe-jenkins.dm.de\"",
hint: "eg. \"https://zoe-jenkins.organization.de\"",
required: false,
isLink: true
},
"monitoringLink": {
label: "Link to Monitoring",
hint: "eg. \"https://elk-kibana.dm.de\"",
hint: "eg. \"https://elk-kibana.organization.de\"",
required: false,
isLink: true
},
"bitbucketUrl": {
label: "Bitbucket URL",
hint: "eg. \"https://stash.dm.de/projects/ZOE/repos/zoe\"",
hint: "eg. \"https://stash.organization.de/projects/ZOE/repos/zoe\"",
required: false,
isLink: true
}
};


const serviceInputTabs = [
{ label: "Business", inputFields: serviceBusinessInputFields },
{ label: "Technical", inputFields: serviceTechInputFields },
{ label: "Documentation", inputFields: serviceDocumentationInputFields }
{label: "Business", inputFields: serviceBusinessInputFields},
{label: "Technical", inputFields: serviceTechInputFields},
{label: "Documentation", inputFields: serviceDocumentationInputFields}
];

const result = getRequiredPropertyNames(serviceInputTabs);
Expand All @@ -80,7 +77,7 @@ describe('requiredPropertyUtil', function () {
"id": "selavi",
"label": "selavi",
"tag": "zoe",
"consumes": [{ "target": "GLUECKSKIND-APP", "type": "REST" }],
"consumes": [{"target": "GLUECKSKIND-APP", "type": "REST"}],
"fdOwner": "Erika Esteban Cardoso"
};

Expand All @@ -97,7 +94,7 @@ describe('requiredPropertyUtil', function () {
"id": "selavi",
"label": "selavi",
"tag": "zoe",
"consumes": [{ "target": "GLUECKSKIND-APP", "type": "REST" }],
"consumes": [{"target": "GLUECKSKIND-APP", "type": "REST"}],
"fdOwner": "Erika Esteban Cardoso"
};

Expand Down

0 comments on commit d7c96e5

Please sign in to comment.