├── .gitignore ├── CONTRIBUTING.md ├── License.txt ├── README.md ├── package.json └── service-explorer ├── config.json ├── icon.svg ├── manifest.json ├── src ├── config.ts ├── runtime │ ├── AssetTypeCard.tsx │ ├── AssetTypesCard.tsx │ ├── AttributeRuleCard.tsx │ ├── AttributeRulesCard.tsx │ ├── CAVWorkSpace.tsx │ ├── CategoriesCard.tsx │ ├── CategoryCard.tsx │ ├── DomainCard.tsx │ ├── DomainNetworkCard.tsx │ ├── DomainNetworksCard.tsx │ ├── DomainsCard.tsx │ ├── FeatureServiceCard.tsx │ ├── FieldCard.tsx │ ├── FieldsCard.tsx │ ├── IndexCard.tsx │ ├── IndexesCard.tsx │ ├── LayerCard.tsx │ ├── LayersCard.tsx │ ├── MinimizedCard.tsx │ ├── NetworkAttributeCard.tsx │ ├── NetworkAttributesCard.tsx │ ├── RelationshipCard.tsx │ ├── RelationshipsCard.tsx │ ├── ServiceExplorerTree.tsx │ ├── SubTypesCard.tsx │ ├── SubtypeCard.tsx │ ├── TableCard.tsx │ ├── TablesCard.tsx │ ├── TerminalConfigurationCard.tsx │ ├── TerminalConfigurationsCard.tsx │ ├── UtilityNetworkCard.tsx │ ├── _CAVWorkSpace.tsx │ ├── _MinimizedCard.tsx │ ├── _constants.js │ ├── _header.tsx │ ├── assets │ │ ├── ShowVertex_default.png │ │ ├── ShowVertex_hover.png │ │ ├── arrowx200L.png │ │ ├── arrowx200R.png │ │ ├── data_files │ │ │ ├── dataElements │ │ │ │ └── dataElements.json │ │ │ ├── featureServer │ │ │ │ └── featureServer.json │ │ │ └── layers │ │ │ │ ├── 501.json │ │ │ │ └── 505.json │ │ ├── icon.svg │ │ ├── launch.svg │ │ ├── lookup.json │ │ ├── wab1.jpg │ │ └── webapp.png │ ├── css │ │ ├── custom.css │ │ ├── relationshipClass.scss │ │ └── style.scss │ ├── translations │ │ ├── default.ts │ │ └── zh-cn.js │ └── widget.tsx └── setting │ ├── setting - Copy.tsx │ ├── setting.tsx │ └── translations │ ├── default.ts │ └── zh-cn.js └── tests └── widget.test.tsx /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | 6 | # testing 7 | /coverage 8 | 9 | # production 10 | /build 11 | 12 | # misc 13 | .DS_Store 14 | .env.local 15 | .env.development.local 16 | .env.test.local 17 | .env.production.local 18 | 19 | npm-debug.log* 20 | yarn-debug.log* 21 | yarn-error.log* 22 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | Esri welcomes contributions from anyone and everyone. Please see our [guidelines for contributing](https://github.com/esri/contributing). -------------------------------------------------------------------------------- /License.txt: -------------------------------------------------------------------------------- 1 | Apache License - 2.0 2 | 3 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 4 | 5 | 1. Definitions. 6 | 7 | "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. 8 | 9 | "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. 10 | 11 | "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control 12 | with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management 13 | of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial 14 | ownership of such entity. 15 | 16 | "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. 17 | 18 | "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, 19 | and configuration files. 20 | 21 | "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to 22 | compiled object code, generated documentation, and conversions to other media types. 23 | 24 | "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice 25 | that is included in or attached to the work (an example is provided in the Appendix below). 26 | 27 | "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the 28 | editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes 29 | of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, 30 | the Work and Derivative Works thereof. 31 | 32 | "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work 33 | or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual 34 | or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of 35 | electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on 36 | electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for 37 | the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing 38 | by the copyright owner as "Not a Contribution." 39 | 40 | "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and 41 | subsequently incorporated within the Work. 42 | 43 | 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, 44 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, 45 | publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 46 | 47 | 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, 48 | non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, 49 | sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are 50 | necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was 51 | submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work 52 | or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You 53 | under this License for that Work shall terminate as of the date such litigation is filed. 54 | 55 | 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, 56 | and in Source or Object form, provided that You meet the following conditions: 57 | 58 | 1. You must give any other recipients of the Work or Derivative Works a copy of this License; and 59 | 60 | 2. You must cause any modified files to carry prominent notices stating that You changed the files; and 61 | 62 | 3. You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices 63 | from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and 64 | 65 | 4. If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a 66 | readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the 67 | Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the 68 | Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever 69 | such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. 70 | You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, 71 | provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to 72 | Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your 73 | modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with 74 | the conditions stated in this License. 75 | 76 | 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You 77 | to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, 78 | nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 79 | 80 | 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except 81 | as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 82 | 83 | 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides 84 | its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, 85 | any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for 86 | determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under 87 | this License. 88 | 89 | 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required 90 | by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, 91 | including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the 92 | use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or 93 | any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 94 | 95 | 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a 96 | fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting 97 | such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree 98 | to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your 99 | accepting any such warranty or additional liability. 100 | 101 | END OF TERMS AND CONDITIONS -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | ## Data Dictionary Viewer 3 | 4 | An application that allows viewing and searching of details of a feature Service in an user friendly way. 5 | 6 | ## Features 7 | * Tree view of your feature service 8 | * Search for finding things in a service 9 | * Cards of each aspect of the service 10 | 11 | ## Installation 12 | 1. Make sure you have ArcGIS Experience Builder (ExB) Developer Edition installed on your machine. 13 | 14 | 2. Fork and then clone the repo. Copy the folder "service-explorer" into the your ```\client\your-extensions\widgets``` 15 | 16 | 3. In a command prompt, navigate to ```:\\server```. Type ```npm ci```. After it completes, type ```npm start``` 17 | 18 | 4. Open a second command prompt, navigate to ```:\\client```. Type ```npm ci```. After it completes, type ```npm start```. Make sure you see the widget copied over in the command window. 19 | 20 | 5. Launch ExB in the browser (usually http://localhost:3000/). Create a new app (full screen blank preferred). 21 | 22 | 6. On the left hand panel in th widget list, scroll down and locate the ```Service Explorer``` widget and add it to the canvas. 23 | 24 | 7. On the configuration panel (right side), click the ```Select Data``` button. Add a new data source from the slide out panel. 25 | 26 | 8. Look up and add data by URL and paste in your feature service rest endpoint (Utility Network Service only currently). Select any one of your layers as the control. You should see the URL textbox filled out with the path. 27 | 28 | At this point you have 2 paths to choose. 29 | 30 | 9. If you want to run the Data Dictionary hitting your live service, then you are finished with the configuration. Proceed to step 10. 31 | If you want to run the Data Dictionary hitting a cache of your service (so it is not dependent on it being live and running), follow these additional steps: 32 | - Check the ```Use cache instead of service``` checkbox 33 | - Give your cache a name 34 | - Press the ```Build Cache``` 35 | - This will create an item in your organization (currently org which you signed into Experience Builder). Once the cache is built, access the item in your org and share it publicly. 36 | 37 | Optionally, if you want to be able to load other services via a url parameter check the box labeled "allowurlLookup". 38 | 39 | 10. On the "General" tab of the configuration panel, define the height and width as 100%. 40 | 41 | 11. Save the application and "Preview" or "Publish". 42 | 43 | 12. Since this is a custom widget you will need to deploy the application to a web server if you want to share it with your company. To do so, click the 3 ellipses next to the publish button. In the menu, click the ```Download``` button. 44 | 45 | 13. Extract the download zip into your web server and use a web browser to access it. 46 | 47 | ## Requirements 48 | 49 | * Install Node JS 50 | * Install ArcGIS Experience Builder 51 | * Web browser with access to the Internet 52 | 53 | ## Resources 54 | 55 | ## Usage 56 | To load a specific cache, add the cacheId url parameter pointing to the cache item in your AGOL/Enterprise. Make sure to share the item public. 57 | * ?cacheId= 58 | 59 | The application loads a default feature service defined in the configuration. You can load your own by adding a url parameter if allowed in the configuration. 60 | at the end of the url, type: 61 | * ?lookup=url to your feature service 62 | 63 | If you want a specific card to load on startup, add it as a url parameter with this pattern ```:,:, etc``` 64 | * ?startup=Water Device:Layer 65 | 66 | ## Issues 67 | 68 | Find a bug or want to request a new feature? Please let us know by submitting an issue. 69 | 70 | ## Contributing 71 | 72 | Esri welcomes contributions from anyone and everyone. Please see our [guidelines for contributing](https://github.com/esri/contributing). 73 | 74 | ## Licensing 75 | Copyright 2016 Esri 76 | 77 | Licensed under the Apache License, Version 2.0 (the "License"); 78 | you may not use this file except in compliance with the License. 79 | You may obtain a copy of the License at 80 | 81 | http://www.apache.org/licenses/LICENSE-2.0 82 | 83 | Unless required by applicable law or agreed to in writing, software 84 | distributed under the License is distributed on an "AS IS" BASIS, 85 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 86 | See the License for the specific language governing permissions and 87 | limitations under the License. 88 | 89 | A copy of the license is available in the repository's [license.txt](https://github.com/ArcGIS/solutions-data-dictionary-viewer/edit/master/License.txt) file. 90 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "data_dictionary_viewer", 3 | "version": "0.1.0", 4 | "private": true, 5 | "homepage": "https://arcgisutilitysolutionsdemo.esri.com/data_dictionary", 6 | "dependencies": { 7 | "@blueprintjs/core": "^3.6.1", 8 | "@blueprintjs/docs-theme": "^3.0.1", 9 | "@blueprintjs/icons": "^3.1.0", 10 | "@blueprintjs/select": "^3.2.0", 11 | "@blueprintjs/table": "^3.1.1", 12 | "@types/arcgis-js-api": "^4.9.0", 13 | "esri-loader": "^2.5.0", 14 | "popper.js": "^1.14.5", 15 | "react": "^16.5.2", 16 | "react-addons-css-transition-group": "^15.6.2", 17 | "react-burger-menu": "^2.5.4", 18 | "react-collapsible": "^2.3.1", 19 | "react-dom": "^16.5.2", 20 | "react-draggable": "^3.0.5", 21 | "react-redux": "^5.1.0", 22 | "react-resizable": "^1.7.5", 23 | "react-rnd": "^9.0.2", 24 | "react-router-dom": "^4.3.1", 25 | "react-scripts": "1.1.5", 26 | "react-syntax-highlighter": "^10.0.0", 27 | "react-transition-group": "^2.5.0", 28 | "redux": "^4.0.1" 29 | }, 30 | "scripts": { 31 | "start": "react-scripts start", 32 | "build": "react-scripts build", 33 | "test": "react-scripts test --env=jsdom", 34 | "eject": "react-scripts eject" 35 | }, 36 | "devDependencies": { 37 | "@babel/core": "^7.1.2", 38 | "@babel/preset-env": "^7.1.0", 39 | "babel-core": "^6.26.3", 40 | "babel-loader": "^7.1.5", 41 | "babel-preset-env": "^1.7.0", 42 | "webpack": "^4.23.1" 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /service-explorer/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "serviceURL": "https://arcgisutilitysolutionsdemo.esri.com/server/rest/services/Water_Distribution_Utility_Network_Metadata/FeatureServer", 3 | "hasMetadata": true, 4 | "test":true 5 | } -------------------------------------------------------------------------------- /service-explorer/icon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | widget-demo 5 | Created with Sketch. 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /service-explorer/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "service-explorer", 3 | "label": "Service Explorer", 4 | "type": "widget", 5 | "version": "0.0.1", 6 | "jimuVersion": "0.0.1", 7 | "author": "Esri R&D Center Beijing", 8 | "description": "This is the widget used in developer guide", 9 | "copyright": "", 10 | "license": "http://www.apache.org/licenses/LICENSE-2.0", 11 | "properties": {}, 12 | "translatedLocales": [ 13 | "en" 14 | ], 15 | "defaultSize": { 16 | "width": 1024, 17 | "height": 760 18 | } 19 | } -------------------------------------------------------------------------------- /service-explorer/src/config.ts: -------------------------------------------------------------------------------- 1 | import {ImmutableObject} from 'seamless-immutable'; 2 | 3 | export interface Config{ 4 | serviceURL: string; 5 | hasMetadata: boolean; 6 | allowUrlLookup: boolean; 7 | useCache: boolean; 8 | cachePath: string; 9 | cacheId: string; 10 | } 11 | 12 | export type IMConfig = ImmutableObject; -------------------------------------------------------------------------------- /service-explorer/src/runtime/AssetTypesCard.tsx: -------------------------------------------------------------------------------- 1 | /** @jsx jsx */ 2 | import { React, jsx } from 'jimu-core' 3 | import { Icon, Table } from 'jimu-ui' 4 | import { TabContent, TabPane } from 'reactstrap' 5 | import CardHeader from './_header' 6 | import './css/custom.css' 7 | const linkIcon = require('./assets/launch.svg') 8 | 9 | interface IProps { 10 | data: any 11 | requestURL: string 12 | panel: number 13 | config: any 14 | cacheData: any 15 | callbackClose: any 16 | callbackSave: any 17 | callbackLinkage: any 18 | callbackGetPanels: any 19 | callbackReorderCards: any 20 | callbackActiveCards: any 21 | callbackGetFavorites: any 22 | callbackMove: any 23 | } 24 | 25 | interface IState { 26 | nodeData: any 27 | activeTab: string 28 | minimizedDetails: boolean 29 | assetTypeDesc: string[] 30 | metadataElements: any 31 | } 32 | 33 | export default class SubTypesCard extends React.Component { 34 | constructor (props: IProps) { 35 | super(props) 36 | 37 | this.state = { 38 | nodeData: this.props.data.data, 39 | activeTab: 'Properties', 40 | minimizedDetails: false, 41 | assetTypeDesc: [], 42 | metadataElements: null 43 | } 44 | } 45 | 46 | componentWillMount () { 47 | this._requestMetadata().then(() => { 48 | this._processMetaData() 49 | }) 50 | } 51 | 52 | componentDidMount () { 53 | } 54 | 55 | render () { 56 | return ( 57 |
58 | 70 | { 71 | (this.state.minimizedDetails) 72 | ? '' 73 | : 74 | 75 |
76 |
{this.buildCrumb()}{this.props.data.type}
77 |
78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | {this._createSTList()} 88 | 89 |
NameCodeDescription
90 |
91 |
92 |
93 |
94 |
95 | } 96 |
) 97 | } 98 | 99 | //**** breadCrumb */ 100 | buildCrumb =() => { 101 | const list = [] 102 | this.props.data.crumb.forEach((c: any, i: number) => { 103 | list.push( { 104 | this.props.callbackLinkage(c.value, c.type, this.props.panel) 105 | this.headerCallClose() 106 | }} style={{ cursor: 'pointer' }}>{c.value + ' > '}) 107 | }) 108 | return (list) 109 | } 110 | 111 | //****** Header Support functions 112 | //******************************************** 113 | headerToggleTabs =(tab: string) => { 114 | if (this.state.activeTab !== tab) { 115 | this.setState({ 116 | activeTab: tab 117 | }) 118 | } 119 | switch (tab) { 120 | case 'Statistics': { 121 | break 122 | } 123 | default: { 124 | break 125 | } 126 | } 127 | } 128 | 129 | headerCallMove =(direction: string) => { 130 | this.props.callbackMove(this.props.data, this.props.data.type, this.props.panel, direction) 131 | } 132 | 133 | headerCallReorder =(direction: string) => { 134 | this.props.callbackReorderCards(this.props.data, this.props.panel, direction) 135 | } 136 | 137 | headerCallClose =() => { 138 | this.props.callbackClose(this.props.data, this.props.panel) 139 | } 140 | 141 | headerCallFavorite =() => { 142 | return new Promise((resolve, reject) => { 143 | this.props.callbackSave(this.props.data).then(resolve(true)) 144 | }) 145 | } 146 | 147 | headerSearchFavorites =() => { 148 | let isFavorite = false 149 | const list = this.props.callbackGetFavorites() 150 | isFavorite = list.some((li: any) => { 151 | return li.props.data.id === this.props.data.id 152 | }) 153 | return isFavorite 154 | } 155 | 156 | headerActiveCardLocation =() => { 157 | let currPos = -1 158 | const list = this.props.callbackActiveCards() 159 | list[this.props.panel].forEach((mac: any, i: number) => { 160 | if (mac.props.data.id === this.props.data.id) { 161 | currPos = i 162 | } 163 | }) 164 | return currPos 165 | } 166 | 167 | headerCallMinimize =() => { 168 | let currState = this.state.minimizedDetails 169 | if (currState) { 170 | currState = false 171 | this.setState({ minimizedDetails: currState }) 172 | } else { 173 | currState = true 174 | this.setState({ minimizedDetails: currState }) 175 | } 176 | return currState 177 | } 178 | 179 | //****** UI components and UI Interaction 180 | //******************************************** 181 | _createSTList = () => { 182 | const arrList = [] 183 | this.state.nodeData.forEach((ar: any, i: number) => { 184 | //get matching AT desc 185 | const atDesc: any = this.state.assetTypeDesc.filter((atd: any) => { 186 | return (parseInt(atd.code) === parseInt(ar.data.assetTypeCode)) 187 | }) 188 | 189 | arrList.push( 190 | 191 | 192 |
{ this.props.callbackLinkage(ar.data.assetTypeName, 'Assettype', this.props.panel, this.props.data.parent, this.props.data.subtypes.subtypeName) }} style={{ display: 'inline-block', verticalAlign: 'top', paddingRight: 5, cursor: 'pointer' }}> {ar.data.assetTypeName}
193 | 194 | {ar.data.assetTypeCode} 195 | {atDesc.length > 0 ? atDesc[0].description : ''} 196 | 197 | ) 198 | }) 199 | return arrList 200 | } 201 | 202 | //****** helper functions and request functions 203 | //******************************************** 204 | _requestMetadata = async () => { 205 | if (this.props.config.useCache) { 206 | const data = this.props.cacheData.metadata[this.props.data.parentId] 207 | const parser = new DOMParser() 208 | const xmlDoc = parser.parseFromString(data, 'text/xml') 209 | this.setState({ metadataElements: xmlDoc }) 210 | } else { 211 | const url = this.props.requestURL + '/' + this.props.data.parentId + '/metadata' 212 | await fetch(url, { 213 | method: 'GET' 214 | }) 215 | .then((response) => { return response.text() }) 216 | .then((data) => { 217 | const parser = new DOMParser() 218 | const xmlDoc = parser.parseFromString(data, 'text/xml') 219 | this.setState({ metadataElements: xmlDoc }) 220 | }) 221 | } 222 | } 223 | 224 | _processMetaData =() => { 225 | const ATDesc = [] 226 | const metadata = this.state.metadataElements 227 | const metaLevel = metadata.getElementsByTagName('metadata') 228 | if (metaLevel.length > 0) { 229 | const eaInfoLevel = metaLevel[0].getElementsByTagName('eainfo') 230 | if (eaInfoLevel.length > 0) { 231 | const detailedLevel = eaInfoLevel[0].getElementsByTagName('detailed') 232 | if (detailedLevel.length > 0) { 233 | for (let i = 0; i < detailedLevel.length; i++) { 234 | const subTypeCodeLevel = detailedLevel[i].getElementsByTagName('enttypdv') 235 | if (subTypeCodeLevel.length > 0) { 236 | //loop thorugh details and get code node and see if it's the current code card is on. 237 | if (parseInt(subTypeCodeLevel[0].innerHTML) === parseInt(this.state.nodeData[0].subtypeCode)) { 238 | //now add only fields that pertain to this subtype 239 | const attrLevel = detailedLevel[i].getElementsByTagName('attr') 240 | if (attrLevel.length > 0) { 241 | for (let z = 0; z < attrLevel.length; z++) { 242 | const fieldName = attrLevel[z].getElementsByTagName('attrlabl') 243 | if (fieldName.length > 0) { 244 | if (fieldName[0].innerHTML.toLowerCase() === 'assettype') { 245 | //get AT descriptions 246 | const attrdomvLevel = attrLevel[z].getElementsByTagName('attrdomv') 247 | if (attrdomvLevel.length > 0) { 248 | const edomLevel = attrdomvLevel[0].getElementsByTagName('edom') 249 | if (edomLevel.length > 0) { 250 | for (let e = 0; e < edomLevel.length; e++) { 251 | const edomvLevel = edomLevel[e].getElementsByTagName('edomv') 252 | const edomvddLevel = edomLevel[e].getElementsByTagName('edomvdd') 253 | //where AT desc is stored 254 | if (edomvddLevel.length > 0) { 255 | ATDesc.push({ code: edomvLevel[0].innerHTML, description: edomvddLevel[0].innerHTML }) 256 | } 257 | } 258 | } 259 | } 260 | } 261 | } 262 | } 263 | } 264 | } 265 | } 266 | } 267 | } 268 | } 269 | } 270 | this.setState({ assetTypeDesc: ATDesc }) 271 | } 272 | } 273 | -------------------------------------------------------------------------------- /service-explorer/src/runtime/AttributeRuleCard.tsx: -------------------------------------------------------------------------------- 1 | /** @jsx jsx */ 2 | import { React, jsx } from 'jimu-core' 3 | import { TabContent, TabPane } from 'reactstrap' 4 | import CardHeader from './_header' 5 | import EsriLookup from './_constants' 6 | import './css/custom.css' 7 | 8 | interface IProps { 9 | data: any 10 | requestURL: string 11 | key: any 12 | panel: number 13 | callbackClose: any 14 | callbackSave: any 15 | callbackLinkage: any 16 | callbackGetPanels: any 17 | callbackReorderCards: any 18 | callbackActiveCards: any 19 | callbackGetFavorites: any 20 | callbackMove: any 21 | } 22 | 23 | interface IState { 24 | nodeData: any 25 | activeTab: string 26 | minimizedDetails: boolean 27 | esriValueList: any 28 | } 29 | 30 | export default class AttributeRuleCard extends React.Component { 31 | constructor (props: IProps) { 32 | super(props) 33 | 34 | this.state = { 35 | nodeData: this.props.data.data, 36 | activeTab: 'Properties', 37 | minimizedDetails: false, 38 | esriValueList: new EsriLookup() 39 | } 40 | } 41 | 42 | componentWillMount () {} 43 | 44 | componentDidMount () {} 45 | 46 | render () { 47 | return ( 48 |
49 | 61 | { 62 | (this.state.minimizedDetails) 63 | ? '' 64 | : 65 | 66 |
67 |
{this.buildCrumb()}Properties
68 |
Name: {this.state.nodeData.name}
69 |
Description: {this.state.nodeData.description}
70 |
This rule works on: {this._matchCodeToDesc(this.state.nodeData.subtypeCode)}
71 |
This rule is set on: {this.state.nodeData.fieldName}
72 |
This rule is triggered on: {this._splitTiggerRules(this.state.nodeData.triggeringEvents)}
73 |
This rule type is: {this.state.esriValueList.lookupValue(this.state.nodeData.type)}
74 |
This rule is batched: {(this.state.nodeData.batch) ? 'True' : 'False'}
75 |
Priority: {this.state.nodeData.evaluationOrder}
76 |
References External Services: {(this.state.nodeData.referencesExternalService) ? 'True' : 'False'}
77 |
Script
78 |
79 | { 80 | (this.state.nodeData.errorMessage !== '""') 81 | ?
Error Message: {'Code ' + this.state.nodeData.errorNumber}
82 | :
Error Message: {'Code ' + this.state.nodeData.errorNumber + ': ' + this.state.nodeData.errorMessage}
83 | } 84 |
85 |
86 |
87 |
88 | } 89 |
) 90 | } 91 | 92 | //**** breadCrumb */ 93 | buildCrumb =() => { 94 | const list = [] 95 | this.props.data.crumb.forEach((c: any, i: number) => { 96 | list.push( { 97 | this.props.callbackLinkage(c.value, c.type, this.props.panel, this.props.data.parent) 98 | this.headerCallClose() 99 | }} style={{ cursor: 'pointer' }}>{c.value + ' > '}) 100 | }) 101 | return (list) 102 | } 103 | 104 | //****** Header Support functions 105 | //******************************************** 106 | headerToggleTabs =(tab: string) => { 107 | if (this.state.activeTab !== tab) { 108 | this.setState({ 109 | activeTab: tab 110 | }) 111 | } 112 | switch (tab) { 113 | case 'Statistics': { 114 | break 115 | } 116 | default: { 117 | break 118 | } 119 | } 120 | } 121 | 122 | headerCallMove =(direction: string) => { 123 | this.props.callbackMove(this.props.data, this.props.data.type, this.props.panel, direction) 124 | } 125 | 126 | headerCallReorder =(direction: string) => { 127 | this.props.callbackReorderCards(this.props.data, this.props.panel, direction) 128 | } 129 | 130 | headerCallClose =() => { 131 | this.props.callbackClose(this.props.data, this.props.panel) 132 | } 133 | 134 | headerCallFavorite =() => { 135 | return new Promise((resolve, reject) => { 136 | this.props.callbackSave(this.props.data).then(resolve(true)) 137 | }) 138 | } 139 | 140 | headerSearchFavorites =() => { 141 | let isFavorite = false 142 | const list = this.props.callbackGetFavorites() 143 | isFavorite = list.some((li: any) => { 144 | return li.props.data.id === this.props.data.id 145 | }) 146 | return isFavorite 147 | } 148 | 149 | headerActiveCardLocation =() => { 150 | let currPos = -1 151 | const list = this.props.callbackActiveCards() 152 | list[this.props.panel].forEach((mac: any, i: number) => { 153 | if (mac.props.data.id === this.props.data.id) { 154 | currPos = i 155 | } 156 | }) 157 | return currPos 158 | } 159 | 160 | headerCallMinimize =() => { 161 | let currState = this.state.minimizedDetails 162 | if (currState) { 163 | currState = false 164 | this.setState({ minimizedDetails: currState }) 165 | } else { 166 | currState = true 167 | this.setState({ minimizedDetails: currState }) 168 | } 169 | return currState 170 | } 171 | 172 | //****** UI components and UI Interaction 173 | //******************************************** 174 | _processCodeBlock =(code: string) => { 175 | let block = '' 176 | block = code.replace(/;/g, ';
') 177 | block = block.replace(/\{/g, '{
') 178 | block = block.replace(/return/g, "return") 179 | block = block.replace(/==/g, "==") 180 | block = block.replace(/!=/g, "!=") 181 | block = block.replace(/var */g, "var ") 182 | block = block.replace(/else */g, "else ") 183 | block = block.replace(/if */g, "if ") 184 | block = block.replace(/\|\| */g, "|| ") 185 | block = block.replace(/&& */g, "&& ") 186 | return { __html: block } 187 | } 188 | 189 | //****** helper functions and request functions 190 | //******************************************** 191 | 192 | _matchCodeToDesc =(code: any) => { 193 | let message = '' 194 | const subtypes = this.props.data.subtypes 195 | const result = subtypes.filter((st: any) => { 196 | return (code === st.subtypeCode) 197 | }) 198 | if (result.length > 0) { 199 | message = result[0].subtypeName 200 | } else { 201 | message = 'Sorry, no matching type' 202 | } 203 | return message 204 | } 205 | 206 | _splitTiggerRules =(rules: any) => { 207 | const list = [] 208 | rules.forEach((r: any) => { 209 | list.push(this.state.esriValueList.lookupValue(r)) 210 | }) 211 | return list.join() 212 | } 213 | } 214 | -------------------------------------------------------------------------------- /service-explorer/src/runtime/AttributeRulesCard.tsx: -------------------------------------------------------------------------------- 1 | /** @jsx jsx */ 2 | import { React, jsx } from 'jimu-core' 3 | import { Icon, Table } from 'jimu-ui' 4 | import { TabContent, TabPane } from 'reactstrap' 5 | import CardHeader from './_header' 6 | import './css/custom.css' 7 | const linkIcon = require('./assets/launch.svg') 8 | 9 | interface IProps { 10 | data: any 11 | requestURL: string 12 | key: any 13 | panel: number 14 | callbackClose: any 15 | callbackSave: any 16 | callbackLinkage: any 17 | callbackGetPanels: any 18 | callbackReorderCards: any 19 | callbackActiveCards: any 20 | callbackGetFavorites: any 21 | callbackMove: any 22 | } 23 | 24 | interface IState { 25 | nodeData: any 26 | activeTab: string 27 | minimizedDetails: boolean 28 | } 29 | 30 | export default class AttributeRulesCard extends React.Component { 31 | constructor (props: IProps) { 32 | super(props) 33 | 34 | this.state = { 35 | nodeData: this.props.data.data, 36 | activeTab: 'Properties', 37 | minimizedDetails: false 38 | } 39 | } 40 | 41 | componentWillMount () { 42 | } 43 | 44 | componentDidMount () { 45 | //this._processData(); 46 | } 47 | 48 | render () { 49 | return ( 50 |
51 | 63 | { 64 | (this.state.minimizedDetails) 65 | ? '' 66 | : 67 | 68 |
69 |
{this.buildCrumb()}{this.props.data.type}
70 |
71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | {this._createARList()} 82 | 83 |
NameDescriptionApplied OnPriority
84 |
85 |
86 |
87 |
88 |
89 | } 90 |
) 91 | } 92 | 93 | //**** breadCrumb */ 94 | buildCrumb =() => { 95 | const list = [] 96 | this.props.data.crumb.forEach((c: any, i: number) => { 97 | list.push( { 98 | this.props.callbackLinkage(c.value, c.type, this.props.panel) 99 | this.headerCallClose() 100 | }} style={{ cursor: 'pointer' }}>{c.value + ' > '}) 101 | }) 102 | return (list) 103 | } 104 | 105 | //****** Header Support functions 106 | //******************************************** 107 | headerToggleTabs =(tab: string) => { 108 | if (this.state.activeTab !== tab) { 109 | this.setState({ 110 | activeTab: tab 111 | }) 112 | } 113 | switch (tab) { 114 | case 'Statistics': { 115 | break 116 | } 117 | default: { 118 | break 119 | } 120 | } 121 | } 122 | 123 | headerCallMove =(direction: string) => { 124 | this.props.callbackMove(this.props.data, this.props.data.type, this.props.panel, direction) 125 | } 126 | 127 | headerCallReorder =(direction: string) => { 128 | this.props.callbackReorderCards(this.props.data, this.props.panel, direction) 129 | } 130 | 131 | headerCallClose =() => { 132 | this.props.callbackClose(this.props.data, this.props.panel) 133 | } 134 | 135 | headerCallFavorite =() => { 136 | return new Promise((resolve, reject) => { 137 | this.props.callbackSave(this.props.data).then(resolve(true)) 138 | }) 139 | } 140 | 141 | headerSearchFavorites =() => { 142 | let isFavorite = false 143 | const list = this.props.callbackGetFavorites() 144 | isFavorite = list.some((li: any) => { 145 | return li.props.data.id === this.props.data.id 146 | }) 147 | return isFavorite 148 | } 149 | 150 | headerActiveCardLocation =() => { 151 | let currPos = -1 152 | const list = this.props.callbackActiveCards() 153 | list[this.props.panel].forEach((mac: any, i: number) => { 154 | if (mac.props.data.id === this.props.data.id) { 155 | currPos = i 156 | } 157 | }) 158 | return currPos 159 | } 160 | 161 | headerCallMinimize =() => { 162 | let currState = this.state.minimizedDetails 163 | if (currState) { 164 | currState = false 165 | this.setState({ minimizedDetails: currState }) 166 | } else { 167 | currState = true 168 | this.setState({ minimizedDetails: currState }) 169 | } 170 | return currState 171 | } 172 | 173 | //****** UI components and UI Interaction 174 | //******************************************** 175 | _createARList = () => { 176 | const arrList = [] 177 | this.props.data.data.forEach((ar: any, i: number) => { 178 | arrList.push( 179 | 180 | 181 |
{ this.props.callbackLinkage(ar.name, 'Attribute Rule', this.props.panel, this.props.data.parent) }} style={{ display: 'inline-block', verticalAlign: 'top', paddingRight: 5, cursor: 'pointer' }}> {ar.name}
182 | 183 | {ar.description} 184 | 185 | {(ar.subtypeCode !== -1) 186 | ?
{ this.props.callbackLinkage(this._matchCodeToDesc(ar.subtypeCode), 'Subtype', this.props.panel, this.props.data.parent) }} style={{ display: 'inline-block', verticalAlign: 'top', paddingRight: 5, cursor: 'pointer' }}> {this._matchCodeToDesc(ar.subtypeCode)}
187 | :
{this._matchCodeToDesc(ar.subtypeCode)}
188 | } 189 | 190 | {ar.evaluationOrder} 191 | 192 | ) 193 | }) 194 | return arrList 195 | } 196 | 197 | //****** helper functions and request functions 198 | //******************************************** 199 | 200 | _matchCodeToDesc =(code: any) => { 201 | let message = '' 202 | const subtypes = this.props.data.subtypes 203 | const result = subtypes.filter((st: any) => { 204 | return (code === st.subtypeCode) 205 | }) 206 | if (result.length > 0) { 207 | message = result[0].subtypeName 208 | } else { 209 | message = 'All' 210 | } 211 | return message 212 | } 213 | } 214 | -------------------------------------------------------------------------------- /service-explorer/src/runtime/CategoriesCard.tsx: -------------------------------------------------------------------------------- 1 | /** @jsx jsx */ 2 | import { React, jsx } from 'jimu-core' 3 | import { Icon, Table } from 'jimu-ui' 4 | import { TabContent, TabPane } from 'reactstrap' 5 | import CardHeader from './_header' 6 | import './css/custom.css' 7 | const linkIcon = require('./assets/launch.svg') 8 | 9 | interface IProps { 10 | data: any 11 | requestURL: string 12 | key: any 13 | panel: number 14 | callbackClose: any 15 | callbackSave: any 16 | callbackLinkage: any 17 | callbackGetPanels: any 18 | callbackReorderCards: any 19 | callbackActiveCards: any 20 | callbackGetFavorites: any 21 | callbackMove: any 22 | } 23 | 24 | interface IState { 25 | nodeData: any 26 | activeTab: string 27 | minimizedDetails: boolean 28 | } 29 | 30 | export default class TerminalConfigurationsCard extends React.Component { 31 | constructor (props: IProps) { 32 | super(props) 33 | 34 | this.state = { 35 | nodeData: this.props.data.data, 36 | activeTab: 'Properties', 37 | minimizedDetails: false 38 | } 39 | } 40 | 41 | componentWillMount () {} 42 | 43 | componentDidMount () {} 44 | 45 | componentWillReceiveProps () { 46 | //this.setState({ state: this.state }) 47 | } 48 | 49 | componentDidUpdate () {} 50 | 51 | render () { 52 | return ( 53 |
54 | 66 | { 67 | (this.state.minimizedDetails) 68 | ? '' 69 | : 70 | 71 |
72 |
{this.buildCrumb()}{this.props.data.type}
73 |
74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | {this._createList()} 82 | 83 |
Name
84 |
85 |
86 |
87 |
88 |
89 | } 90 |
) 91 | } 92 | 93 | //**** breadCrumb */ 94 | buildCrumb =() => { 95 | const list = [] 96 | this.props.data.crumb.forEach((c: any, i: number) => { 97 | list.push( { 98 | this.props.callbackLinkage(c.value, c.type, this.props.panel) 99 | this.headerCallClose() 100 | }} style={{ cursor: 'pointer' }}>{c.value + ' > '}) 101 | }) 102 | return (list) 103 | } 104 | 105 | //****** Header Support functions 106 | //******************************************** 107 | headerToggleTabs =(tab: string) => { 108 | if (this.state.activeTab !== tab) { 109 | this.setState({ 110 | activeTab: tab 111 | }) 112 | } 113 | switch (tab) { 114 | case 'Statistics': { 115 | break 116 | } 117 | default: { 118 | break 119 | } 120 | } 121 | } 122 | 123 | headerCallMove =(direction: string) => { 124 | this.props.callbackMove(this.props.data, this.props.data.type, this.props.panel, direction) 125 | } 126 | 127 | headerCallReorder =(direction: string) => { 128 | this.props.callbackReorderCards(this.props.data, this.props.panel, direction) 129 | } 130 | 131 | headerCallClose =() => { 132 | this.props.callbackClose(this.props.data, this.props.panel) 133 | } 134 | 135 | headerCallFavorite =() => { 136 | return new Promise((resolve, reject) => { 137 | this.props.callbackSave(this.props.data).then(resolve(true)) 138 | }) 139 | } 140 | 141 | headerSearchFavorites =() => { 142 | let isFavorite = false 143 | const list = this.props.callbackGetFavorites() 144 | isFavorite = list.some((li: any) => { 145 | return li.props.data.id === this.props.data.id 146 | }) 147 | return isFavorite 148 | } 149 | 150 | headerActiveCardLocation =() => { 151 | let currPos = -1 152 | const list = this.props.callbackActiveCards() 153 | list[this.props.panel].forEach((mac: any, i: number) => { 154 | if (mac.props.data.id === this.props.data.id) { 155 | currPos = i 156 | } 157 | }) 158 | return currPos 159 | } 160 | 161 | headerCallMinimize =() => { 162 | let currState = this.state.minimizedDetails 163 | if (currState) { 164 | currState = false 165 | this.setState({ minimizedDetails: currState }) 166 | } else { 167 | currState = true 168 | this.setState({ minimizedDetails: currState }) 169 | } 170 | return currState 171 | } 172 | 173 | //****** UI components and UI Interaction 174 | //******************************************** 175 | _createList = () => { 176 | const arrList = [] 177 | this.props.data.data.forEach((ar: any, i: number) => { 178 | arrList.push( 179 | 180 | 181 |
{ this.props.callbackLinkage(ar.name, 'Category', this.props.panel) }} style={{ display: 'inline-block', verticalAlign: 'top', paddingRight: 5, cursor: 'pointer' }}> {ar.name}
182 | 183 | 184 | ) 185 | }) 186 | return arrList 187 | } 188 | 189 | //****** helper functions and request functions 190 | //******************************************** 191 | } 192 | -------------------------------------------------------------------------------- /service-explorer/src/runtime/CategoryCard.tsx: -------------------------------------------------------------------------------- 1 | /** @jsx jsx */ 2 | import { React, jsx } from 'jimu-core' 3 | import { Icon, Collapse, Table } from 'jimu-ui' 4 | import { TabContent, TabPane } from 'reactstrap' 5 | import CardHeader from './_header' 6 | import './css/custom.css' 7 | const linkIcon = require('./assets/launch.svg') 8 | const rightArrowIcon = require('jimu-ui/lib/icons/arrow-right.svg') 9 | const downArrowIcon = require('jimu-ui/lib/icons/arrow-down.svg') 10 | 11 | interface IProps { 12 | data: any 13 | dataElements: any 14 | domains: any 15 | requestURL: string 16 | panel: number 17 | callbackClose: any 18 | callbackSave: any 19 | callbackLinkage: any 20 | callbackGetPanels: any 21 | callbackReorderCards: any 22 | callbackActiveCards: any 23 | callbackGetFavorites: any 24 | callbackMove: any 25 | } 26 | 27 | interface IState { 28 | nodeData: any 29 | activeTab: string 30 | expandActive: boolean 31 | expandAT: any 32 | minimizedDetails: boolean 33 | } 34 | 35 | export default class CategoryCard extends React.Component { 36 | constructor (props: IProps) { 37 | super(props) 38 | 39 | this.state = { 40 | nodeData: this.props.data.data, 41 | activeTab: 'Properties', 42 | expandActive: false, 43 | expandAT: {}, 44 | minimizedDetails: false 45 | } 46 | } 47 | 48 | componentWillMount () { 49 | const atCopy = { ...this.state.expandAT } 50 | const dn = this._findUN() 51 | if (dn !== null) { 52 | dn.forEach((d: any, i: number) => { 53 | d.junctionSources.forEach((js: any) => { 54 | js.assetGroups.forEach((ag: any) => { 55 | atCopy[ag.assetGroupName] = false 56 | }) 57 | }) 58 | }) 59 | } 60 | this.setState({ expandAT: atCopy }) 61 | } 62 | 63 | componentDidMount () { 64 | //this._processData(); 65 | } 66 | 67 | render () { 68 | return ( 69 |
70 | 82 | { 83 | (this.state.minimizedDetails) 84 | ? '' 85 | : 86 | 87 |
88 |
{this.buildCrumb()}Properties
89 |
Name: {this.state.nodeData.name}
90 |
{ this.toggleActiveCat() }}>{(this.state.expandActive) ? : } Category used in
91 | 92 |
93 | {(this._findUN() !== null) ? this._createActiveTable() : 'No domains exist'} 94 |
95 |
96 |
97 |
98 |
99 |
100 | } 101 |
) 102 | } 103 | 104 | //**** breadCrumb */ 105 | buildCrumb =() => { 106 | const list = [] 107 | this.props.data.crumb.forEach((c: any, i: number) => { 108 | list.push( { 109 | this.props.callbackLinkage(c.value, c.type, this.props.panel) 110 | this.headerCallClose() 111 | }} style={{ cursor: 'pointer' }}>{c.value + ' > '}) 112 | }) 113 | return (list) 114 | } 115 | 116 | //****** Header Support functions 117 | //******************************************** 118 | headerToggleTabs =(tab: string) => { 119 | if (this.state.activeTab !== tab) { 120 | this.setState({ 121 | activeTab: tab 122 | }) 123 | } 124 | switch (tab) { 125 | case 'Statistics': { 126 | break 127 | } 128 | default: { 129 | break 130 | } 131 | } 132 | } 133 | 134 | headerCallMove =(direction: string) => { 135 | this.props.callbackMove(this.props.data, this.props.data.type, this.props.panel, direction) 136 | } 137 | 138 | headerCallReorder =(direction: string) => { 139 | this.props.callbackReorderCards(this.props.data, this.props.panel, direction) 140 | } 141 | 142 | headerCallClose =() => { 143 | this.props.callbackClose(this.props.data, this.props.panel) 144 | } 145 | 146 | headerCallFavorite =() => { 147 | return new Promise((resolve, reject) => { 148 | this.props.callbackSave(this.props.data).then(resolve(true)) 149 | }) 150 | } 151 | 152 | headerSearchFavorites =() => { 153 | let isFavorite = false 154 | const list = this.props.callbackGetFavorites() 155 | isFavorite = list.some((li: any) => { 156 | return li.props.data.id === this.props.data.id 157 | }) 158 | return isFavorite 159 | } 160 | 161 | headerActiveCardLocation =() => { 162 | let currPos = -1 163 | const list = this.props.callbackActiveCards() 164 | list[this.props.panel].forEach((mac: any, i: number) => { 165 | if (mac.props.data.id === this.props.data.id) { 166 | currPos = i 167 | } 168 | }) 169 | return currPos 170 | } 171 | 172 | headerCallMinimize =() => { 173 | let currState = this.state.minimizedDetails 174 | if (currState) { 175 | currState = false 176 | this.setState({ minimizedDetails: currState }) 177 | } else { 178 | currState = true 179 | this.setState({ minimizedDetails: currState }) 180 | } 181 | return currState 182 | } 183 | 184 | //****** UI components and UI Interaction 185 | //******************************************** 186 | toggleActiveCat =() => { 187 | if (this.state.expandActive) { 188 | this.setState({ expandActive: false }) 189 | } else { 190 | this.setState({ expandActive: true }) 191 | } 192 | } 193 | 194 | toggleActiveATList =(name: string) => { 195 | const atCopy = { ...this.state.expandAT } 196 | if (atCopy[name] === false) { 197 | atCopy[name] = true 198 | this.setState({ expandAT: atCopy }) 199 | } else { 200 | atCopy[name] = false 201 | this.setState({ expandAT: atCopy }) 202 | } 203 | } 204 | 205 | _createActiveTable =() => { 206 | const arrList = [] 207 | const dn = this._findUN() 208 | if (dn !== null) { 209 | dn.forEach((d: any, i: number) => { 210 | d.junctionSources.forEach((js: any) => { 211 | js.assetGroups.forEach((ag: any) => { 212 | const atTable = this._createAssetTypeTable(ag.assetTypes, ag.assetGroupName, this._layerLookup(js.layerId)) 213 | if (atTable !== null) { 214 | arrList.push( 215 | 216 | { this.props.callbackLinkage(this._layerLookup(js.layerId), 'Layer', this.props.panel) }}> {this._layerLookup(js.layerId)} 217 | { this.props.callbackLinkage(ag.assetGroupName, 'Subtype', this.props.panel, this._layerLookup(js.layerId)) }}> 218 | { this.toggleActiveATList(ag.assetGroupName) }}>{(this.state.expandAT[ag.assetGroupName]) ? : } 219 | {ag.assetGroupName} 220 | 221 | {atTable} 222 | 223 | 224 | 225 | ) 226 | } 227 | }) 228 | }) 229 | }) 230 | } 231 | const tableObj = 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | {arrList} 240 | 241 |
LayerAsset Group
242 | return tableObj 243 | } 244 | 245 | _createAssetTypeTable =(atList: any, ag: string, layerName: string) => { 246 | const arrList = [] 247 | let tableObj = null 248 | atList.forEach((at: any, i: number) => { 249 | if (at.categories.indexOf(this.state.nodeData.name) > -1) { 250 | arrList.push( 251 | 252 | { this.props.callbackLinkage(at.assetTypeName, 'Assettype', this.props.panel, layerName, ag) }}> {at.assetTypeName} 253 | 254 | ) 255 | } 256 | }) 257 | if (arrList.length > 0) { 258 | tableObj = 259 | 260 | 261 | 262 | 263 | 264 | 265 | {arrList} 266 | 267 |
Asset Type
268 | } 269 | return tableObj 270 | } 271 | 272 | //*** SUPPORT FUNCTIONS *****/ 273 | _findUN =() => { 274 | let dn = null 275 | this.props.dataElements.forEach((de: any) => { 276 | if (de?.dataElement) { 277 | if (de.dataElement?.domainNetworks) { 278 | dn = de.dataElement.domainNetworks 279 | } 280 | } 281 | }) 282 | return dn 283 | } 284 | 285 | _layerLookup = (param: any) => { 286 | let layerName = param 287 | const filtered = this.props.dataElements.filter((de: any) => { 288 | return de.layerId === param 289 | }) 290 | if (filtered.length > 0) { 291 | layerName = filtered[0].dataElement.aliasName 292 | } 293 | return layerName 294 | } 295 | } 296 | -------------------------------------------------------------------------------- /service-explorer/src/runtime/DomainNetworksCard.tsx: -------------------------------------------------------------------------------- 1 | /** @jsx jsx */ 2 | import { React, jsx } from 'jimu-core' 3 | import { Icon, Table } from 'jimu-ui' 4 | import { TabContent, TabPane } from 'reactstrap' 5 | import CardHeader from './_header' 6 | import './css/custom.css' 7 | const linkIcon = require('./assets/launch.svg') 8 | 9 | interface IProps { 10 | data: any 11 | requestURL: string 12 | key: any 13 | panel: number 14 | callbackClose: any 15 | callbackSave: any 16 | callbackLinkage: any 17 | callbackGetPanels: any 18 | callbackReorderCards: any 19 | callbackActiveCards: any 20 | callbackGetFavorites: any 21 | callbackMove: any 22 | } 23 | 24 | interface IState { 25 | nodeData: any 26 | activeTab: string 27 | minimizedDetails: boolean 28 | } 29 | 30 | export default class DomainNetworksCard extends React.Component { 31 | constructor (props: IProps) { 32 | super(props) 33 | 34 | this.state = { 35 | nodeData: this.props.data.data, 36 | activeTab: 'Properties', 37 | minimizedDetails: false 38 | } 39 | } 40 | 41 | componentWillMount () { 42 | } 43 | 44 | componentDidMount () { 45 | //this._processData(); 46 | } 47 | 48 | componentWillReceiveProps () { 49 | //this.setState({ state: this.state }) 50 | } 51 | 52 | componentDidUpdate () { 53 | } 54 | 55 | render () { 56 | return ( 57 |
58 | 70 | { 71 | (this.state.minimizedDetails) 72 | ? '' 73 | : 74 | 75 |
76 |
{this.buildCrumb()}{this.props.data.type}
77 |
78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | {this._createList()} 87 | 88 |
NameTiers
89 |
90 |
91 |
92 |
93 |
94 | } 95 |
) 96 | } 97 | 98 | //**** breadCrumb */ 99 | buildCrumb =() => { 100 | const list = [] 101 | this.props.data.crumb.forEach((c: any, i: number) => { 102 | list.push( { 103 | this.props.callbackLinkage(c.value, c.type, this.props.panel) 104 | this.headerCallClose() 105 | }} style={{ cursor: 'pointer' }}>{c.value + ' > '}) 106 | }) 107 | return (list) 108 | } 109 | 110 | //****** Header Support functions 111 | //******************************************** 112 | headerToggleTabs =(tab: string) => { 113 | if (this.state.activeTab !== tab) { 114 | this.setState({ 115 | activeTab: tab 116 | }) 117 | } 118 | switch (tab) { 119 | case 'Statistics': { 120 | break 121 | } 122 | default: { 123 | break 124 | } 125 | } 126 | } 127 | 128 | headerCallMove =(direction: string) => { 129 | this.props.callbackMove(this.props.data, this.props.data.type, this.props.panel, direction) 130 | } 131 | 132 | headerCallReorder =(direction: string) => { 133 | this.props.callbackReorderCards(this.props.data, this.props.panel, direction) 134 | } 135 | 136 | headerCallClose =() => { 137 | this.props.callbackClose(this.props.data, this.props.panel) 138 | } 139 | 140 | headerCallFavorite =() => { 141 | return new Promise((resolve, reject) => { 142 | this.props.callbackSave(this.props.data).then(resolve(true)) 143 | }) 144 | } 145 | 146 | headerSearchFavorites =() => { 147 | let isFavorite = false 148 | const list = this.props.callbackGetFavorites() 149 | isFavorite = list.some((li: any) => { 150 | return li.props.data.id === this.props.data.id 151 | }) 152 | return isFavorite 153 | } 154 | 155 | headerActiveCardLocation =() => { 156 | let currPos = -1 157 | const list = this.props.callbackActiveCards() 158 | list[this.props.panel].forEach((mac: any, i: number) => { 159 | if (mac.props.data.id === this.props.data.id) { 160 | currPos = i 161 | } 162 | }) 163 | return currPos 164 | } 165 | 166 | headerCallMinimize =() => { 167 | let currState = this.state.minimizedDetails 168 | if (currState) { 169 | currState = false 170 | this.setState({ minimizedDetails: currState }) 171 | } else { 172 | currState = true 173 | this.setState({ minimizedDetails: currState }) 174 | } 175 | return currState 176 | } 177 | 178 | //****** UI components and UI Interaction 179 | //******************************************** 180 | _createList = () => { 181 | const arrList = [] 182 | this.props.data.data.forEach((ar: any, i: number) => { 183 | arrList.push( 184 | 185 | 186 |
{ this.props.callbackLinkage(ar.domainNetworkName, 'Domain Network', this.props.panel) }} style={{ display: 'inline-block', verticalAlign: 'top', paddingRight: 5, cursor: 'pointer' }}> {ar.domainNetworkName}
187 | 188 | {ar.tiers.length} 189 | 190 | ) 191 | }) 192 | return arrList 193 | } 194 | 195 | //****** helper functions and request functions 196 | //******************************************** 197 | } 198 | -------------------------------------------------------------------------------- /service-explorer/src/runtime/DomainsCard.tsx: -------------------------------------------------------------------------------- 1 | /** @jsx jsx */ 2 | import { React, jsx } from 'jimu-core' 3 | import { Icon, Table } from 'jimu-ui' 4 | import { TabContent, TabPane } from 'reactstrap' 5 | import CardHeader from './_header' 6 | import './css/custom.css' 7 | const linkIcon = require('./assets/launch.svg') 8 | 9 | interface IProps { 10 | data: any 11 | requestURL: string 12 | key: any 13 | panel: number 14 | callbackClose: any 15 | callbackSave: any 16 | callbackLinkage: any 17 | callbackGetPanels: any 18 | callbackReorderCards: any 19 | callbackActiveCards: any 20 | callbackGetFavorites: any 21 | callbackMove: any 22 | } 23 | 24 | interface IState { 25 | nodeData: any 26 | activeTab: string 27 | minimizedDetails: boolean 28 | } 29 | 30 | export default class DomainsCard extends React.Component { 31 | constructor (props: IProps) { 32 | super(props) 33 | 34 | this.state = { 35 | nodeData: this.props.data.data, 36 | activeTab: 'Properties', 37 | minimizedDetails: false 38 | } 39 | } 40 | 41 | componentWillMount () { 42 | console.log(this.props.data) 43 | } 44 | 45 | componentDidMount () { 46 | //this._processData(); 47 | } 48 | 49 | render () { 50 | return ( 51 |
52 | 64 | { 65 | (this.state.minimizedDetails) 66 | ? '' 67 | : 68 | 69 |
70 |
{this.buildCrumb()}{this.props.data.type}
71 |
72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | {this._createDomainList()} 82 | 83 |
NameDescriptionType
84 |
85 |
86 |
87 |
88 |
89 | } 90 |
) 91 | } 92 | 93 | //**** breadCrumb */ 94 | buildCrumb =() => { 95 | const list = [] 96 | this.props.data.crumb.forEach((c: any, i: number) => { 97 | list.push( { 98 | this.props.callbackLinkage(c.value, c.type, this.props.panel) 99 | this.headerCallClose() 100 | }} style={{ cursor: 'pointer' }}>{c.value + ' > '}) 101 | }) 102 | return (list) 103 | } 104 | 105 | //****** Header Support functions 106 | //******************************************** 107 | headerToggleTabs =(tab: string) => { 108 | if (this.state.activeTab !== tab) { 109 | this.setState({ 110 | activeTab: tab 111 | }) 112 | } 113 | switch (tab) { 114 | case 'Statistics': { 115 | break 116 | } 117 | default: { 118 | break 119 | } 120 | } 121 | } 122 | 123 | headerCallMove =(direction: string) => { 124 | this.props.callbackMove(this.props.data, this.props.data.type, this.props.panel, direction) 125 | } 126 | 127 | headerCallReorder =(direction: string) => { 128 | this.props.callbackReorderCards(this.props.data, this.props.panel, direction) 129 | } 130 | 131 | headerCallClose =() => { 132 | this.props.callbackClose(this.props.data, this.props.panel) 133 | } 134 | 135 | headerCallFavorite =() => { 136 | return new Promise((resolve, reject) => { 137 | this.props.callbackSave(this.props.data).then(resolve(true)) 138 | }) 139 | } 140 | 141 | headerSearchFavorites =() => { 142 | let isFavorite = false 143 | const list = this.props.callbackGetFavorites() 144 | isFavorite = list.some((li: any) => { 145 | return li.props.data.id === this.props.data.id 146 | }) 147 | return isFavorite 148 | } 149 | 150 | headerActiveCardLocation =() => { 151 | let currPos = -1 152 | const list = this.props.callbackActiveCards() 153 | list[this.props.panel].forEach((mac: any, i: number) => { 154 | if (mac.props.data.id === this.props.data.id) { 155 | currPos = i 156 | } 157 | }) 158 | return currPos 159 | } 160 | 161 | headerCallMinimize =() => { 162 | let currState = this.state.minimizedDetails 163 | if (currState) { 164 | currState = false 165 | this.setState({ minimizedDetails: currState }) 166 | } else { 167 | currState = true 168 | this.setState({ minimizedDetails: currState }) 169 | } 170 | return currState 171 | } 172 | 173 | //****** UI components and UI Interaction 174 | //******************************************** 175 | _createDomainList = () => { 176 | const arrList = [] 177 | this.props.data.data.forEach((f: any, i: number) => { 178 | arrList.push( 179 | 180 | 181 |
{ this.props.callbackLinkage(f.name, 'Domain', this.props.panel) }} style={{ display: 'inline-block', verticalAlign: 'top', paddingRight: 5, wordWrap: 'break-word', whiteSpace: 'normal', cursor: 'pointer' }}> {f.name}
182 | 183 | {f.description} 184 | {f.type} 185 | 186 | ) 187 | }) 188 | return arrList 189 | } 190 | //****** helper functions and request functions 191 | //******************************************** 192 | } 193 | -------------------------------------------------------------------------------- /service-explorer/src/runtime/FeatureServiceCard.tsx: -------------------------------------------------------------------------------- 1 | /** @jsx jsx */ 2 | import { React, jsx } from 'jimu-core' 3 | import { Icon, Collapse, Table } from 'jimu-ui' 4 | import { TabContent, TabPane } from 'reactstrap' 5 | import CardHeader from './_header' 6 | import './css/custom.css' 7 | const linkIcon = require('./assets/launch.svg') 8 | const rightArrowIcon = require('jimu-ui/lib/icons/arrow-right.svg') 9 | const downArrowIcon = require('jimu-ui/lib/icons/arrow-down.svg') 10 | 11 | interface IProps { 12 | data: any 13 | requestURL: string 14 | panel: number 15 | callbackClose: any 16 | callbackSave: any 17 | callbackLinkage: any 18 | callbackGetPanels: any 19 | callbackReorderCards: any 20 | callbackActiveCards: any 21 | callbackGetFavorites: any 22 | callbackMove: any 23 | } 24 | 25 | interface IState { 26 | nodeData: any 27 | activeTab: string 28 | expandLayers: boolean 29 | expandTables: boolean 30 | minimizedDetails: boolean 31 | } 32 | 33 | export default class FeatureServiceCard extends React.Component { 34 | constructor (props: IProps) { 35 | super(props) 36 | 37 | this.state = { 38 | nodeData: this.props.data.data, 39 | activeTab: 'Properties', 40 | expandLayers: false, 41 | expandTables: false, 42 | minimizedDetails: false 43 | } 44 | } 45 | 46 | componentWillMount () {} 47 | 48 | componentDidMount () { 49 | } 50 | 51 | render () { 52 | const title = (this.state.nodeData.documentInfo) ? this.state.nodeData.documentInfo.Title : this.props.data.text 53 | const subject = (this.state.nodeData.documentInfo) ? this.state.nodeData.documentInfo.Subject : this.state.nodeData.description 54 | const cleanId = this.props.data.id.replace(/./g, '_') 55 | 56 | return ( 57 |
58 | 70 | { 71 | (this.state.minimizedDetails) 72 | ? '' 73 | : 74 | 75 |
76 |
Title: {title}
77 | {(this.state.nodeData.documentInfo) &&
Subject: {this._removeTags(this._unescapeHTML(subject))}
} 78 | {(this.state.nodeData.documentInfo) &&
Description: {this._removeTags(this._unescapeHTML(this.state.nodeData.serviceDescription))}
} 79 |
Version: {this.state.nodeData.currentVersion}
80 |
{ this.toggleLayers() }}>{(this.state.expandLayers) ? : } Layers
81 | 82 |
83 | {this._createLayersList()} 84 |
85 |
86 | {(this.state.nodeData.tables.length > 0) 87 | ?
{ this.toggleTables() }}>{(this.state.expandTables) ? : } Tables
88 | : ''} 89 | {(this.state.nodeData.tables.length > 0) 90 | ? 91 |
92 | {this._createTablesList()} 93 |
94 |
95 | : ''} 96 |
97 |
98 |
99 |
100 | } 101 |
) 102 | } 103 | 104 | //**** breadCrumb */ 105 | buildCrumb =() => { 106 | const list = [] 107 | this.props.data.crumb.forEach((c: any, i: number) => { 108 | list.push( { 109 | this.props.callbackLinkage(c.value, c.type, this.props.panel, this.props.data.parent) 110 | this.headerCallClose() 111 | }} style={{ cursor: 'pointer' }}>{c.value + ' > '}) 112 | }) 113 | return (list) 114 | } 115 | 116 | //****** Header Support functions 117 | //******************************************** 118 | headerToggleTabs =(tab: string) => { 119 | if (this.state.activeTab !== tab) { 120 | this.setState({ 121 | activeTab: tab 122 | }) 123 | } 124 | switch (tab) { 125 | case 'Statistics': { 126 | break 127 | } 128 | default: { 129 | break 130 | } 131 | } 132 | } 133 | 134 | headerCallMove =(direction: string) => { 135 | this.props.callbackMove(this.props.data, this.props.data.type, this.props.panel, direction) 136 | } 137 | 138 | headerCallReorder =(direction: string) => { 139 | this.props.callbackReorderCards(this.props.data, this.props.panel, direction) 140 | } 141 | 142 | headerCallClose =() => { 143 | this.props.callbackClose(this.props.data, this.props.panel) 144 | } 145 | 146 | headerCallFavorite =() => { 147 | return new Promise((resolve, reject) => { 148 | this.props.callbackSave(this.props.data).then(resolve(true)) 149 | }) 150 | } 151 | 152 | headerSearchFavorites =() => { 153 | let isFavorite = false 154 | const list = this.props.callbackGetFavorites() 155 | isFavorite = list.some((li: any) => { 156 | return li.props.data.id === this.props.data.id 157 | }) 158 | return isFavorite 159 | } 160 | 161 | headerActiveCardLocation =() => { 162 | let currPos = -1 163 | const list = this.props.callbackActiveCards() 164 | list[this.props.panel].forEach((mac: any, i: number) => { 165 | if (mac.props.data.id === this.props.data.id) { 166 | currPos = i 167 | } 168 | }) 169 | return currPos 170 | } 171 | 172 | headerCallMinimize =() => { 173 | let currState = this.state.minimizedDetails 174 | if (currState) { 175 | currState = false 176 | this.setState({ minimizedDetails: currState }) 177 | } else { 178 | currState = true 179 | this.setState({ minimizedDetails: currState }) 180 | } 181 | return currState 182 | } 183 | 184 | //****** UI components and UI Interaction 185 | //******************************************** 186 | toggleLayers =() => { 187 | if (this.state.expandLayers) { 188 | this.setState({ expandLayers: false }) 189 | } else { 190 | this.setState({ expandLayers: true }) 191 | } 192 | } 193 | 194 | toggleTables =() => { 195 | if (this.state.expandTables) { 196 | this.setState({ expandTables: false }) 197 | } else { 198 | this.setState({ expandTables: true }) 199 | } 200 | } 201 | 202 | _createLayersList = () => { 203 | const arrList = [] 204 | this.state.nodeData.layers.forEach((lyr: any, i: number) => { 205 | if (lyr.name.indexOf('Errors') < 0 && lyr.name !== 'Dirty Areas') { 206 | let type = 'Layer' 207 | if (lyr.type === 'Utility Network Layer') { 208 | type = 'Utility Network' 209 | } 210 | arrList.push( 211 | 212 | 213 |
{ this.props.callbackLinkage(lyr.name, type, this.props.panel) }} style={{ display: 'inline-block', verticalAlign: 'top', paddingRight: 5, cursor: 'pointer' }}> {lyr.name}
214 | 215 | 216 | ) 217 | } 218 | }) 219 | const tableObj = 220 | 221 | 222 | 223 | 224 | 225 | 226 | {arrList} 227 | 228 |
Name
229 | return tableObj 230 | } 231 | 232 | _createTablesList = () => { 233 | const arrList = [] 234 | this.state.nodeData.tables.forEach((tbl: any, i: number) => { 235 | arrList.push( 236 | 237 | 238 |
{ this.props.callbackLinkage(tbl.name, 'Table', this.props.panel) }} style={{ display: 'inline-block', verticalAlign: 'top', paddingRight: 5, cursor: 'pointer' }}> {tbl.name}
239 | 240 | 241 | ) 242 | }) 243 | const tableObj = 244 | 245 | 246 | 247 | 248 | 249 | 250 | {arrList} 251 | 252 |
Name
253 | return tableObj 254 | } 255 | 256 | _createNetworkAttributeTable = () => { 257 | const arrList = [] 258 | this.props.data.data.dataElement.networkAttributes.forEach((na: any, i: number) => { 259 | arrList.push( 260 | 261 | 262 |
{ this.props.callbackLinkage(na.name, 'Network Attribute', this.props.panel) }} style={{ display: 'inline-block', verticalAlign: 'top', paddingRight: 5, cursor: 'pointer' }}> {na.name}
263 | 264 | 265 | ) 266 | }) 267 | const tableObj = 268 | 269 | 270 | 271 | 272 | 273 | 274 | {arrList} 275 | 276 |
Name
277 | return tableObj 278 | } 279 | 280 | _createTerminalsTable = () => { 281 | const arrList = [] 282 | this.props.data.data.dataElement.terminalConfigurations.forEach((tc: any, i: number) => { 283 | arrList.push( 284 | 285 | 286 |
{ this.props.callbackLinkage(tc.terminalConfigurationName, 'Terminal Configuration', this.props.panel) }} style={{ display: 'inline-block', verticalAlign: 'top', paddingRight: 5, cursor: 'pointer' }}> {tc.terminalConfigurationName}
287 | 288 | {tc.terminals.length} 289 | 290 | ) 291 | }) 292 | const tableObj = 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | {arrList} 301 | 302 |
NameNo of Terminals
303 | return tableObj 304 | } 305 | 306 | //****** helper functions and request functions 307 | //******************************************** 308 | _removeTags (str: string) { 309 | if ((str === null) || (str === '')) { return str } else { str = str.toString() } 310 | return str.replace(/(<([^>]+)>)/ig, '') 311 | } 312 | 313 | _unescapeHTML =(html: string) => { 314 | const el = document.createElement('div') 315 | return html.replace(/\&#?[0-9a-z]+;/gi, function (enc) { 316 | el.innerHTML = enc 317 | return el.innerText 318 | }) 319 | } 320 | } 321 | -------------------------------------------------------------------------------- /service-explorer/src/runtime/IndexCard.tsx: -------------------------------------------------------------------------------- 1 | /** @jsx jsx */ 2 | import { React, jsx } from 'jimu-core' 3 | import { Collapse, Icon, Table } from 'jimu-ui' 4 | import { TabContent, TabPane } from 'reactstrap' 5 | import CardHeader from './_header' 6 | import './css/custom.css' 7 | import EsriLookup from './_constants' 8 | const rightArrowIcon = require('jimu-ui/lib/icons/arrow-right.svg') 9 | const downArrowIcon = require('jimu-ui/lib/icons/arrow-down.svg') 10 | const linkIcon = require('./assets/launch.svg') 11 | 12 | interface IProps { 13 | data: any 14 | requestURL: string 15 | key: any 16 | panel: number 17 | callbackClose: any 18 | callbackSave: any 19 | callbackLinkage: any 20 | callbackGetPanels: any 21 | callbackReorderCards: any 22 | callbackActiveCards: any 23 | callbackGetFavorites: any 24 | callbackMove: any 25 | } 26 | 27 | interface IState { 28 | nodeData: any 29 | siteStats: any 30 | statsOutput: any 31 | activeTab: string 32 | domainHolder: any 33 | fields: any 34 | fieldNameHolder: any 35 | fieldHolder: any 36 | expandFields: boolean 37 | expandCAV: boolean 38 | expandAR: boolean 39 | minimizedDetails: boolean 40 | esriValueList: any 41 | } 42 | 43 | export default class IndexCard extends React.Component { 44 | constructor (props: IProps) { 45 | super(props) 46 | 47 | this.state = { 48 | nodeData: this.props.data.data, 49 | siteStats: {}, 50 | statsOutput: [], 51 | activeTab: 'Properties', 52 | domainHolder: {}, 53 | fields: [], 54 | fieldNameHolder: {}, 55 | fieldHolder: [], 56 | expandFields: false, 57 | expandCAV: false, 58 | expandAR: false, 59 | minimizedDetails: false, 60 | esriValueList: new EsriLookup() 61 | } 62 | } 63 | 64 | componentWillMount () { 65 | const fieldList = {} 66 | let fields = [] 67 | if (this.props.data.data.fields?.fieldArray) { 68 | this.props.data.data.fields.fieldArray.forEach((fd: any) => { 69 | fieldList[fd.name] = false 70 | }) 71 | fields = this.props.data.data.fields.fieldArray 72 | } else { 73 | fields = this.props.data.data.fields.split(',') 74 | } 75 | this.setState({ fieldHolder: fieldList, fields: fields }) 76 | } 77 | 78 | componentDidMount () { 79 | //this._processData(); 80 | //this._requestObject() 81 | } 82 | 83 | render () { 84 | return ( 85 |
86 | 98 | { 99 | (this.state.minimizedDetails) 100 | ? '' 101 | : 102 | 103 |
104 |
{this.buildCrumb()}Properties
105 |
Name: {this.props.data.data.name}
106 |
Ascending: {(this.props.data.data?.isAscending) ? (this.props.data.data.isAscending) ? 'True' : 'False' : 'False'}
107 |
Unique: {(this.props.data.data?.isUnique) ? (this.props.data.data.isUnique) ? 'True' : 'False' : 'False'}
108 |
{ this.toggleExpandFieldBlock() }}>{(this.state.expandFields) ? : } Fields
109 | 110 |
111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | {this._createFieldList()} 120 | 121 |
Field NameAlias
122 |
123 |
124 |
125 |
126 |
127 |
128 | } 129 |
) 130 | } 131 | 132 | //**** breadCrumb */ 133 | buildCrumb =() => { 134 | const list = [] 135 | this.props.data.crumb.forEach((c: any, i: number) => { 136 | list.push( { 137 | this.props.callbackLinkage(c.value, c.type, this.props.panel, this.props.data.parent) 138 | this.headerCallClose() 139 | }} style={{ cursor: 'pointer' }}>{c.value + ' > '}) 140 | }) 141 | return (list) 142 | } 143 | 144 | //****** Header Support functions 145 | //******************************************** 146 | headerToggleTabs =(tab: string) => { 147 | if (this.state.activeTab !== tab) { 148 | this.setState({ 149 | activeTab: tab 150 | }) 151 | } 152 | switch (tab) { 153 | case 'Statistics': { 154 | break 155 | } 156 | default: { 157 | break 158 | } 159 | } 160 | } 161 | 162 | headerCallMove =(direction: string) => { 163 | this.props.callbackMove(this.props.data, this.props.data.type, this.props.panel, direction) 164 | } 165 | 166 | headerCallReorder =(direction: string) => { 167 | this.props.callbackReorderCards(this.props.data, this.props.panel, direction) 168 | } 169 | 170 | headerCallClose =() => { 171 | this.props.callbackClose(this.props.data, this.props.panel) 172 | } 173 | 174 | headerCallFavorite =() => { 175 | return new Promise((resolve, reject) => { 176 | this.props.callbackSave(this.props.data).then(resolve(true)) 177 | }) 178 | } 179 | 180 | headerSearchFavorites =() => { 181 | let isFavorite = false 182 | const list = this.props.callbackGetFavorites() 183 | isFavorite = list.some((li: any) => { 184 | return li.props.data.id === this.props.data.id 185 | }) 186 | return isFavorite 187 | } 188 | 189 | headerActiveCardLocation =() => { 190 | let currPos = -1 191 | const list = this.props.callbackActiveCards() 192 | list[this.props.panel].forEach((mac: any, i: number) => { 193 | if (mac.props.data.id === this.props.data.id) { 194 | currPos = i 195 | } 196 | }) 197 | return currPos 198 | } 199 | 200 | headerCallMinimize =() => { 201 | let currState = this.state.minimizedDetails 202 | if (currState) { 203 | currState = false 204 | this.setState({ minimizedDetails: currState }) 205 | } else { 206 | currState = true 207 | this.setState({ minimizedDetails: currState }) 208 | } 209 | return currState 210 | } 211 | //****** UI components and UI Interaction 212 | //******************************************** 213 | 214 | toggleExpandFieldBlock =() => { 215 | if (this.state.expandFields) { 216 | this.setState({ expandFields: false }) 217 | } else { 218 | this.setState({ expandFields: true }) 219 | } 220 | } 221 | 222 | toggleFields =(field: string) => { 223 | if (this.state.fieldHolder?.[field]) { 224 | const newFieldState = { ...this.state.fieldHolder } 225 | if (newFieldState[field]) { 226 | newFieldState[field] = false 227 | } else { 228 | newFieldState[field] = true 229 | } 230 | this.setState({ fieldHolder: newFieldState }) 231 | } 232 | } 233 | 234 | _createFieldList =() => { 235 | const arrList = [] 236 | const usedFields = [] 237 | this.state.fields.forEach((fi: any, z: number) => { 238 | if (!usedFields.includes(fi.name)) { 239 | let fieldDetailsTable = null 240 | if (fi.constructor === Object) { 241 | fieldDetailsTable = this._createFieldsExpand(fi) 242 | } 243 | const alias = (fi?.aliasName) ? fi.aliasName : fi 244 | const fieldName =
{(fieldDetailsTable !== null) ? (this.state.fieldHolder[fi.name]) ? : : ''} {fi?.name ? fi.name : fi}
245 | arrList.push( 246 | 247 |
{ this.props.callbackLinkage(fi.name, 'Field', this.props.panel, this.props.data.parent) }} style={{ display: 'inline-block', verticalAlign: 'top', paddingRight: 5, cursor: 'pointer' }}>
248 | { 249 | (fieldDetailsTable !== null) 250 | ?
{ 251 | this.toggleFields(fi.name) 252 | }}>{fieldName}
253 | :
{fieldName}
254 | } 255 | 256 | {(fieldDetailsTable !== null) ? fieldDetailsTable :
} 257 |
258 | 259 |
{alias}
260 | ) 261 | } 262 | }) 263 | return arrList 264 | } 265 | 266 | _createFieldsExpand =(fName: any) => { 267 | const field = fName 268 | let fieldTable: any = null 269 | const vals = [] 270 | for (const keyNode in field) { 271 | if (keyNode !== 'geometryDef') { 272 | let v = field[keyNode] 273 | if (v === true) { v = 'True' } 274 | if (v === false) { v = 'False' } 275 | vals.push( 276 | 277 | {keyNode} 278 | {v} 279 | 280 | ) 281 | } 282 | } 283 | fieldTable = 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | {vals} 292 | 293 |
KeyValue
294 | return fieldTable 295 | } 296 | 297 | //****** helper functions and request functions 298 | //******************************************** 299 | _compare =(prop: any) => { 300 | return function (a: any, b: any) { 301 | let comparison = 0 302 | if (a[prop] > b[prop]) { 303 | comparison = 1 304 | } else if (a[prop] < b[prop]) { 305 | comparison = -1 306 | } 307 | return comparison 308 | } 309 | } 310 | } 311 | -------------------------------------------------------------------------------- /service-explorer/src/runtime/IndexesCard.tsx: -------------------------------------------------------------------------------- 1 | /** @jsx jsx */ 2 | import { React, jsx } from 'jimu-core' 3 | import { Icon, Table } from 'jimu-ui' 4 | import { TabContent, TabPane } from 'reactstrap' 5 | import CardHeader from './_header' 6 | import EsriLookup from './_constants' 7 | import './css/custom.css' 8 | const linkIcon = require('./assets/launch.svg') 9 | 10 | interface IProps { 11 | data: any 12 | requestURL: string 13 | key: any 14 | panel: number 15 | callbackClose: any 16 | callbackSave: any 17 | callbackLinkage: any 18 | callbackGetPanels: any 19 | callbackReorderCards: any 20 | callbackActiveCards: any 21 | callbackGetFavorites: any 22 | callbackMove: any 23 | } 24 | 25 | interface IState { 26 | nodeData: any 27 | activeTab: string 28 | minimizedDetails: boolean 29 | esriValueList: any 30 | } 31 | 32 | export default class IndexesCard extends React.Component { 33 | constructor (props: IProps) { 34 | super(props) 35 | 36 | this.state = { 37 | nodeData: this.props.data.data, 38 | activeTab: 'Properties', 39 | minimizedDetails: false, 40 | esriValueList: new EsriLookup() 41 | } 42 | } 43 | 44 | componentWillMount () {} 45 | 46 | componentDidMount () {} 47 | 48 | render () { 49 | return ( 50 |
51 | 63 | { 64 | (this.state.minimizedDetails) 65 | ? '' 66 | : 67 | 68 |
69 |
{this.buildCrumb()}{this.props.data.type}
70 |
71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | {this._createFList()} 82 | 83 |
NameUniqueAscendingFields
84 |
85 |
86 |
87 |
88 |
89 | } 90 |
) 91 | } 92 | 93 | //**** breadCrumb */ 94 | buildCrumb =() => { 95 | const list = [] 96 | this.props.data.crumb.forEach((c: any, i: number) => { 97 | list.push( { 98 | this.props.callbackLinkage(c.value, c.type, this.props.panel) 99 | this.headerCallClose() 100 | }} style={{ cursor: 'pointer' }}>{c.value + ' > '}) 101 | }) 102 | return (list) 103 | } 104 | 105 | //****** Header Support functions 106 | //******************************************** 107 | headerToggleTabs =(tab: string) => { 108 | if (this.state.activeTab !== tab) { 109 | this.setState({ 110 | activeTab: tab 111 | }) 112 | } 113 | switch (tab) { 114 | case 'Statistics': { 115 | break 116 | } 117 | default: { 118 | break 119 | } 120 | } 121 | } 122 | 123 | headerCallMove =(direction: string) => { 124 | this.props.callbackMove(this.props.data, this.props.data.type, this.props.panel, direction) 125 | } 126 | 127 | headerCallReorder =(direction: string) => { 128 | this.props.callbackReorderCards(this.props.data, this.props.panel, direction) 129 | } 130 | 131 | headerCallClose =() => { 132 | this.props.callbackClose(this.props.data, this.props.panel) 133 | } 134 | 135 | headerCallFavorite =() => { 136 | return new Promise((resolve, reject) => { 137 | this.props.callbackSave(this.props.data).then(resolve(true)) 138 | }) 139 | } 140 | 141 | headerSearchFavorites =() => { 142 | let isFavorite = false 143 | const list = this.props.callbackGetFavorites() 144 | isFavorite = list.some((li: any) => { 145 | return li.props.data.id === this.props.data.id 146 | }) 147 | return isFavorite 148 | } 149 | 150 | headerActiveCardLocation =() => { 151 | let currPos = -1 152 | const list = this.props.callbackActiveCards() 153 | list[this.props.panel].forEach((mac: any, i: number) => { 154 | if (mac.props.data.id === this.props.data.id) { 155 | currPos = i 156 | } 157 | }) 158 | return currPos 159 | } 160 | 161 | headerCallMinimize =() => { 162 | let currState = this.state.minimizedDetails 163 | if (currState) { 164 | currState = false 165 | this.setState({ minimizedDetails: currState }) 166 | } else { 167 | currState = true 168 | this.setState({ minimizedDetails: currState }) 169 | } 170 | return currState 171 | } 172 | 173 | //****** UI components and UI Interaction 174 | //******************************************** 175 | _createFList = () => { 176 | const arrList = [] 177 | this.props.data.data.forEach((f: any, i: number) => { 178 | const fieldList = [] 179 | let arrFields 180 | if (f.fields?.fieldArray) { 181 | arrFields = f.fields.fieldArray 182 | } else { 183 | arrFields = f.fields.split(',') 184 | } 185 | arrFields.forEach((a: any, z: number) => { 186 | const value = (a?.name) ? a.name : a 187 | fieldList.push( 188 |
{ this.props.callbackLinkage(value, 'Field', this.props.panel, this.props.data.parent) }} style={{ verticalAlign: 'top', paddingRight: 5, cursor: 'pointer' }}> {value}
189 | ) 190 | }) 191 | arrList.push( 192 | 193 | 194 |
{ this.props.callbackLinkage(f.name, 'Index', this.props.panel, this.props.data.parent) }} style={{ display: 'inline-block', verticalAlign: 'top', paddingRight: 5, cursor: 'pointer' }}> {f.name}
195 | 196 | {(f.isAscending) ? 'True' : 'False'} 197 | {(f.isUnique) ? 'True' : 'False'} 198 | {fieldList} 199 | 200 | ) 201 | }) 202 | return arrList 203 | } 204 | //****** helper functions and request functions 205 | //******************************************** 206 | } 207 | -------------------------------------------------------------------------------- /service-explorer/src/runtime/LayersCard.tsx: -------------------------------------------------------------------------------- 1 | /** @jsx jsx */ 2 | import { React, jsx } from 'jimu-core' 3 | import { Icon, Table } from 'jimu-ui' 4 | import { TabContent, TabPane } from 'reactstrap' 5 | import CardHeader from './_header' 6 | import EsriLookup from './_constants' 7 | import './css/custom.css' 8 | const linkIcon = require('./assets/launch.svg') 9 | 10 | interface IProps { 11 | data: any 12 | requestURL: string 13 | key: any 14 | panel: number 15 | callbackClose: any 16 | callbackSave: any 17 | callbackLinkage: any 18 | callbackGetPanels: any 19 | callbackReorderCards: any 20 | callbackActiveCards: any 21 | callbackGetFavorites: any 22 | callbackMove: any 23 | } 24 | 25 | interface IState { 26 | nodeData: any 27 | activeTab: string 28 | minimizedDetails: boolean 29 | esriValueList: any 30 | } 31 | 32 | export default class LayersCard extends React.Component { 33 | constructor (props: IProps) { 34 | super(props) 35 | 36 | this.state = { 37 | nodeData: this.props.data.data, 38 | activeTab: 'Properties', 39 | minimizedDetails: false, 40 | esriValueList: new EsriLookup() 41 | } 42 | } 43 | 44 | componentWillMount () { 45 | } 46 | 47 | componentDidMount () { 48 | //this._processData(); 49 | } 50 | 51 | componentWillReceiveProps () { 52 | //this.setState({ state: this.state }) 53 | } 54 | 55 | componentDidUpdate () {} 56 | 57 | render () { 58 | return ( 59 |
60 | 72 | { 73 | (this.state.minimizedDetails) 74 | ? '' 75 | : 76 | 77 |
78 |
{this.buildCrumb()}{this.props.data.type}
79 |
80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | {this._createSTList()} 91 | 92 |
NameIDTypeGeometry
93 |
94 |
95 |
96 |
97 |
98 | } 99 |
) 100 | } 101 | 102 | //**** breadCrumb */ 103 | buildCrumb =() => { 104 | const list = [] 105 | this.props.data.crumb.forEach((c: any, i: number) => { 106 | list.push( { 107 | this.props.callbackLinkage(c.value, c.type, this.props.panel) 108 | this.headerCallClose() 109 | }} style={{ cursor: 'pointer' }}>{c.value + ' > '}) 110 | }) 111 | return (list) 112 | } 113 | 114 | //****** Header Support functions 115 | //******************************************** 116 | headerToggleTabs =(tab: string) => { 117 | if (this.state.activeTab !== tab) { 118 | this.setState({ 119 | activeTab: tab 120 | }) 121 | } 122 | switch (tab) { 123 | case 'Statistics': { 124 | break 125 | } 126 | default: { 127 | break 128 | } 129 | } 130 | } 131 | 132 | headerCallMove =(direction: string) => { 133 | this.props.callbackMove(this.props.data, this.props.data.type, this.props.panel, direction) 134 | } 135 | 136 | headerCallReorder =(direction: string) => { 137 | this.props.callbackReorderCards(this.props.data, this.props.panel, direction) 138 | } 139 | 140 | headerCallClose =() => { 141 | this.props.callbackClose(this.props.data, this.props.panel) 142 | } 143 | 144 | headerCallFavorite =() => { 145 | return new Promise((resolve, reject) => { 146 | this.props.callbackSave(this.props.data).then(resolve(true)) 147 | }) 148 | } 149 | 150 | headerSearchFavorites =() => { 151 | let isFavorite = false 152 | const list = this.props.callbackGetFavorites() 153 | isFavorite = list.some((li: any) => { 154 | return li.props.data.id === this.props.data.id 155 | }) 156 | return isFavorite 157 | } 158 | 159 | headerActiveCardLocation =() => { 160 | let currPos = -1 161 | const list = this.props.callbackActiveCards() 162 | list[this.props.panel].forEach((mac: any, i: number) => { 163 | if (mac.props.data.id === this.props.data.id) { 164 | currPos = i 165 | } 166 | }) 167 | return currPos 168 | } 169 | 170 | headerCallMinimize =() => { 171 | let currState = this.state.minimizedDetails 172 | if (currState) { 173 | currState = false 174 | this.setState({ minimizedDetails: currState }) 175 | } else { 176 | currState = true 177 | this.setState({ minimizedDetails: currState }) 178 | } 179 | return currState 180 | } 181 | 182 | //****** UI components and UI Interaction 183 | //******************************************** 184 | _createSTList = () => { 185 | const arrList = [] 186 | this.props.data.data.forEach((ar: any, i: number) => { 187 | if (ar.name.indexOf('Errors') === -1) { 188 | if (ar.name !== 'Dirty Areas') { 189 | let type = 'Layer' 190 | if (ar.type === 'Utility Network Layer') { 191 | type = 'Utility Network' 192 | } 193 | arrList.push( 194 | 195 | 196 |
{ this.props.callbackLinkage(ar.name, type, this.props.panel) }} style={{ display: 'inline-block', verticalAlign: 'top', paddingRight: 5, cursor: 'pointer' }}> {ar.name}
197 | 198 | {ar.id} 199 | {(ar?.type) ? ar.type : type} 200 | {(ar?.geometryType) ? this.state.esriValueList.lookupValue(ar.geometryType) : ''} 201 | 202 | ) 203 | } 204 | } 205 | }) 206 | return arrList 207 | } 208 | 209 | //****** helper functions and request functions 210 | //******************************************** 211 | } 212 | -------------------------------------------------------------------------------- /service-explorer/src/runtime/MinimizedCard.tsx: -------------------------------------------------------------------------------- 1 | /** @jsx jsx */ 2 | import { React, jsx } from 'jimu-core' 3 | import { Badge, Icon } from 'jimu-ui' 4 | import './css/custom.css' 5 | const RestoreIcon = require('jimu-ui/lib/icons/zoom-out-fixed.svg') 6 | const CloseIcon = require('jimu-ui/lib/icons/close.svg') 7 | 8 | interface IProps { 9 | data: any 10 | width: number 11 | height: number 12 | callbackRestore: any 13 | callbackDelete: any 14 | } 15 | 16 | interface IState { 17 | width: number 18 | height: number 19 | nodeData: any 20 | } 21 | 22 | export default class MinimizedCard extends React.Component { 23 | constructor (props: IProps) { 24 | super(props) 25 | 26 | this.state = { 27 | width: this.props.width, 28 | height: this.props.height, 29 | nodeData: this.props.data.data 30 | } 31 | } 32 | 33 | componentWillMount () { 34 | //test 35 | } 36 | 37 | componentDidMount () { 38 | //this._processData(); 39 | } 40 | 41 | render () { 42 | return ( 43 |
44 |
45 |
{this.props.data.text}
46 |
47 |
48 |
49 |
) 50 | } 51 | 52 | sendRestore =() => { 53 | this.props.callbackRestore(this.props.data) 54 | } 55 | 56 | sendDelete =() => { 57 | this.props.callbackDelete(this.props.data) 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /service-explorer/src/runtime/NetworkAttributeCard.tsx: -------------------------------------------------------------------------------- 1 | /** @jsx jsx */ 2 | import { React, jsx } from 'jimu-core' 3 | import { Icon, Collapse, Table } from 'jimu-ui' 4 | import { TabContent, TabPane } from 'reactstrap' 5 | import CardHeader from './_header' 6 | import EsriLookup from './_constants' 7 | import './css/custom.css' 8 | const linkIcon = require('./assets/launch.svg') 9 | const rightArrowIcon = require('jimu-ui/lib/icons/arrow-right.svg') 10 | const downArrowIcon = require('jimu-ui/lib/icons/arrow-down.svg') 11 | 12 | interface IProps { 13 | data: any 14 | dataElements: any 15 | domains: any 16 | requestURL: string 17 | panel: number 18 | callbackClose: any 19 | callbackSave: any 20 | callbackLinkage: any 21 | callbackGetPanels: any 22 | callbackReorderCards: any 23 | callbackActiveCards: any 24 | callbackGetFavorites: any 25 | callbackMove: any 26 | } 27 | 28 | interface IState { 29 | nodeData: any 30 | activeTab: string 31 | expandAssignment: boolean 32 | minimizedDetails: boolean 33 | esriValueList: any 34 | } 35 | 36 | export default class NetworkAttributeCard extends React.Component { 37 | constructor (props: IProps) { 38 | super(props) 39 | 40 | this.state = { 41 | nodeData: this.props.data.data, 42 | activeTab: 'Properties', 43 | expandAssignment: false, 44 | minimizedDetails: false, 45 | esriValueList: new EsriLookup() 46 | } 47 | } 48 | 49 | componentWillMount () { 50 | //console.log(this.state.nodeData) 51 | } 52 | 53 | componentDidMount () { 54 | //this._processData(); 55 | } 56 | 57 | render () { 58 | return ( 59 |
60 | 72 | { 73 | (this.state.minimizedDetails) 74 | ? '' 75 | : 76 | 77 |
78 |
{this.buildCrumb()}Properties
79 |
Name: {this.state.nodeData.name}
80 |
field Type: {this.state.esriValueList.lookupValue(this.state.nodeData.fieldType)}
81 |
Domain Name: {(this.state.nodeData.domainName !== '') ? { this.props.callbackLinkage(this.state.nodeData.domainName, 'Domain', this.props.panel) }}> {this.state.nodeData.domainName} : }
82 |
Network Attribute to Substitute: {this.state.esriValueList.lookupValue(this.state.nodeData.networkAttributeToSubstitute)}
83 |
Usage Type: {this.state.esriValueList.lookupValue(this.state.nodeData.usageType)}
84 |
This field can be empty: {(this.state.nodeData.isNullable) ? 'True' : 'False'}
85 |
BitSize: {this.state.nodeData.bitSize}
86 |
{ this.toggleAssignment() }}>{(this.state.expandAssignment) ? : } Assignment
87 | 88 |
89 | {(this.state.nodeData.assignments.length > 0) ? this._createAssignmentTable() : 'No assignments exist'} 90 |
91 |
92 | 93 |
94 |
95 |
96 |
97 | } 98 |
) 99 | } 100 | 101 | //**** breadCrumb */ 102 | buildCrumb =() => { 103 | const list = [] 104 | this.props.data.crumb.forEach((c: any, i: number) => { 105 | list.push( { 106 | this.props.callbackLinkage(c.value, c.type, this.props.panel, this.props.data.parent) 107 | this.headerCallClose() 108 | }} style={{ cursor: 'pointer' }}>{c.value + ' > '}) 109 | }) 110 | return (list) 111 | } 112 | 113 | //****** Header Support functions 114 | //******************************************** 115 | headerToggleTabs =(tab: string) => { 116 | if (this.state.activeTab !== tab) { 117 | this.setState({ 118 | activeTab: tab 119 | }) 120 | } 121 | switch (tab) { 122 | case 'Statistics': { 123 | break 124 | } 125 | default: { 126 | break 127 | } 128 | } 129 | } 130 | 131 | headerCallMove =(direction: string) => { 132 | this.props.callbackMove(this.props.data, this.props.data.type, this.props.panel, direction) 133 | } 134 | 135 | headerCallReorder =(direction: string) => { 136 | this.props.callbackReorderCards(this.props.data, this.props.panel, direction) 137 | } 138 | 139 | headerCallClose =() => { 140 | this.props.callbackClose(this.props.data, this.props.panel) 141 | } 142 | 143 | headerCallFavorite =() => { 144 | return new Promise((resolve, reject) => { 145 | this.props.callbackSave(this.props.data).then(resolve(true)) 146 | }) 147 | } 148 | 149 | headerSearchFavorites =() => { 150 | let isFavorite = false 151 | const list = this.props.callbackGetFavorites() 152 | isFavorite = list.some((li: any) => { 153 | return li.props.data.id === this.props.data.id 154 | }) 155 | return isFavorite 156 | } 157 | 158 | headerActiveCardLocation =() => { 159 | let currPos = -1 160 | const list = this.props.callbackActiveCards() 161 | list[this.props.panel].forEach((mac: any, i: number) => { 162 | if (mac.props.data.id === this.props.data.id) { 163 | currPos = i 164 | } 165 | }) 166 | return currPos 167 | } 168 | 169 | headerCallMinimize =() => { 170 | let currState = this.state.minimizedDetails 171 | if (currState) { 172 | currState = false 173 | this.setState({ minimizedDetails: currState }) 174 | } else { 175 | currState = true 176 | this.setState({ minimizedDetails: currState }) 177 | } 178 | return currState 179 | } 180 | 181 | //****** UI components and UI Interaction 182 | //******************************************** 183 | toggleAssignment =() => { 184 | if (this.state.expandAssignment) { 185 | this.setState({ expandAssignment: false }) 186 | } else { 187 | this.setState({ expandAssignment: true }) 188 | } 189 | } 190 | 191 | _createAssignmentTable =() => { 192 | const arrList = [] 193 | this.state.nodeData.assignments.forEach((as: any, i: number) => { 194 | arrList.push( 195 | 196 | { this.props.callbackLinkage(this._layerLookup(as.layerId), 'Layer', this.props.panel) }}> {this._layerLookup(as.layerId)} 197 | { this.props.callbackLinkage((as.evaluator.fieldName).toLowerCase(), 'Field', this.props.panel, this._layerLookup(as.layerId)) }}> {as.evaluator.fieldName} 198 | 199 | ) 200 | }) 201 | const tableObj = 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | {arrList} 210 | 211 |
LayerField
212 | return tableObj 213 | } 214 | 215 | //*** SUPPORT FUNCTIONS *****/ 216 | _layerLookup = (param: any) => { 217 | let layerName = param 218 | const filtered = this.props.dataElements.filter((de: any) => { 219 | return de.layerId === param 220 | }) 221 | if (filtered.length > 0) { 222 | layerName = filtered[0].dataElement.aliasName 223 | } 224 | return layerName 225 | } 226 | } 227 | -------------------------------------------------------------------------------- /service-explorer/src/runtime/NetworkAttributesCard.tsx: -------------------------------------------------------------------------------- 1 | /** @jsx jsx */ 2 | import { React, jsx } from 'jimu-core' 3 | import { Icon, Table } from 'jimu-ui' 4 | import { TabContent, TabPane } from 'reactstrap' 5 | import CardHeader from './_header' 6 | import './css/custom.css' 7 | const linkIcon = require('./assets/launch.svg') 8 | 9 | interface IProps { 10 | data: any 11 | requestURL: string 12 | key: any 13 | panel: number 14 | callbackClose: any 15 | callbackSave: any 16 | callbackLinkage: any 17 | callbackGetPanels: any 18 | callbackReorderCards: any 19 | callbackActiveCards: any 20 | callbackGetFavorites: any 21 | callbackMove: any 22 | } 23 | 24 | interface IState { 25 | nodeData: any 26 | activeTab: string 27 | minimizedDetails: boolean 28 | } 29 | 30 | export default class DomainNetworksCard extends React.Component { 31 | constructor (props: IProps) { 32 | super(props) 33 | 34 | this.state = { 35 | nodeData: this.props.data.data, 36 | activeTab: 'Properties', 37 | minimizedDetails: false 38 | } 39 | } 40 | 41 | componentWillMount () {} 42 | 43 | componentDidMount () { 44 | //this._processData(); 45 | } 46 | 47 | componentWillReceiveProps () { 48 | //this.setState({ state: this.state }) 49 | } 50 | 51 | componentDidUpdate () {} 52 | 53 | render () { 54 | return ( 55 |
56 | 68 | { 69 | (this.state.minimizedDetails) 70 | ? '' 71 | : 72 | 73 |
74 |
{this.buildCrumb()}{this.props.data.type}
75 |
76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | {this._createList()} 85 | 86 |
NameNo# of Assignments
87 |
88 |
89 |
90 |
91 |
92 | } 93 |
) 94 | } 95 | 96 | //**** breadCrumb */ 97 | buildCrumb =() => { 98 | const list = [] 99 | this.props.data.crumb.forEach((c: any, i: number) => { 100 | list.push( { 101 | this.props.callbackLinkage(c.value, c.type, this.props.panel) 102 | this.headerCallClose() 103 | }} style={{ cursor: 'pointer' }}>{c.value + ' > '}) 104 | }) 105 | return (list) 106 | } 107 | 108 | //****** Header Support functions 109 | //******************************************** 110 | headerToggleTabs =(tab: string) => { 111 | if (this.state.activeTab !== tab) { 112 | this.setState({ 113 | activeTab: tab 114 | }) 115 | } 116 | switch (tab) { 117 | case 'Statistics': { 118 | break 119 | } 120 | default: { 121 | break 122 | } 123 | } 124 | } 125 | 126 | headerCallMove =(direction: string) => { 127 | this.props.callbackMove(this.props.data, this.props.data.type, this.props.panel, direction) 128 | } 129 | 130 | headerCallReorder =(direction: string) => { 131 | this.props.callbackReorderCards(this.props.data, this.props.panel, direction) 132 | } 133 | 134 | headerCallClose =() => { 135 | this.props.callbackClose(this.props.data, this.props.panel) 136 | } 137 | 138 | headerCallFavorite =() => { 139 | return new Promise((resolve, reject) => { 140 | this.props.callbackSave(this.props.data).then(resolve(true)) 141 | }) 142 | } 143 | 144 | headerSearchFavorites =() => { 145 | let isFavorite = false 146 | const list = this.props.callbackGetFavorites() 147 | isFavorite = list.some((li: any) => { 148 | return li.props.data.id === this.props.data.id 149 | }) 150 | return isFavorite 151 | } 152 | 153 | headerActiveCardLocation =() => { 154 | let currPos = -1 155 | const list = this.props.callbackActiveCards() 156 | list[this.props.panel].forEach((mac: any, i: number) => { 157 | if (mac.props.data.id === this.props.data.id) { 158 | currPos = i 159 | } 160 | }) 161 | return currPos 162 | } 163 | 164 | headerCallMinimize =() => { 165 | let currState = this.state.minimizedDetails 166 | if (currState) { 167 | currState = false 168 | this.setState({ minimizedDetails: currState }) 169 | } else { 170 | currState = true 171 | this.setState({ minimizedDetails: currState }) 172 | } 173 | return currState 174 | } 175 | 176 | //****** UI components and UI Interaction 177 | //******************************************** 178 | _createList = () => { 179 | const arrList = [] 180 | this.props.data.data.forEach((ar: any, i: number) => { 181 | arrList.push( 182 | 183 | 184 |
{ this.props.callbackLinkage(ar.name, 'Network Attribute', this.props.panel) }} style={{ display: 'inline-block', verticalAlign: 'top', paddingRight: 5, cursor: 'pointer' }}> {ar.name}
185 | 186 | {ar.assignments.length} 187 | 188 | ) 189 | }) 190 | return arrList 191 | } 192 | 193 | //****** helper functions and request functions 194 | //******************************************** 195 | } 196 | -------------------------------------------------------------------------------- /service-explorer/src/runtime/RelationshipsCard.tsx: -------------------------------------------------------------------------------- 1 | /** @jsx jsx */ 2 | import { React, jsx } from 'jimu-core' 3 | import { Icon, Table } from 'jimu-ui' 4 | import { TabContent, TabPane } from 'reactstrap' 5 | import CardHeader from './_header' 6 | import './css/custom.css' 7 | const linkIcon = require('./assets/launch.svg') 8 | 9 | interface IProps { 10 | data: any 11 | requestURL: string 12 | key: any 13 | panel: number 14 | dataElements: any 15 | serviceElements: any 16 | relationshipElements: any 17 | callbackClose: any 18 | callbackSave: any 19 | callbackLinkage: any 20 | callbackGetPanels: any 21 | callbackReorderCards: any 22 | callbackActiveCards: any 23 | callbackGetFavorites: any 24 | callbackMove: any 25 | } 26 | 27 | interface IState { 28 | nodeData: any 29 | activeTab: string 30 | minimizedDetails: boolean 31 | } 32 | 33 | export default class RelationshipsCard extends React.Component { 34 | constructor (props: IProps) { 35 | super(props) 36 | 37 | this.state = { 38 | nodeData: this.props.data.data, 39 | activeTab: 'Properties', 40 | minimizedDetails: false 41 | } 42 | } 43 | 44 | componentWillMount () {} 45 | 46 | componentDidMount () {} 47 | 48 | render () { 49 | return ( 50 |
51 | 63 | { 64 | (this.state.minimizedDetails) 65 | ? '' 66 | : 67 | 68 |
69 |
{this.buildCrumb()}{this.props.data.type}
70 |
71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | {this._createARList()} 81 | 82 |
NameOriginTarget
83 |
84 |
85 |
86 |
87 |
88 | } 89 |
) 90 | } 91 | 92 | //**** breadCrumb */ 93 | buildCrumb =() => { 94 | const list = [] 95 | this.props.data.crumb.forEach((c: any, i: number) => { 96 | list.push( { 97 | this.props.callbackLinkage(c.value, c.type, this.props.panel) 98 | this.headerCallClose() 99 | }} style={{ cursor: 'pointer' }}>{c.value + ' > '}) 100 | }) 101 | return (list) 102 | } 103 | 104 | //****** Header Support functions 105 | //******************************************** 106 | headerToggleTabs =(tab: string) => { 107 | if (this.state.activeTab !== tab) { 108 | this.setState({ 109 | activeTab: tab 110 | }) 111 | } 112 | switch (tab) { 113 | case 'Statistics': { 114 | break 115 | } 116 | default: { 117 | break 118 | } 119 | } 120 | } 121 | 122 | headerCallMove =(direction: string) => { 123 | this.props.callbackMove(this.props.data, this.props.data.type, this.props.panel, direction) 124 | } 125 | 126 | headerCallReorder =(direction: string) => { 127 | this.props.callbackReorderCards(this.props.data, this.props.panel, direction) 128 | } 129 | 130 | headerCallClose =() => { 131 | this.props.callbackClose(this.props.data, this.props.panel) 132 | } 133 | 134 | headerCallFavorite =() => { 135 | return new Promise((resolve, reject) => { 136 | this.props.callbackSave(this.props.data).then(resolve(true)) 137 | }) 138 | } 139 | 140 | headerSearchFavorites =() => { 141 | let isFavorite = false 142 | const list = this.props.callbackGetFavorites() 143 | isFavorite = list.some((li: any) => { 144 | return li.props.data.id === this.props.data.id 145 | }) 146 | return isFavorite 147 | } 148 | 149 | headerActiveCardLocation =() => { 150 | let currPos = -1 151 | const list = this.props.callbackActiveCards() 152 | list[this.props.panel].forEach((mac: any, i: number) => { 153 | if (mac.props.data.id === this.props.data.id) { 154 | currPos = i 155 | } 156 | }) 157 | return currPos 158 | } 159 | 160 | headerCallMinimize =() => { 161 | let currState = this.state.minimizedDetails 162 | if (currState) { 163 | currState = false 164 | this.setState({ minimizedDetails: currState }) 165 | } else { 166 | currState = true 167 | this.setState({ minimizedDetails: currState }) 168 | } 169 | return currState 170 | } 171 | 172 | //****** UI components and UI Interaction 173 | //******************************************** 174 | _createARList = () => { 175 | const arrList = [] 176 | let org = null 177 | let dest = null 178 | this.props.data.data.forEach((r: any, i: number) => { 179 | if (r?.backwardPathLabel) { 180 | org = r.backwardPathLabel 181 | } else { 182 | if (r.role === 'esriRelRoleOrigin') { 183 | // for hosted service, the table id is the reverse of the destination(role) 184 | dest = this._SElayerNameLookup(r.relatedTableId) 185 | } else { 186 | const orgMatch = this._matchCorresRelation(r.id, r.role) 187 | if (orgMatch !== null) { 188 | dest = this._SElayerNameLookup(orgMatch.relatedTableId) 189 | } 190 | } 191 | } 192 | 193 | if (r?.forwardPathLabel) { 194 | dest = r.forwardPathLabel 195 | } else { 196 | if (r.role === 'esriRelRoleDestination') { 197 | // for hosted service, the table id is the reverse of the destination(role) 198 | org = this._SElayerNameLookup(r.relatedTableId) 199 | } else { 200 | const orgMatch = this._matchCorresRelation(r.id, r.role) 201 | if (orgMatch !== null) { 202 | org = this._SElayerNameLookup(orgMatch.relatedTableId) 203 | } 204 | } 205 | } 206 | 207 | arrList.push( 208 | 209 | 210 |
{ this.props.callbackLinkage(r.name, 'Relationship', this.props.panel) }} style={{ display: 'inline-block', verticalAlign: 'top', paddingRight: 5, cursor: 'pointer' }}> {r.name}
211 | 212 | {org} 213 | {dest} 214 | 215 | ) 216 | }) 217 | return arrList 218 | } 219 | 220 | //****** helper functions and request functions 221 | //******************************************* 222 | _layerForLinkageLookup =(layerId: number) => { 223 | if (this.props.dataElements.length > 0) { 224 | return this._DElayerNameLookup(layerId) 225 | } else { 226 | //for non un services 227 | return this._SElayerNameLookup(layerId) 228 | } 229 | } 230 | 231 | _DElayerNameLookup = (layerId: number) => { 232 | let foundLayer = '' 233 | const filterDE = this.props.dataElements.filter((de: any) => { 234 | return (de.layerId === layerId) 235 | }) 236 | if (filterDE.length > 0) { 237 | foundLayer = filterDE[0].dataElement.aliasName 238 | } 239 | return foundLayer 240 | } 241 | 242 | _SElayerNameLookup =(layerId: number) => { 243 | let foundLayer = layerId 244 | const filterSETables = this.props.serviceElements.tables.filter((se: any) => { 245 | return (se.id === layerId) 246 | }) 247 | if (filterSETables.length > 0) { 248 | foundLayer = filterSETables[0].name 249 | } else { 250 | //if it's not a table, see if it's a lyer 251 | const filterSELayers = this.props.serviceElements.layers.filter((se: any) => { 252 | return (se.id === layerId) 253 | }) 254 | if (filterSELayers.length > 0) { 255 | foundLayer = filterSELayers[0].name 256 | } 257 | } 258 | return foundLayer 259 | } 260 | 261 | _matchCorresRelation = (id: number, direction: string) => { 262 | let found = null 263 | this.state.nodeData.forEach((re: any) => { 264 | if (re.id === id) { 265 | if (re.role !== direction) { 266 | found = re 267 | } 268 | } 269 | }) 270 | return found 271 | } 272 | } 273 | -------------------------------------------------------------------------------- /service-explorer/src/runtime/SubTypesCard.tsx: -------------------------------------------------------------------------------- 1 | /** @jsx jsx */ 2 | import { React, jsx } from 'jimu-core' 3 | import { Icon, Table } from 'jimu-ui' 4 | import { TabContent, TabPane } from 'reactstrap' 5 | import CardHeader from './_header' 6 | import './css/custom.css' 7 | const linkIcon = require('./assets/launch.svg') 8 | 9 | interface IProps { 10 | data: any 11 | requestURL: string 12 | config: any 13 | cacheData: any 14 | panel: number 15 | callbackClose: any 16 | callbackSave: any 17 | callbackLinkage: any 18 | callbackGetPanels: any 19 | callbackReorderCards: any 20 | callbackActiveCards: any 21 | callbackGetFavorites: any 22 | callbackMove: any 23 | } 24 | 25 | interface IState { 26 | nodeData: any 27 | activeTab: string 28 | minimizedDetails: boolean 29 | subTypeDesc: string[] 30 | metadataElements: any 31 | } 32 | 33 | export default class SubTypesCard extends React.Component { 34 | constructor (props: IProps) { 35 | super(props) 36 | 37 | this.state = { 38 | nodeData: this.props.data, 39 | activeTab: 'Properties', 40 | minimizedDetails: false, 41 | subTypeDesc: [], 42 | metadataElements: null 43 | } 44 | } 45 | 46 | componentWillMount () { 47 | this._requestMetadata().then(() => { 48 | this._processMetaData() 49 | }) 50 | } 51 | 52 | componentDidMount () {} 53 | 54 | render () { 55 | return ( 56 |
57 | 69 | { 70 | (this.state.minimizedDetails) 71 | ? '' 72 | : 73 | 74 |
75 |
{this.buildCrumb()}{this.props.data.type}
76 |
77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | {this._createSTList()} 87 | 88 |
NameCodeDescription
89 |
90 |
91 |
92 |
93 |
94 | } 95 |
) 96 | } 97 | 98 | //**** breadCrumb */ 99 | buildCrumb =() => { 100 | const list = [] 101 | this.props.data.crumb.forEach((c: any, i: number) => { 102 | list.push( { 103 | this.props.callbackLinkage(c.value, c.type, this.props.panel) 104 | this.headerCallClose() 105 | }} style={{ cursor: 'pointer' }}>{c.value + ' > '}) 106 | }) 107 | return (list) 108 | } 109 | 110 | //****** Header Support functions 111 | //******************************************** 112 | headerToggleTabs =(tab: string) => { 113 | if (this.state.activeTab !== tab) { 114 | this.setState({ 115 | activeTab: tab 116 | }) 117 | } 118 | switch (tab) { 119 | case 'Statistics': { 120 | break 121 | } 122 | default: { 123 | break 124 | } 125 | } 126 | } 127 | 128 | headerCallMove =(direction: string) => { 129 | this.props.callbackMove(this.props.data, this.props.data.type, this.props.panel, direction) 130 | } 131 | 132 | headerCallReorder =(direction: string) => { 133 | this.props.callbackReorderCards(this.props.data, this.props.panel, direction) 134 | } 135 | 136 | headerCallClose =() => { 137 | this.props.callbackClose(this.props.data, this.props.panel) 138 | } 139 | 140 | headerCallFavorite =() => { 141 | return new Promise((resolve, reject) => { 142 | this.props.callbackSave(this.props.data).then(resolve(true)) 143 | }) 144 | } 145 | 146 | headerSearchFavorites =() => { 147 | let isFavorite = false 148 | const list = this.props.callbackGetFavorites() 149 | isFavorite = list.some((li: any) => { 150 | return li.props.data.id === this.props.data.id 151 | }) 152 | return isFavorite 153 | } 154 | 155 | headerActiveCardLocation =() => { 156 | let currPos = -1 157 | const list = this.props.callbackActiveCards() 158 | list[this.props.panel].forEach((mac: any, i: number) => { 159 | if (mac.props.data.id === this.props.data.id) { 160 | currPos = i 161 | } 162 | }) 163 | return currPos 164 | } 165 | 166 | headerCallMinimize =() => { 167 | let currState = this.state.minimizedDetails 168 | if (currState) { 169 | currState = false 170 | this.setState({ minimizedDetails: currState }) 171 | } else { 172 | currState = true 173 | this.setState({ minimizedDetails: currState }) 174 | } 175 | return currState 176 | } 177 | 178 | //****** UI components and UI Interaction 179 | //******************************************** 180 | _createSTList = () => { 181 | const arrList = [] 182 | this.props.data.nodes.forEach((ar: any, i: number) => { 183 | const subDesc: any = this.state.subTypeDesc.filter((std: any) => { 184 | return (parseInt(std.code) === parseInt(ar.data.subtypeCode)) 185 | }) 186 | arrList.push( 187 | 188 | 189 |
{ this.props.callbackLinkage(ar.data.subtypeName, 'Subtype', this.props.panel, this.props.data.parent) }} style={{ display: 'inline-block', verticalAlign: 'top', paddingRight: 5, cursor: 'pointer' }}> {ar.data.subtypeName}
190 | 191 | {ar.data.subtypeCode} 192 | {subDesc.length > 0 ? subDesc[0].description : ''} 193 | 194 | ) 195 | }) 196 | return arrList 197 | } 198 | 199 | //****** helper functions and request functions 200 | //******************************************** 201 | _requestMetadata = async () => { 202 | if (this.props.config.useCache) { 203 | const data = this.props.cacheData.metadata[this.props.data.layerId] 204 | const parser = new DOMParser() 205 | const xmlDoc = parser.parseFromString(data, 'text/xml') 206 | this.setState({ metadataElements: xmlDoc }) 207 | } else { 208 | const url = this.props.requestURL + '/' + this.props.data.parentId + '/metadata' 209 | await fetch(url, { 210 | method: 'GET' 211 | }) 212 | .then((response) => { return response.text() }) 213 | .then((data) => { 214 | const parser = new DOMParser() 215 | const xmlDoc = parser.parseFromString(data, 'text/xml') 216 | this.setState({ metadataElements: xmlDoc }) 217 | }) 218 | } 219 | } 220 | 221 | _processMetaData =() => { 222 | const description = [] 223 | const metadata = this.state.metadataElements 224 | const metaLevel = metadata.getElementsByTagName('metadata') 225 | if (metaLevel.length > 0) { 226 | const eaInfoLevel = metaLevel[0].getElementsByTagName('eainfo') 227 | if (eaInfoLevel.length > 0) { 228 | const detailedLevel = eaInfoLevel[0].getElementsByTagName('detailed') 229 | if (detailedLevel.length > 0) { 230 | for (let i = 0; i < detailedLevel.length; i++) { 231 | const subTypeCodeLevel = detailedLevel[i].getElementsByTagName('enttypdv') 232 | if (subTypeCodeLevel.length > 0) { 233 | //loop thorugh details and get code node and see if it's the current code card is on. 234 | //if (parseInt(subTypeCodeLevel[0].innerHTML) === parseInt(this.state.nodeData.layerId)) { 235 | //this tag stores the descriptions 236 | const subTypeDescLevel = detailedLevel[i].getElementsByTagName('enttypd') 237 | if (subTypeDescLevel.length > 0) { 238 | description.push({ code: parseInt(subTypeCodeLevel[0].innerHTML), description: subTypeDescLevel[0].innerHTML }) 239 | } 240 | //} 241 | } 242 | } 243 | } 244 | } 245 | } 246 | this.setState({ subTypeDesc: description }) 247 | } 248 | } 249 | -------------------------------------------------------------------------------- /service-explorer/src/runtime/TablesCard.tsx: -------------------------------------------------------------------------------- 1 | /** @jsx jsx */ 2 | import { React, jsx } from 'jimu-core' 3 | import { Icon, Table } from 'jimu-ui' 4 | import { TabContent, TabPane } from 'reactstrap' 5 | import CardHeader from './_header' 6 | import './css/custom.css' 7 | const linkIcon = require('./assets/launch.svg') 8 | 9 | interface IProps { 10 | data: any 11 | relationships: any 12 | requestURL: string 13 | key: any 14 | panel: number 15 | callbackClose: any 16 | callbackSave: any 17 | callbackLinkage: any 18 | callbackGetPanels: any 19 | callbackReorderCards: any 20 | callbackActiveCards: any 21 | callbackGetFavorites: any 22 | callbackMove: any 23 | } 24 | 25 | interface IState { 26 | nodeData: any 27 | activeTab: string 28 | minimizedDetails: boolean 29 | } 30 | 31 | export default class TablesCard extends React.Component { 32 | constructor (props: IProps) { 33 | super(props) 34 | 35 | this.state = { 36 | nodeData: this.props.data.data, 37 | activeTab: 'Properties', 38 | minimizedDetails: false 39 | } 40 | } 41 | 42 | componentWillMount () {} 43 | 44 | componentDidMount () {} 45 | 46 | render () { 47 | return ( 48 |
49 | 61 | { 62 | (this.state.minimizedDetails) 63 | ? '' 64 | : 65 | 66 |
67 |
{this.buildCrumb()}{this.props.data.type}
68 |
69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | {this._createRelationshipList()} 78 | 79 |
NameRelationship
80 |
81 |
82 |
83 |
84 |
85 | } 86 |
) 87 | } 88 | 89 | //**** breadCrumb */ 90 | buildCrumb =() => { 91 | const list = [] 92 | this.props.data.crumb.forEach((c: any, i: number) => { 93 | list.push( { 94 | this.props.callbackLinkage(c.value, c.type, this.props.panel) 95 | this.headerCallClose() 96 | }} style={{ cursor: 'pointer' }}>{c.value + ' > '}) 97 | }) 98 | return (list) 99 | } 100 | 101 | //****** Header Support functions 102 | //******************************************** 103 | headerToggleTabs =(tab: string) => { 104 | if (this.state.activeTab !== tab) { 105 | this.setState({ 106 | activeTab: tab 107 | }) 108 | } 109 | switch (tab) { 110 | case 'Statistics': { 111 | break 112 | } 113 | default: { 114 | break 115 | } 116 | } 117 | } 118 | 119 | headerCallMove =(direction: string) => { 120 | this.props.callbackMove(this.props.data, this.props.data.type, this.props.panel, direction) 121 | } 122 | 123 | headerCallReorder =(direction: string) => { 124 | this.props.callbackReorderCards(this.props.data, this.props.panel, direction) 125 | } 126 | 127 | headerCallClose =() => { 128 | this.props.callbackClose(this.props.data, this.props.panel) 129 | } 130 | 131 | headerCallFavorite =() => { 132 | return new Promise((resolve, reject) => { 133 | this.props.callbackSave(this.props.data).then(resolve(true)) 134 | }) 135 | } 136 | 137 | headerSearchFavorites =() => { 138 | let isFavorite = false 139 | const list = this.props.callbackGetFavorites() 140 | isFavorite = list.some((li: any) => { 141 | return li.props.data.id === this.props.data.id 142 | }) 143 | return isFavorite 144 | } 145 | 146 | headerActiveCardLocation =() => { 147 | let currPos = -1 148 | const list = this.props.callbackActiveCards() 149 | list[this.props.panel].forEach((mac: any, i: number) => { 150 | if (mac.props.data.id === this.props.data.id) { 151 | currPos = i 152 | } 153 | }) 154 | return currPos 155 | } 156 | 157 | headerCallMinimize =() => { 158 | let currState = this.state.minimizedDetails 159 | if (currState) { 160 | currState = false 161 | this.setState({ minimizedDetails: currState }) 162 | } else { 163 | currState = true 164 | this.setState({ minimizedDetails: currState }) 165 | } 166 | return currState 167 | } 168 | 169 | //****** UI components and UI Interaction 170 | //******************************************** 171 | _createRelationshipList = () => { 172 | const arrList = [] 173 | const lookup = (id: number) => { 174 | const relateList = [] 175 | const filtered = this.props.relationships.filter((r: any, i: number) => { 176 | return (r.destinationLayerId === id || r.originLayerId === id) 177 | }) 178 | if (filtered.length > 0) { 179 | filtered.forEach((f: any, i: number) => { 180 | relateList.push( 181 |
{ this.props.callbackLinkage(f.name, 'Relationship', this.props.panel) }} style={{ display: 'inline-block', verticalAlign: 'top', paddingRight: 5, cursor: 'pointer' }}> {f.name}
182 | ) 183 | }) 184 | } 185 | return relateList 186 | } 187 | 188 | this.props.data.data.forEach((f: any, i: number) => { 189 | arrList.push( 190 | 191 | 192 |
{ this.props.callbackLinkage(f.name, 'Table', this.props.panel) }} style={{ display: 'inline-block', verticalAlign: 'top', paddingRight: 5, cursor: 'pointer' }}> {f.name}
193 | 194 | {lookup(f.id)} 195 | 196 | ) 197 | }) 198 | return arrList 199 | } 200 | 201 | //****** helper functions and request functions 202 | //******************************************** 203 | } 204 | -------------------------------------------------------------------------------- /service-explorer/src/runtime/TerminalConfigurationCard.tsx: -------------------------------------------------------------------------------- 1 | /** @jsx jsx */ 2 | import { React, jsx } from 'jimu-core' 3 | import { Icon, Collapse, Table } from 'jimu-ui' 4 | import { TabContent, TabPane } from 'reactstrap' 5 | import CardHeader from './_header' 6 | import './css/custom.css' 7 | import EsriLookup from './_constants' 8 | const rightArrowIcon = require('jimu-ui/lib/icons/arrow-right.svg') 9 | const downArrowIcon = require('jimu-ui/lib/icons/arrow-down.svg') 10 | 11 | interface IProps { 12 | data: any 13 | dataElements: any 14 | domains: any 15 | requestURL: string 16 | panel: number 17 | callbackClose: any 18 | callbackSave: any 19 | callbackLinkage: any 20 | callbackGetPanels: any 21 | callbackReorderCards: any 22 | callbackActiveCards: any 23 | callbackGetFavorites: any 24 | callbackMove: any 25 | } 26 | 27 | interface IState { 28 | nodeData: any 29 | activeTab: string 30 | expandTerminal: boolean 31 | expandTerminalPaths: boolean 32 | minimizedDetails: boolean 33 | esriValueList: any 34 | } 35 | 36 | export default class TerminalConfigurationCard extends React.Component { 37 | constructor (props: IProps) { 38 | super(props) 39 | 40 | this.state = { 41 | nodeData: this.props.data.data, 42 | activeTab: 'Properties', 43 | expandTerminal: false, 44 | expandTerminalPaths: false, 45 | minimizedDetails: false, 46 | esriValueList: new EsriLookup() 47 | } 48 | } 49 | 50 | componentWillMount () { 51 | console.log(this.state.nodeData) 52 | } 53 | 54 | componentDidMount () {} 55 | 56 | render () { 57 | return ( 58 |
59 | 71 | { 72 | (this.state.minimizedDetails) 73 | ? '' 74 | : 75 | 76 |
77 |
{this.buildCrumb()}Properties
78 |
Name: {this.state.nodeData.terminalConfigurationName}
79 |
Default Configuration: {this.state.nodeData.defaultConfiguration}
80 |
Traversability: {this.state.esriValueList.lookupValue(this.state.nodeData.traversabilityModel)}
81 |
{ this.toggleTerminals() }}>{(this.state.expandTerminal) ? : } Terminals
82 | 83 |
84 | {(this.state.nodeData.terminals.length > 0) ? this._createTerminalTable() : 'No terminals exist'} 85 |
86 |
87 |
{ this.toggleTerminalsPaths() }}>{(this.state.expandTerminalPaths) ? : } Valid Paths
88 | 89 |
90 | {(this.state.nodeData.terminals.length > 0) ? this._createTerminalPathsTable() : 'No terminals paths'} 91 |
92 |
93 |
94 |
95 |
96 |
97 | } 98 |
) 99 | } 100 | 101 | //**** breadCrumb */ 102 | buildCrumb =() => { 103 | const list = [] 104 | this.props.data.crumb.forEach((c: any, i: number) => { 105 | list.push( { 106 | this.props.callbackLinkage(c.value, c.type, this.props.panel, this.props.data.parent) 107 | this.headerCallClose() 108 | }} style={{ cursor: 'pointer' }}>{c.value + ' > '}) 109 | }) 110 | return (list) 111 | } 112 | 113 | //****** Header Support functions 114 | //******************************************** 115 | headerToggleTabs =(tab: string) => { 116 | if (this.state.activeTab !== tab) { 117 | this.setState({ 118 | activeTab: tab 119 | }) 120 | } 121 | switch (tab) { 122 | case 'Statistics': { 123 | break 124 | } 125 | default: { 126 | break 127 | } 128 | } 129 | } 130 | 131 | headerCallMove =(direction: string) => { 132 | this.props.callbackMove(this.props.data, this.props.data.type, this.props.panel, direction) 133 | } 134 | 135 | headerCallReorder =(direction: string) => { 136 | this.props.callbackReorderCards(this.props.data, this.props.panel, direction) 137 | } 138 | 139 | headerCallClose =() => { 140 | this.props.callbackClose(this.props.data, this.props.panel) 141 | } 142 | 143 | headerCallFavorite =() => { 144 | return new Promise((resolve, reject) => { 145 | this.props.callbackSave(this.props.data).then(resolve(true)) 146 | }) 147 | } 148 | 149 | headerSearchFavorites =() => { 150 | let isFavorite = false 151 | const list = this.props.callbackGetFavorites() 152 | isFavorite = list.some((li: any) => { 153 | return li.props.data.id === this.props.data.id 154 | }) 155 | return isFavorite 156 | } 157 | 158 | headerActiveCardLocation =() => { 159 | let currPos = -1 160 | const list = this.props.callbackActiveCards() 161 | list[this.props.panel].forEach((mac: any, i: number) => { 162 | if (mac.props.data.id === this.props.data.id) { 163 | currPos = i 164 | } 165 | }) 166 | return currPos 167 | } 168 | 169 | headerCallMinimize =() => { 170 | let currState = this.state.minimizedDetails 171 | if (currState) { 172 | currState = false 173 | this.setState({ minimizedDetails: currState }) 174 | } else { 175 | currState = true 176 | this.setState({ minimizedDetails: currState }) 177 | } 178 | return currState 179 | } 180 | 181 | //****** UI components and UI Interaction 182 | //******************************************** 183 | toggleTerminals =() => { 184 | if (this.state.expandTerminal) { 185 | this.setState({ expandTerminal: false }) 186 | } else { 187 | this.setState({ expandTerminal: true }) 188 | } 189 | } 190 | 191 | toggleTerminalsPaths =() => { 192 | if (this.state.expandTerminalPaths) { 193 | this.setState({ expandTerminalPaths: false }) 194 | } else { 195 | this.setState({ expandTerminalPaths: true }) 196 | } 197 | } 198 | 199 | _createTerminalTable =() => { 200 | const arrList = [] 201 | this.state.nodeData.terminals.forEach((t: any, i: number) => { 202 | arrList.push( 203 | 204 | {t.terminalName} 205 | {{(this.state.nodeData.traversabilityModel !== 'esriUNTMBidirectional') ? (t.isUpstreamTerminal) ? 'Upstream' : 'Downstream' : ''}} 206 | 207 | ) 208 | }) 209 | const tableObj = 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | {arrList} 218 | 219 |
Name{(this.state.nodeData.traversabilityModel !== 'esriUNTMBidirectional') ? 'Side' : ''}
220 | return tableObj 221 | } 222 | 223 | _createTerminalPathsTable =() => { 224 | const arrList = [] 225 | let arrPath = [] 226 | this.state.nodeData.validConfigurationPaths.sort(this._compare('name')) 227 | this.state.nodeData.validConfigurationPaths.forEach((vp: any, i: number) => { 228 | arrPath = [] 229 | vp.terminalPaths.forEach((tp: any, z: number) => { 230 | arrPath.push( 231 | 232 | From: {this._lookupTerminalNameById(tp.fromTerminalId)} 233 | To: {this._lookupTerminalNameById(tp.toTerminalId)} 234 | 235 | ) 236 | }) 237 | 238 | arrList.push( 239 | 240 | {vp.name}{(this._lookupDefaultPath(vp.name)) ? ' (Default)' : ''} 241 | {vp.description} 242 | 243 | {arrPath}
244 | 245 | 246 | ) 247 | }) 248 | const tableObj = 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | {arrList} 258 | 259 |
NameDescriptionPaths
260 | return tableObj 261 | } 262 | 263 | //*** SUPPORT FUNCTIONS *****/ 264 | _lookupTerminalNameById =(id: number) => { 265 | let name = [] 266 | name = this.state.nodeData.terminals.filter((t: any, i: number) => { 267 | return (t.terminalId === id) 268 | }) 269 | if (name.length > 0) { 270 | return name[0].terminalName 271 | } else { 272 | return id 273 | } 274 | } 275 | 276 | _lookupDefaultPath =(name: string) => { 277 | let isDefault = false 278 | if (this.state.nodeData.defaultConfiguration === name) { 279 | isDefault = true 280 | } 281 | return isDefault 282 | } 283 | 284 | _compare =(prop: any) => { 285 | return function (a: any, b: any) { 286 | let comparison = 0 287 | if (a[prop] > b[prop]) { 288 | comparison = 1 289 | } else if (a[prop] < b[prop]) { 290 | comparison = -1 291 | } 292 | return comparison 293 | } 294 | } 295 | } 296 | -------------------------------------------------------------------------------- /service-explorer/src/runtime/TerminalConfigurationsCard.tsx: -------------------------------------------------------------------------------- 1 | /** @jsx jsx */ 2 | import { React, jsx } from 'jimu-core' 3 | import { Icon, Table } from 'jimu-ui' 4 | import { TabContent, TabPane } from 'reactstrap' 5 | import CardHeader from './_header' 6 | import EsriLookup from './_constants' 7 | import './css/custom.css' 8 | const linkIcon = require('./assets/launch.svg') 9 | 10 | interface IProps { 11 | data: any 12 | requestURL: string 13 | key: any 14 | panel: number 15 | callbackClose: any 16 | callbackSave: any 17 | callbackLinkage: any 18 | callbackGetPanels: any 19 | callbackReorderCards: any 20 | callbackActiveCards: any 21 | callbackGetFavorites: any 22 | callbackMove: any 23 | } 24 | 25 | interface IState { 26 | nodeData: any 27 | activeTab: string 28 | minimizedDetails: boolean 29 | esriValueList: any 30 | } 31 | 32 | export default class TerminalConfigurationsCard extends React.Component { 33 | constructor (props: IProps) { 34 | super(props) 35 | 36 | this.state = { 37 | nodeData: this.props.data.data, 38 | activeTab: 'Properties', 39 | minimizedDetails: false, 40 | esriValueList: new EsriLookup() 41 | } 42 | } 43 | 44 | componentWillMount () {} 45 | 46 | componentDidMount () { 47 | //this._processData(); 48 | } 49 | 50 | componentWillReceiveProps () { 51 | //this.setState({ state: this.state }) 52 | } 53 | 54 | componentDidUpdate () {} 55 | 56 | render () { 57 | return ( 58 |
59 | 71 | { 72 | (this.state.minimizedDetails) 73 | ? '' 74 | : 75 | 76 |
77 |
{this.buildCrumb()}{this.props.data.type}
78 |
79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | {this._createList()} 89 | 90 |
NameTraversabilityNo# of Terminals
91 |
92 |
93 |
94 |
95 |
96 | } 97 |
) 98 | } 99 | 100 | //**** breadCrumb */ 101 | buildCrumb =() => { 102 | const list = [] 103 | this.props.data.crumb.forEach((c: any, i: number) => { 104 | list.push( { 105 | this.props.callbackLinkage(c.value, c.type, this.props.panel) 106 | this.headerCallClose() 107 | }} style={{ cursor: 'pointer' }}>{c.value + ' > '}) 108 | }) 109 | return (list) 110 | } 111 | 112 | //****** Header Support functions 113 | //******************************************** 114 | headerToggleTabs =(tab: string) => { 115 | if (this.state.activeTab !== tab) { 116 | this.setState({ 117 | activeTab: tab 118 | }) 119 | } 120 | switch (tab) { 121 | case 'Statistics': { 122 | break 123 | } 124 | default: { 125 | break 126 | } 127 | } 128 | } 129 | 130 | headerCallMove =(direction: string) => { 131 | this.props.callbackMove(this.props.data, this.props.data.type, this.props.panel, direction) 132 | } 133 | 134 | headerCallReorder =(direction: string) => { 135 | this.props.callbackReorderCards(this.props.data, this.props.panel, direction) 136 | } 137 | 138 | headerCallClose =() => { 139 | this.props.callbackClose(this.props.data, this.props.panel) 140 | } 141 | 142 | headerCallFavorite =() => { 143 | return new Promise((resolve, reject) => { 144 | this.props.callbackSave(this.props.data).then(resolve(true)) 145 | }) 146 | } 147 | 148 | headerSearchFavorites =() => { 149 | let isFavorite = false 150 | const list = this.props.callbackGetFavorites() 151 | isFavorite = list.some((li: any) => { 152 | return li.props.data.id === this.props.data.id 153 | }) 154 | return isFavorite 155 | } 156 | 157 | headerActiveCardLocation =() => { 158 | let currPos = -1 159 | const list = this.props.callbackActiveCards() 160 | list[this.props.panel].forEach((mac: any, i: number) => { 161 | if (mac.props.data.id === this.props.data.id) { 162 | currPos = i 163 | } 164 | }) 165 | return currPos 166 | } 167 | 168 | headerCallMinimize =() => { 169 | let currState = this.state.minimizedDetails 170 | if (currState) { 171 | currState = false 172 | this.setState({ minimizedDetails: currState }) 173 | } else { 174 | currState = true 175 | this.setState({ minimizedDetails: currState }) 176 | } 177 | return currState 178 | } 179 | 180 | //****** UI components and UI Interaction 181 | //******************************************** 182 | _createList = () => { 183 | const arrList = [] 184 | this.props.data.data.forEach((ar: any, i: number) => { 185 | arrList.push( 186 | 187 | 188 |
{ this.props.callbackLinkage(ar.terminalConfigurationName, 'Terminal Configuration', this.props.panel) }} style={{ display: 'inline-block', verticalAlign: 'top', paddingRight: 5, cursor: 'pointer' }}> {ar.terminalConfigurationName}
189 | 190 | {this.state.esriValueList.lookupValue(ar.traversabilityModel)} 191 | {ar.terminals.length} 192 | 193 | ) 194 | }) 195 | return arrList 196 | } 197 | 198 | //****** helper functions and request functions 199 | //******************************************** 200 | } 201 | -------------------------------------------------------------------------------- /service-explorer/src/runtime/_MinimizedCard.tsx: -------------------------------------------------------------------------------- 1 | /** @jsx jsx */ 2 | import { jsx, React } from 'jimu-core' 3 | import { Icon } from 'jimu-ui' 4 | import './css/custom.css' 5 | const CloseIcon = require('jimu-ui/lib/icons/close.svg') 6 | const linkIcon = require('./assets/launch.svg') 7 | 8 | interface IProps { 9 | data: any 10 | width: number 11 | height: number 12 | callbackRestore: any 13 | callbackDelete: any 14 | } 15 | 16 | interface IState { 17 | width: number 18 | height: number 19 | nodeData: any 20 | } 21 | 22 | export default class MinimizedCard extends React.Component { 23 | constructor (props: IProps) { 24 | super(props) 25 | 26 | this.state = { 27 | width: this.props.width, 28 | height: this.props.height, 29 | nodeData: this.props.data.data 30 | } 31 | } 32 | 33 | componentWillMount () { 34 | //test 35 | } 36 | 37 | componentDidMount () { 38 | //this._processData(); 39 | } 40 | 41 | render () { 42 | return ( 43 |
44 |
45 |
{this.props.data.text}
46 |
47 |
48 |
49 |
) 50 | } 51 | 52 | sendRestore =() => { 53 | this.props.callbackRestore(this.props.data) 54 | } 55 | 56 | sendDelete =() => { 57 | this.props.callbackDelete(this.props.data) 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /service-explorer/src/runtime/_constants.js: -------------------------------------------------------------------------------- 1 | export default class EsriLookup { 2 | constructor() { 3 | this.valueList = { 4 | "esriNETEdge": "Edge", 5 | "esriNETJunction": "Junction", 6 | "esriTDNone": "None", 7 | "esriTDPartitioned": "Partitioned", 8 | "esriTDHierarchical": "Hierarchical", 9 | "esriSCTSource": "Source", 10 | "esriSCTSink": "Sink", 11 | "esriTTTRadial": "Radial", 12 | "esriTTTMesh": "Mesh", 13 | "esriUNFCUTStructureJunction": "StructureJunction", 14 | "esriUNFCUTStructureBoundary": "StructureBoundary", 15 | "esriUNFCUTStructureLine": "StructureLine", 16 | "esriUNFCUTDevice": "Device", 17 | "esriUNFCUTAssembly": "Assembly", 18 | "esriUNFCUTJunction": "Junction", 19 | "esriUNFCUTLine": "Line", 20 | "esriUNFCUTSubnetLine": "SubnetLine", 21 | "esriUNFCUTStructureJunctionObject": "StructureJunctionObject", 22 | "esriUNFCUTStructureEdgeObject": "StructureEdgeObject", 23 | "esriUNFCUTJunctionObject": "JunctionObject", 24 | "esriUNFCUTEdgeObject": "EdgeObject", 25 | "esriRTJunctionJunction": "Junction Junction Connectivity", 26 | "esriRTContainment": "Containment", 27 | "esriRTStructuralAttachment": "Structural Attachment", 28 | "esriRTJunctionEdge": "Junction Edge Connectivity", 29 | "esriRTEdgeJunctionEdge": "Edge Junction Edge Connectivity", 30 | "esriATJunctionJunction": "Junction Junction Connectivity", 31 | "esriATContainment": "Containment", 32 | "esriATStructuralAttachment": "Structural Attachment", 33 | "esriNSSPSupportsContainment": "SupportsContainment", 34 | "esriNSSPSupportsStructuralAttachments": "SupportsStructuralAttachments", 35 | "esriNSSPSupportsCategories": "SupportsCategories", 36 | "esriNSSPSupportsNetworkAttributes": "SupportsNetworkAttributes", 37 | "esriNSSPSupportsTerminals": "SupportsTerminals", 38 | "esriNSSPSupportsNone": "SupportsNone", 39 | "esriADTCascade": "Cascade", 40 | "esriADTRestricted": "Restricted", 41 | "esriADTSetToNone": "SetToNone", 42 | "esriARTNone": "None", 43 | "esriARTContainer": "Container", 44 | "esriARTStructure": "Structure", 45 | "esriNECPEndVertex": "EndVertex", 46 | "esriNECPAnyVertex": "AnyVertex", 47 | "esriNADTInteger": "Integer", 48 | "esriNADTDouble": "Double", 49 | "esriUNAUTSourceID": "SourceID", 50 | "esriUNAUTTerminalID": "TerminalID", 51 | "esriUNAUTAssetGroup": "AssetGroup", 52 | "esriUNAUTAssetType": "AssetType", 53 | "esriUNAUTIsSubnetworkController": "IsSubnetworkController", 54 | "esriUNAUTTierRank": "TierRank", 55 | "esriUNAUTTierName": "TierName", 56 | "esriUNAUTShapeLength": "ShapeLength", 57 | "esriUNAUTPositionFrom": "PositionFrom", 58 | "esriUNAUTPositionTo": "PositionTo", 59 | "esriUNAUTFlowDirection": "FlowDirection", 60 | "esriUNAUTUnknown": "Unknown", 61 | "esriTSJunctionsAndEdges": "JunctionsAndEdges", 62 | "esriTSJunctions": "Junctions", 63 | "esriTSEdges": "Edges", 64 | "esriCTNetworkAttribute": "NetworkAttribute", 65 | "esriCTCategory": "Category", 66 | "esriFTNetworkAttribute": false, 67 | "esriFTSpecificValue": true, 68 | "esriCUAnd": false, 69 | "esriCUOr": true, 70 | "esriCSPSplit": true, 71 | "esriCSPDoNotSplit": false, 72 | "esriTOEqual": "Equal", 73 | "esriTONotEqual": "NotEqual", 74 | "esriTOLessThan": "LessThan", 75 | "esriTOLessThanEqual": "LessThanEqual", 76 | "esriTOGreaterThan": "GreaterThan", 77 | "esriTOGreaterThanEqual": "GreaterThanEqual", 78 | "esriTOIncludesAny": "IncludesAny", 79 | "esriTODoesNotIncludeAny": "DoesNotIncludeAny", 80 | "esriTOIncludesTheValues": "IncludesTheValues", 81 | "esriTODoesNotIncludeTheValues": "DoesNotIncludeTheValues", 82 | "esriTFTAdd": "Add", 83 | "esriTFTSubtract": "Subtract", 84 | "esriTFTCount": "Count", 85 | "esriTFTAverage": "Average", 86 | "esriTFTMax": "Max", 87 | "esriTFTMin": "Min", 88 | "esriTPFTBitwiseAnd": "BitwiseAnd", 89 | "esriTPFTMax": "Max", 90 | "esriTPFTMin": "Min", 91 | "esriUNTMBidirectional": "Bidirectional", 92 | "esriUNTMDirectional": "Directional", 93 | "esriFieldTypeOID": "OID", 94 | "esriFieldTypeGeometry": "Geometry", 95 | "esriFieldTypeSmallInteger": "SmallInteger", 96 | "esriFieldTypeInteger": "Integer", 97 | "esriFieldTypeSingle": "Single", 98 | "esriFieldTypeDouble": "Double", 99 | "esriFieldTypeDate": "Date", 100 | "esriFieldTypeString": "String", 101 | "esriFieldTypeBlob": "Blob", 102 | "esriFieldTypeGUID": "Guid", 103 | "esriFieldTypeRaster": "Raster", 104 | "esriFieldTypeGlobalID": "GlobalID", 105 | "esriFieldTypeXML": "XML", 106 | "esriARTCalculation": "Calculation", 107 | "esriARTValidation": "Validation", 108 | "esriARTConstraint": "Constraint", 109 | "esriARTEInsert": "Insert", 110 | "esriARTEUpdate": "Update", 111 | "esriARTEDelete": "Delete", 112 | "esriDTCodedValue": "CodedValue", 113 | "esriDTRange": "Range", 114 | "esriMPTDefaultValue": "DefaultValue", 115 | "esriMPTSumValues": "SumValues", 116 | "esriMPTAreaWeighted": "AreaWeighted", 117 | "esriSPTDefaultValue": "DefaultValue", 118 | "esriSPTDuplicate": "Duplicate", 119 | "esriSPTGeometryRatio": "GeometryRatio", 120 | "esriGeometryPoint": "Point", 121 | "esriGeometryPolyline": "Line", 122 | "esriGeometryPolygon": "Polygon", 123 | "esriGeometryMultipoint": "Multipoint", 124 | "esriGeometryMultiPatch": "MultiPath", 125 | "esriGeometryNull": "Null", 126 | "esriFTSimple": "Simple", 127 | "esriFTAnnotation": "Annotation", 128 | "esriFTDimension": "Dimension", 129 | "esriDTTable": "Table", 130 | "esriDTFeatureClass": "FeatureClass", 131 | "esriDTFeatureDataset": "FeatureDataset", 132 | "esriDTRelationshipClass": "RelationshipClass", 133 | "esriDTUtilityNetwork": "UtilityNetwork", 134 | "esriDTGeometricNetwork": "GeometricNetwork", 135 | "esriRelCardinalityOneToOne": "OneToOne", 136 | "esriRelCardinalityOneToMany": "OneToMany", 137 | "esriRelCardinalityManyToMany": "ManyToMany", 138 | "esriRelClassKeyClassCode": "ClassCode", 139 | "esriRelClassKeyClassID": "ClassID", 140 | "esriRelClassKeyUndefined": "Undefined", 141 | "esriRelKeyRoleDestinationForeign": "DestinationForeign", 142 | "esriRelKeyRoleDestinationPrimary": "DestinationPrimary", 143 | "esriRelKeyRoleOriginForeign": "OriginForeign", 144 | "esriRelKeyRoleOriginPrimary": "OriginPrimary", 145 | "esriRelKeyTypeSingle": "Single", 146 | "esriRelKeyTypeDual": "Dual", 147 | "esriRelNotificationBackward": "Backward", 148 | "esriRelNotificationForward": "Forward", 149 | "esriRelNotificationBoth": "Both", 150 | "esriRelNotificationNone": "None", 151 | "esriLocalDatabaseWorkspace": "LocalDatabase", 152 | "esriRemoteDatabaseWorkspace": "RemoteDatabase" 153 | }; 154 | } 155 | 156 | lookupValue(value) { 157 | if (this.valueList.hasOwnProperty(value)) { 158 | return this.valueList[value]; 159 | } else { 160 | return value; 161 | } 162 | } 163 | } 164 | 165 | -------------------------------------------------------------------------------- /service-explorer/src/runtime/_header.tsx: -------------------------------------------------------------------------------- 1 | /** @jsx jsx */ 2 | import { React, jsx } from 'jimu-core' 3 | import './css/custom.css' 4 | import { Tooltip, NavbarBrand } from 'reactstrap' 5 | import { Navbar, Nav, NavItem, NavLink, Icon, DropdownMenu } from 'jimu-ui' 6 | const heartIcon = require('jimu-ui/lib/icons/heart.svg') 7 | const closeIcon = require('jimu-ui/lib/icons/close.svg') 8 | const rightArrowIcon = require('jimu-ui/lib/icons/arrow-right.svg') 9 | const leftArrowIcon = require('jimu-ui/lib/icons/arrow-left.svg') 10 | const downArrowIcon = require('jimu-ui/lib/icons/arrow-down.svg') 11 | const upArrowIcon = require('jimu-ui/lib/icons/arrow-up-8.svg') 12 | const moveIcon = require('jimu-ui/lib/icons/tool-drag.svg') 13 | 14 | interface IProps { 15 | title: string 16 | isFavorite: any 17 | id: string 18 | panel: number 19 | panelCount: any 20 | slotInPanel: any 21 | totalSlotsInPanel: any 22 | onClose: any 23 | onSave: any 24 | onTabSwitch: any 25 | onMove: any 26 | onMinimize: any 27 | onReorderCards: any 28 | showProperties: boolean 29 | showStatistics: boolean 30 | showResources: boolean 31 | 32 | } 33 | 34 | interface IState { 35 | activeTab: string 36 | propertyBadge: string 37 | statsBadge: string 38 | diagramsBadge: string 39 | tooltipOpen: boolean 40 | minimized: boolean 41 | } 42 | 43 | export default class CardHeader extends React.Component { 44 | constructor (props: IProps) { 45 | super(props) 46 | 47 | this.state = { 48 | activeTab: 'Properties', 49 | propertyBadge: 'primary', 50 | statsBadge: 'dark', 51 | diagramsBadge: 'dark', 52 | tooltipOpen: false, 53 | minimized: false 54 | } 55 | 56 | this.toggleToolTip = this.toggleToolTip.bind(this) 57 | } 58 | 59 | componentWillMount () {} 60 | 61 | componentDidMount () {} 62 | 63 | render () { 64 | const rightValid = this.props.panelCount() > this.props.panel 65 | const leftValid = this.props.panel > 0 66 | const downValid = () => { return ((this.props.totalSlotsInPanel())[this.props.panel].length - 1 > this.props.slotInPanel()) } 67 | const upValid = () => { return this.props.slotInPanel() > 0 } 68 | const isFavorite = () => { return this.props.isFavorite() } 69 | 70 | /* 71 | {(this.props.showProperties) && { this.props.onTabSwitch(this.toggleTabs('Properties')); }}>} 72 | {(this.props.showStatistics) && { this.props.onTabSwitch(this.toggleTabs('Statistics')); }}>} 73 | {(this.props.showResources) && { this.props.onTabSwitch(this.toggleTabs('Diagrams')); }}>} 74 | | 75 | */ 76 | 77 | return ( 78 |
79 | 80 | 81 |
{ this.toggleMinimize() }} title={(this.state.minimized ? 'Maximize card' : 'Minimize card')}>
82 |
{this._dynamicHeaderSize(this.props.title)}
83 |
84 | 93 |
94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 |
{ (upValid) && this.props.onReorderCards('up') }}>{}
{ (leftValid) && this.props.onMove('left') }}>{} { (rightValid) && this.props.onMove('right') }}>{}
{ (downValid) && this.props.onReorderCards('down') }}>{}
117 |
118 |
) 119 | } 120 | 121 | //****** UI components and UI Interaction 122 | //******************************************** 123 | toggleToolTip () { 124 | this.setState({ 125 | tooltipOpen: !this.state.tooltipOpen 126 | }) 127 | } 128 | 129 | toggleTabs (tab: string) { 130 | if (this.state.activeTab !== tab) { 131 | this.setState({ 132 | activeTab: tab, 133 | propertyBadge: ((tab === 'Properties') ? 'primary' : 'dark'), 134 | statsBadge: ((tab === 'Statistics') ? 'primary' : 'dark'), 135 | diagramsBadge: ((tab === 'Diagrams') ? 'primary' : 'dark') 136 | }) 137 | } 138 | return tab 139 | } 140 | 141 | toggleMinimize =() => { 142 | const toggleState = this.props.onMinimize() 143 | this.setState({ minimized: toggleState }) 144 | } 145 | 146 | _dynamicHeaderSize =(title: string) => { 147 | let newTitleSize = title 148 | if (this.props.panel > 0) { 149 | if (title.length > 35) { 150 | const split1 = title.substring(0, 35) 151 | const split2 = title.substring(35, title.length) 152 | newTitleSize = split1 + '
' + split2 153 | } else { 154 | newTitleSize = title 155 | } 156 | } else { 157 | newTitleSize = title 158 | } 159 | return newTitleSize 160 | } 161 | } 162 | -------------------------------------------------------------------------------- /service-explorer/src/runtime/assets/ShowVertex_default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Esri/solutions-data-dictionary-viewer/bd2ed3431b85e4a28f6e2b83cd96257bab48796f/service-explorer/src/runtime/assets/ShowVertex_default.png -------------------------------------------------------------------------------- /service-explorer/src/runtime/assets/ShowVertex_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Esri/solutions-data-dictionary-viewer/bd2ed3431b85e4a28f6e2b83cd96257bab48796f/service-explorer/src/runtime/assets/ShowVertex_hover.png -------------------------------------------------------------------------------- /service-explorer/src/runtime/assets/arrowx200L.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Esri/solutions-data-dictionary-viewer/bd2ed3431b85e4a28f6e2b83cd96257bab48796f/service-explorer/src/runtime/assets/arrowx200L.png -------------------------------------------------------------------------------- /service-explorer/src/runtime/assets/arrowx200R.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Esri/solutions-data-dictionary-viewer/bd2ed3431b85e4a28f6e2b83cd96257bab48796f/service-explorer/src/runtime/assets/arrowx200R.png -------------------------------------------------------------------------------- /service-explorer/src/runtime/assets/data_files/featureServer/featureServer.json: -------------------------------------------------------------------------------- 1 | { 2 | "currentVersion": 10.71, 3 | "cimVersion": "2.4.0", 4 | "serviceDescription": "

This service has been designed to support the advance capabilities of the ArcGIS Utility Network Management extension.

", 5 | "hasVersionedData": true, 6 | "hasArchivedData": true, 7 | "supportsDisconnectedEditing": false, 8 | "supportsReturnServiceEditsOption": true, 9 | "returnServiceEditsHaveSR": true, 10 | "supportsQueryDataElements": true, 11 | "supportsRelationshipsResource": true, 12 | "syncEnabled": false, 13 | "extractChangesCapabilities": { 14 | "supportsReturnIdsOnly": true, 15 | "supportsReturnExtentOnly": false, 16 | "supportsReturnAttachments": false, 17 | "supportsLayerQueries": false, 18 | "supportsGeometry": false, 19 | "supportsFeatureReturn": false 20 | }, 21 | "supportedQueryFormats": "JSON", 22 | "maxRecordCount": 2000, 23 | "maxRecordCountFactor": 1, 24 | "capabilities": "Query,Create,Update,Delete,Uploads,Editing", 25 | "description": "", 26 | "copyrightText": "Esri., Inc.", 27 | "advancedEditingCapabilities": { 28 | "supportsSplit": true 29 | }, 30 | "spatialReference": { 31 | "wkt": "PROJCS[\"NAD_1983_HARN_StatePlane_Illinois_East_FIPS_1201\",GEOGCS[\"GCS_North_American_1983_HARN\",DATUM[\"D_North_American_1983_HARN\",SPHEROID[\"GRS_1980\",6378137.0,298.257222101]],PRIMEM[\"Greenwich\",0.0],UNIT[\"Degree\",0.0174532925199433]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"False_Easting\",984250.0],PARAMETER[\"False_Northing\",0.0],PARAMETER[\"Central_Meridian\",-88.33333333333333],PARAMETER[\"Scale_Factor\",0.999975],PARAMETER[\"Latitude_Of_Origin\",36.66666666666666],UNIT[\"Foot_US\",0.3048006096012192]],VERTCS[\"NAVD88_height_(ftUS)\",VDATUM[\"North_American_Vertical_Datum_1988\"],PARAMETER[\"Vertical_Shift\",0.0],PARAMETER[\"Direction\",1.0],UNIT[\"Foot_US\",0.3048006096012192]]", 32 | "xyTolerance": 0.003280833333333333, 33 | "zTolerance": 0.003280833333333333, 34 | "mTolerance": 0.001, 35 | "falseX": -17463800, 36 | "falseY": -46132600, 37 | "xyUnits": 3048.0060960121928, 38 | "falseZ": -100000, 39 | "zUnits": 3048.0060960121923, 40 | "falseM": -100000, 41 | "mUnits": 10000 42 | }, 43 | "initialExtent": { 44 | "xmin": 993829.8538521574, 45 | "ymin": 1805578.7832114892, 46 | "xmax": 1069493.340006533, 47 | "ymax": 1920031.7780905766, 48 | "spatialReference": { 49 | "wkt": "PROJCS[\"NAD_1983_HARN_StatePlane_Illinois_East_FIPS_1201\",GEOGCS[\"GCS_North_American_1983_HARN\",DATUM[\"D_North_American_1983_HARN\",SPHEROID[\"GRS_1980\",6378137.0,298.257222101]],PRIMEM[\"Greenwich\",0.0],UNIT[\"Degree\",0.0174532925199433]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"False_Easting\",984250.0],PARAMETER[\"False_Northing\",0.0],PARAMETER[\"Central_Meridian\",-88.33333333333333],PARAMETER[\"Scale_Factor\",0.999975],PARAMETER[\"Latitude_Of_Origin\",36.66666666666666],UNIT[\"Foot_US\",0.3048006096012192]],VERTCS[\"NAVD88_height_(ftUS)\",VDATUM[\"North_American_Vertical_Datum_1988\"],PARAMETER[\"Vertical_Shift\",0.0],PARAMETER[\"Direction\",1.0],UNIT[\"Foot_US\",0.3048006096012192]]", 50 | "xyTolerance": 0.003280833333333333, 51 | "zTolerance": 0.003280833333333333, 52 | "mTolerance": 0.001, 53 | "falseX": -17463800, 54 | "falseY": -46132600, 55 | "xyUnits": 3048.0060960121928, 56 | "falseZ": -100000, 57 | "zUnits": 3048.0060960121923, 58 | "falseM": -100000, 59 | "mUnits": 10000 60 | } 61 | }, 62 | "fullExtent": { 63 | "xmin": -17463455.5506689, 64 | "ymin": -46132232.73347634, 65 | "xmax": 19431955.5506689, 66 | "ymax": 19495685.092346754, 67 | "spatialReference": { 68 | "wkt": "PROJCS[\"NAD_1983_HARN_StatePlane_Illinois_East_FIPS_1201\",GEOGCS[\"GCS_North_American_1983_HARN\",DATUM[\"D_North_American_1983_HARN\",SPHEROID[\"GRS_1980\",6378137.0,298.257222101]],PRIMEM[\"Greenwich\",0.0],UNIT[\"Degree\",0.0174532925199433]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"False_Easting\",984250.0],PARAMETER[\"False_Northing\",0.0],PARAMETER[\"Central_Meridian\",-88.33333333333333],PARAMETER[\"Scale_Factor\",0.999975],PARAMETER[\"Latitude_Of_Origin\",36.66666666666666],UNIT[\"Foot_US\",0.3048006096012192]],VERTCS[\"NAVD88_height_(ftUS)\",VDATUM[\"North_American_Vertical_Datum_1988\"],PARAMETER[\"Vertical_Shift\",0.0],PARAMETER[\"Direction\",1.0],UNIT[\"Foot_US\",0.3048006096012192]]", 69 | "xyTolerance": 0.003280833333333333, 70 | "zTolerance": 0.003280833333333333, 71 | "mTolerance": 0.001, 72 | "falseX": -17463800, 73 | "falseY": -46132600, 74 | "xyUnits": 3048.0060960121928, 75 | "falseZ": -100000, 76 | "zUnits": 3048.0060960121923, 77 | "falseM": -100000, 78 | "mUnits": 10000 79 | } 80 | }, 81 | "allowGeometryUpdates": true, 82 | "allowTrueCurvesUpdates": true, 83 | "onlyAllowTrueCurveUpdatesByTrueCurveClients": true, 84 | "supportsApplyEditsWithGlobalIds": true, 85 | "supportsOidReservation": true, 86 | "supportsTrueCurve": true, 87 | "units": "esriFeet", 88 | "documentInfo": { 89 | "Title": "Water Distribution Utility Network", 90 | "Author": "", 91 | "Comments": "

This service has been designed to support the advance capabilities of the ArcGIS Utility Network Management extension.

", 92 | "Subject": "This service is used for clients that support the ArcGIS Utility Network Management extension.", 93 | "Category": "", 94 | "Keywords": "Water Distribution,ArcGIS Solutions,Utility Network" 95 | }, 96 | "supportsQueryDomains": true, 97 | "supportsQueryContingentValues": true, 98 | "layers": [ 99 | { 100 | "id": 501, 101 | "name": "Water Device", 102 | "parentLayerId": -1, 103 | "defaultVisibility": true, 104 | "subLayerIds": null, 105 | "minScale": 0, 106 | "maxScale": 0, 107 | "type": "Feature Layer", 108 | "geometryType": "esriGeometryPoint" 109 | }, 110 | { 111 | "id": 505, 112 | "name": "Water Assembly", 113 | "parentLayerId": -1, 114 | "defaultVisibility": true, 115 | "subLayerIds": null, 116 | "minScale": 0, 117 | "maxScale": 0, 118 | "type": "Feature Layer", 119 | "geometryType": "esriGeometryPoint" 120 | }, 121 | { 122 | "id": 510, 123 | "name": "Water Junction", 124 | "parentLayerId": -1, 125 | "defaultVisibility": true, 126 | "subLayerIds": null, 127 | "minScale": 0, 128 | "maxScale": 0, 129 | "type": "Feature Layer", 130 | "geometryType": "esriGeometryPoint" 131 | }, 132 | { 133 | "id": 515, 134 | "name": "Water Line", 135 | "parentLayerId": -1, 136 | "defaultVisibility": true, 137 | "subLayerIds": null, 138 | "minScale": 0, 139 | "maxScale": 0, 140 | "type": "Feature Layer", 141 | "geometryType": "esriGeometryPolyline" 142 | }, 143 | { 144 | "id": 520, 145 | "name": "Water SubnetLine", 146 | "parentLayerId": -1, 147 | "defaultVisibility": true, 148 | "subLayerIds": null, 149 | "minScale": 0, 150 | "maxScale": 0, 151 | "type": "Feature Layer", 152 | "geometryType": "esriGeometryPolyline" 153 | }, 154 | { 155 | "id": 900, 156 | "name": "Structure Junction", 157 | "parentLayerId": -1, 158 | "defaultVisibility": true, 159 | "subLayerIds": null, 160 | "minScale": 0, 161 | "maxScale": 0, 162 | "type": "Feature Layer", 163 | "geometryType": "esriGeometryPoint" 164 | }, 165 | { 166 | "id": 905, 167 | "name": "Structure Line", 168 | "parentLayerId": -1, 169 | "defaultVisibility": true, 170 | "subLayerIds": null, 171 | "minScale": 0, 172 | "maxScale": 0, 173 | "type": "Feature Layer", 174 | "geometryType": "esriGeometryPolyline" 175 | }, 176 | { 177 | "id": 910, 178 | "name": "Structure Boundary", 179 | "parentLayerId": -1, 180 | "defaultVisibility": true, 181 | "subLayerIds": null, 182 | "minScale": 0, 183 | "maxScale": 0, 184 | "type": "Feature Layer", 185 | "geometryType": "esriGeometryPolygon" 186 | }, 187 | { 188 | "id": 920, 189 | "name": "Service Territory", 190 | "parentLayerId": -1, 191 | "defaultVisibility": true, 192 | "subLayerIds": null, 193 | "minScale": 0, 194 | "maxScale": 0, 195 | "type": "Feature Layer", 196 | "geometryType": "esriGeometryPolygon" 197 | }, 198 | { 199 | "id": 950, 200 | "name": "Water Utility Network", 201 | "parentLayerId": -1, 202 | "defaultVisibility": true, 203 | "subLayerIds": [ 204 | 955, 205 | 960, 206 | 965, 207 | 970 208 | ], 209 | "minScale": 0, 210 | "maxScale": 0, 211 | "type": "Utility Network Layer" 212 | }, 213 | { 214 | "id": 955, 215 | "name": "Point Errors", 216 | "parentLayerId": 950, 217 | "defaultVisibility": true, 218 | "subLayerIds": null, 219 | "minScale": 0, 220 | "maxScale": 0, 221 | "type": "Feature Layer", 222 | "geometryType": "esriGeometryPoint" 223 | }, 224 | { 225 | "id": 960, 226 | "name": "Line Errors", 227 | "parentLayerId": 950, 228 | "defaultVisibility": true, 229 | "subLayerIds": null, 230 | "minScale": 0, 231 | "maxScale": 0, 232 | "type": "Feature Layer", 233 | "geometryType": "esriGeometryPolyline" 234 | }, 235 | { 236 | "id": 965, 237 | "name": "Polygon Errors", 238 | "parentLayerId": 950, 239 | "defaultVisibility": true, 240 | "subLayerIds": null, 241 | "minScale": 0, 242 | "maxScale": 0, 243 | "type": "Feature Layer", 244 | "geometryType": "esriGeometryPolygon" 245 | }, 246 | { 247 | "id": 970, 248 | "name": "Dirty Areas", 249 | "parentLayerId": 950, 250 | "defaultVisibility": true, 251 | "subLayerIds": null, 252 | "minScale": 0, 253 | "maxScale": 0, 254 | "type": "Feature Layer", 255 | "geometryType": "esriGeometryPolygon" 256 | } 257 | ], 258 | "tables": [ 259 | { 260 | "id": 5500, 261 | "name": "Valve Inspection" 262 | }, 263 | { 264 | "id": 5501, 265 | "name": "Hydrant Maintenance Inspection" 266 | } 267 | ], 268 | "relationships": [ 269 | { 270 | "id": 0, 271 | "name": "Device_ControllableValve_To_Inspection" 272 | }, 273 | { 274 | "id": 1, 275 | "name": "Device_Hydrant_To_Inspection" 276 | } 277 | ], 278 | "controllerDatasetLayers": { 279 | "utilityNetworkLayerId": 950 280 | }, 281 | "supportsDynamicLayers": true, 282 | "enableZDefaults": true, 283 | "zDefault": 0, 284 | "allowUpdateWithoutMValues": true, 285 | "heightModelInfo": { 286 | "heightModel": "gravity_related_height", 287 | "vertCRS": "NAVD88_height_(ftUS)", 288 | "heightUnit": "us-foot" 289 | }, 290 | "supportsVCSProjection": true, 291 | "datumTransformations": [ 292 | { 293 | "geoTransforms": [ 294 | { 295 | "wkid": 1580, 296 | "latestWkid": 1580, 297 | "transformForward": true, 298 | "name": "NAD_1983_HARN_To_WGS_1984" 299 | } 300 | ] 301 | }, 302 | { 303 | "geoTransforms": [ 304 | { 305 | "wkid": 1580, 306 | "latestWkid": 1580, 307 | "transformForward": false, 308 | "name": "NAD_1983_HARN_To_WGS_1984" 309 | } 310 | ] 311 | } 312 | ] 313 | } -------------------------------------------------------------------------------- /service-explorer/src/runtime/assets/icon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | icons/demo 5 | Created with Sketch. 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /service-explorer/src/runtime/assets/launch.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | launch 5 | Created with Sketch. 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /service-explorer/src/runtime/assets/lookup.json: -------------------------------------------------------------------------------- 1 | { 2 | "esriNETEdge": "Edge", 3 | "esriNETJunction": "Junction", 4 | "esriTDNone": "None", 5 | "esriTDPartitioned": "Partitioned", 6 | "esriTDHierarchical": "Hierarchical", 7 | "esriSCTSource": "Source", 8 | "esriSCTSink": "Sink", 9 | "esriTTTRadial": "Radial", 10 | "esriTTTMesh": "Mesh", 11 | "esriUNFCUTStructureJunction": "StructureJunction", 12 | "esriUNFCUTStructureBoundary": "StructureBoundary", 13 | "esriUNFCUTStructureLine": "StructureLine", 14 | "esriUNFCUTDevice": "Device", 15 | "esriUNFCUTAssembly": "Assembly", 16 | "esriUNFCUTJunction": "Junction", 17 | "esriUNFCUTLine": "Line", 18 | "esriUNFCUTSubnetLine": "SubnetLine", 19 | "esriUNFCUTStructureJunctionObject": "StructureJunctionObject", 20 | "esriUNFCUTStructureEdgeObject": "StructureEdgeObject", 21 | "esriUNFCUTJunctionObject": "JunctionObject", 22 | "esriUNFCUTEdgeObject": "EdgeObject", 23 | "esriRTJunctionJunction": "Junction Junction Connectivity", 24 | "esriRTContainment": "Containment", 25 | "esriRTStructuralAttachment": "Structural Attachment", 26 | "esriRTJunctionEdge": "Junction Edge Connectivity", 27 | "esriRTEdgeJunctionEdge": "Edge Junction Edge Connectivity", 28 | "esriATJunctionJunction": "Junction Junction Connectivity", 29 | "esriATContainment": "Containment", 30 | "esriATStructuralAttachment": "Structural Attachment", 31 | "esriNSSPSupportsContainment": "SupportsContainment", 32 | "esriNSSPSupportsStructuralAttachments": "SupportsStructuralAttachments", 33 | "esriNSSPSupportsCategories": "SupportsCategories", 34 | "esriNSSPSupportsNetworkAttributes": "SupportsNetworkAttributes", 35 | "esriNSSPSupportsTerminals": "SupportsTerminals", 36 | "esriNSSPSupportsNone": "SupportsNone", 37 | "esriADTCascade": "Cascade", 38 | "esriADTRestricted": "Restricted", 39 | "esriADTSetToNone": "SetToNone", 40 | "esriARTNone": "None", 41 | "esriARTContainer": "Container", 42 | "esriARTStructure": "Structure", 43 | "esriNECPEndVertex": "EndVertex", 44 | "esriNECPAnyVertex": "AnyVertex", 45 | "esriNADTInteger": "Integer", 46 | "esriNADTDouble": "Double", 47 | "esriUNAUTSourceID": "SourceID", 48 | "esriUNAUTTerminalID": "TerminalID", 49 | "esriUNAUTAssetGroup": "AssetGroup", 50 | "esriUNAUTAssetType": "AssetType", 51 | "esriUNAUTIsSubnetworkController": "IsSubnetworkController", 52 | "esriUNAUTTierRank": "TierRank", 53 | "esriUNAUTTierName": "TierName", 54 | "esriUNAUTShapeLength": "ShapeLength", 55 | "esriUNAUTPositionFrom": "PositionFrom", 56 | "esriUNAUTPositionTo": "PositionTo", 57 | "esriUNAUTFlowDirection": "FlowDirection", 58 | "esriUNAUTUnknown": "Unknown", 59 | "esriTSJunctionsAndEdges": "JunctionsAndEdges", 60 | "esriTSJunctions": "Junctions", 61 | "esriTSEdges": "Edges", 62 | "esriCTNetworkAttribute": "NetworkAttribute", 63 | "esriCTCategory": "Category", 64 | "esriFTNetworkAttribute": false, 65 | "esriFTSpecificValue": true, 66 | "esriCUAnd": false, 67 | "esriCUOr": true, 68 | "esriCSPSplit": true, 69 | "esriCSPDoNotSplit": false, 70 | "esriTOEqual": "Equal", 71 | "esriTONotEqual": "NotEqual", 72 | "esriTOLessThan": "LessThan", 73 | "esriTOLessThanEqual": "LessThanEqual", 74 | "esriTOGreaterThan": "GreaterThan", 75 | "esriTOGreaterThanEqual": "GreaterThanEqual", 76 | "esriTOIncludesAny": "IncludesAny", 77 | "esriTODoesNotIncludeAny": "DoesNotIncludeAny", 78 | "esriTOIncludesTheValues": "IncludesTheValues", 79 | "esriTODoesNotIncludeTheValues": "DoesNotIncludeTheValues", 80 | "esriTFTAdd": "Add", 81 | "esriTFTSubtract": "Subtract", 82 | "esriTFTCount": "Count", 83 | "esriTFTAverage": "Average", 84 | "esriTFTMax": "Max", 85 | "esriTFTMin": "Min", 86 | "esriTPFTBitwiseAnd": "BitwiseAnd", 87 | "esriTPFTMax": "Max", 88 | "esriTPFTMin": "Min", 89 | "esriUNTMBidirectional": "Bidirectional", 90 | "esriUNTMDirectional": "Directional", 91 | "esriFieldTypeOID": "OID", 92 | "esriFieldTypeGeometry": "Geometry", 93 | "esriFieldTypeSmallInteger": "SmallInteger", 94 | "esriFieldTypeInteger": "Integer", 95 | "esriFieldTypeSingle": "Single", 96 | "esriFieldTypeDouble": "Double", 97 | "esriFieldTypeDate": "Date", 98 | "esriFieldTypeString": "String", 99 | "esriFieldTypeBlob": "Blob", 100 | "esriFieldTypeGUID": "Guid", 101 | "esriFieldTypeRaster": "Raster", 102 | "esriFieldTypeGlobalID": "GlobalID", 103 | "esriFieldTypeXML": "XML", 104 | "esriARTCalculation": "Calculation", 105 | "esriARTValidation": "Validation", 106 | "esriARTConstraint": "Constraint", 107 | "esriARTEInsert": "Insert", 108 | "esriARTEUpdate": "Update", 109 | "esriARTEDelete": "Delete", 110 | "esriDTCodedValue": "CodedValue", 111 | "esriDTRange": "Range", 112 | "esriMPTDefaultValue": "DefaultValue", 113 | "esriMPTSumValues": "SumValues", 114 | "esriMPTAreaWeighted": "AreaWeighted", 115 | "esriSPTDefaultValue": "DefaultValue", 116 | "esriSPTDuplicate": "Duplicate", 117 | "esriSPTGeometryRatio": "GeometryRatio", 118 | "esriGeometryPoint": "Point", 119 | "esriGeometryPolyline": "Line", 120 | "esriGeometryPolygon": "Polygon", 121 | "esriGeometryMultipoint": "Multipoint", 122 | "esriGeometryMultiPatch": "MultiPath", 123 | "esriGeometryNull": "Null", 124 | "esriFTSimple": "Simple", 125 | "esriFTAnnotation": "Annotation", 126 | "esriFTDimension": "Dimension", 127 | "esriDTTable": "Table", 128 | "esriDTFeatureClass": "FeatureClass", 129 | "esriDTFeatureDataset": "FeatureDataset", 130 | "esriDTRelationshipClass": "RelationshipClass", 131 | "esriDTUtilityNetwork": "UtilityNetwork", 132 | "esriDTGeometricNetwork": "GeometricNetwork", 133 | "esriRelCardinalityOneToOne": "OneToOne", 134 | "esriRelCardinalityOneToMany": "OneToMany", 135 | "esriRelCardinalityManyToMany": "ManyToMany", 136 | "esriRelClassKeyClassCode": "ClassCode", 137 | "esriRelClassKeyClassID": "ClassID", 138 | "esriRelClassKeyUndefined": "Undefined", 139 | "esriRelKeyRoleDestinationForeign": "DestinationForeign", 140 | "esriRelKeyRoleDestinationPrimary": "DestinationPrimary", 141 | "esriRelKeyRoleOriginForeign": "OriginForeign", 142 | "esriRelKeyRoleOriginPrimary": "OriginPrimary", 143 | "esriRelKeyTypeSingle": "Single", 144 | "esriRelKeyTypeDual": "Dual", 145 | "esriRelNotificationBackward": "Backward", 146 | "esriRelNotificationForward": "Forward", 147 | "esriRelNotificationBoth": "Both", 148 | "esriRelNotificationNone": "None", 149 | "esriLocalDatabaseWorkspace": "LocalDatabase", 150 | "esriRemoteDatabaseWorkspace": "RemoteDatabase" 151 | } 152 | -------------------------------------------------------------------------------- /service-explorer/src/runtime/assets/wab1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Esri/solutions-data-dictionary-viewer/bd2ed3431b85e4a28f6e2b83cd96257bab48796f/service-explorer/src/runtime/assets/wab1.jpg -------------------------------------------------------------------------------- /service-explorer/src/runtime/assets/webapp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Esri/solutions-data-dictionary-viewer/bd2ed3431b85e4a28f6e2b83cd96257bab48796f/service-explorer/src/runtime/assets/webapp.png -------------------------------------------------------------------------------- /service-explorer/src/runtime/css/custom.css: -------------------------------------------------------------------------------- 1 | .customScrollStyle::-webkit-scrollbar-track { 2 | border: 1px solid #fff; 3 | padding: 2px 0; 4 | background-color: #fff; 5 | } 6 | 7 | .customScrollStyle::-webkit-scrollbar { 8 | width: 10px; 9 | } 10 | 11 | .customScrollStyle::-webkit-scrollbar-thumb { 12 | border-radius: 10px; 13 | box-shadow: inset 0 0 6px rgba(255,255,255,1); 14 | background-color: #fff; 15 | border: 1px solid #fff; 16 | } 17 | 18 | .navbar-header { 19 | background-color: #F16E10; 20 | } 21 | 22 | .stagePanel { 23 | padding-Left:5; 24 | width:760; 25 | overflow-X:"auto"; 26 | overflow-Y:"auto"; 27 | background-Color:"#efefef"; 28 | border:2; 29 | border-Color:"#aaa"; 30 | border-Style:"dashed"; 31 | display:"inline-block" 32 | } 33 | 34 | .btn-link { 35 | font-weight: 400; 36 | color: #315dfc; 37 | background-color: transparent; 38 | } 39 | 40 | .btn { 41 | display: inline-flex; 42 | align-items: center; 43 | justify-content: center; 44 | font-size: 1rem; 45 | -webkit-appearance: none; 46 | text-align: center; 47 | white-space: nowrap; 48 | vertical-align: middle; 49 | user-select: none; 50 | border: 1px solid transparent; 51 | padding: 0.3125rem 1rem; 52 | line-height: 1.5; 53 | border-radius: 0.125rem; 54 | transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out; 55 | } 56 | 57 | .list-group-item { 58 | position: relative; 59 | display: block; 60 | padding: 0.75rem 1rem; 61 | margin-bottom: -1px; 62 | background-color: #fff; 63 | border: 1px solid #cfdbe7; 64 | } 65 | 66 | .list-group-item:hover, .list-group-item:focus { 67 | text-decoration: none; 68 | } 69 | 70 | table { 71 | border-collapse: collapse; 72 | } 73 | 74 | table { 75 | display: table; 76 | border-collapse: separate; 77 | border-color: grey; 78 | } 79 | 80 | .table { 81 | width: 100%; 82 | margin-bottom: 1rem; 83 | background-color: transparent; 84 | } 85 | 86 | .table tr:hover { 87 | background-color: #c1c1c1; 88 | } 89 | 90 | .table th, .table td { 91 | padding: 0.75rem 1.25rem; 92 | vertical-align: top; 93 | border-top: 1px solid #cfdbe7; 94 | } 95 | 96 | .table thead th { 97 | font-weight: 400; 98 | font-size: 1.25rem; 99 | color: inherit; 100 | background-color: #edf0f4; 101 | border-bottom-width: 1px; 102 | line-height: 1.25; 103 | } 104 | 105 | .table th, .table td { 106 | padding: 0.75rem 1.25rem; 107 | vertical-align: top; 108 | border-top: 1px solid #cfdbe7; 109 | } 110 | 111 | .searchOptionDivNode { 112 | display: inline-block; 113 | padding-bottom: 5px; 114 | } 115 | 116 | .popOverBG { 117 | background-color: #fff; 118 | border: 2px solid #cfdbe7; 119 | } 120 | 121 | .leftRightPadder5 { 122 | padding-left: 5px; 123 | padding-right: 5px; 124 | } 125 | 126 | .leftRightPadder10 { 127 | padding-left: 10px; 128 | padding-right: 10px; 129 | } 130 | 131 | .relationshipTableStyleHeader { 132 | font-weight:bold; 133 | padding:10px; 134 | border-spacing:0px; 135 | border-bottom:thin solid #c1c1c1; 136 | } 137 | 138 | .relationshipTableStyle { 139 | padding:10px; 140 | border-spacing:0px; 141 | border-bottom: thin solid #c1c1c1; 142 | } 143 | 144 | .paddingTopBottom5 { 145 | padding-Top: 5px; 146 | padding-Bottom: 5px 147 | } 148 | 149 | .linkPointer { 150 | cursor:"pointer"; 151 | } -------------------------------------------------------------------------------- /service-explorer/src/runtime/css/relationshipClass.scss: -------------------------------------------------------------------------------- 1 | @import 'jimu-ui/lib/style/variables'; 2 | 3 | .widget-demo{ 4 | width: 100%; 5 | height: 100%; 6 | overflow: auto; 7 | 8 | .title{ 9 | font-weight: bold; 10 | } 11 | } -------------------------------------------------------------------------------- /service-explorer/src/runtime/css/style.scss: -------------------------------------------------------------------------------- 1 | @import 'jimu-ui/lib/style/variables'; 2 | 3 | .widget-demo{ 4 | width: 100%; 5 | height: 100%; 6 | overflow: auto; 7 | position: relative; 8 | 9 | .title{ 10 | font-weight: bold; 11 | } 12 | 13 | } -------------------------------------------------------------------------------- /service-explorer/src/runtime/translations/default.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | _widgetLabel: 'Service Explorer', 3 | widgetProperties: 'Widget Properties', 4 | widgetFunctions: 'Widget Functions', 5 | widgetName: 'widget name:', 6 | widgetProps: 'widget props:' 7 | } 8 | -------------------------------------------------------------------------------- /service-explorer/src/runtime/translations/zh-cn.js: -------------------------------------------------------------------------------- 1 | define({ 2 | _widgetLabel: "示例", 3 | "widgetProperties": "组件属性", 4 | "widgetFunctions": "组件功能", 5 | "widgetName": "名称:", 6 | "widgetProps": "属性:" 7 | }); 8 | -------------------------------------------------------------------------------- /service-explorer/src/setting/translations/default.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | url: 'Feature Service URL', 3 | urlLookup: 'Allow loading Feature Service by url parameter (lookup)', 4 | useCache: 'Use cache instead of live service', 5 | cachePath: 'Location of files to read into this widget', 6 | cacheName: 'Name of the cache', 7 | cacheBuild: 'Build the cache', 8 | sectionHeadingService: 'Select a service', 9 | sectionHeadingCache: 'Cache the service', 10 | sectionHeadingUrlLookup: 'Allow url lookup' 11 | } 12 | -------------------------------------------------------------------------------- /service-explorer/src/setting/translations/zh-cn.js: -------------------------------------------------------------------------------- 1 | define({ 2 | p1: '属性1', 3 | p2: '属性2' 4 | }); 5 | -------------------------------------------------------------------------------- /service-explorer/tests/widget.test.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | import { shallow, configure, ShallowWrapper, mount } from 'enzyme'; 3 | 4 | import _Widget from '../src/runtime/widget'; 5 | import {wrapWidget} from 'jimu-for-test'; 6 | 7 | // setup file 8 | import * as Adapter from 'enzyme-adapter-react-16'; 9 | 10 | configure({ adapter: new Adapter() }); 11 | 12 | describe('demo widget', function() { 13 | it('with config', function() { 14 | const config = { 15 | p1: 'p1', 16 | p2: 'p2' 17 | }; 18 | let Widget = wrapWidget(_Widget, { 19 | config: config, 20 | manifest: {name: 'demo'} as any, 21 | messages: {}, 22 | }); 23 | let wrapper = shallow().shallow(); 24 | expect(wrapper.find('.widget-demo').length).toEqual(1); 25 | }); 26 | 27 | it('without config', function() { 28 | let Widget = wrapWidget(_Widget, { 29 | manifest: {name: 'demo'} as any, 30 | messages: {}, 31 | }); 32 | let wrapper = shallow().shallow(); 33 | expect(wrapper.find('.widget-demo').length).toEqual(1); 34 | }); 35 | }); --------------------------------------------------------------------------------