From c5b8756512cb6dfbb0093514af7924cb3e78699b Mon Sep 17 00:00:00 2001 From: Ravi Pendurty Date: Tue, 19 Dec 2023 17:13:25 +0530 Subject: Delete wt/odlux directory New directory for odlux is sdnr/wt-odlux Issue-ID: CCSDK-3971 Change-Id: Ia0f8ba38d913a3d3bcde999b871794c65d5e575e Signed-off-by: Ravi Pendurty --- sdnr/wt/odlux/apps/maintenanceApp/.babelrc | 17 -- sdnr/wt/odlux/apps/maintenanceApp/package.json | 46 ---- sdnr/wt/odlux/apps/maintenanceApp/pom.xml | 159 ------------- .../src/actions/maintenenceActions.ts | 77 ------- .../src/assets/icons/maintenanceAppIcon.svg | 50 ----- .../src/components/editMaintenenceEntryDialog.tsx | 207 ----------------- .../src/components/refreshMaintenanceEntries.tsx | 113 ---------- .../src/handlers/maintenanceAppRootHandler.ts | 39 ---- .../src/handlers/maintenanceEntriesHandler.ts | 35 --- sdnr/wt/odlux/apps/maintenanceApp/src/index.html | 26 --- .../src/models/maintenanceEntryType.ts | 33 --- .../apps/maintenanceApp/src/pluginMaintenance.tsx | 44 ---- .../src/services/maintenenceService.ts | 72 ------ .../apps/maintenanceApp/src/utils/timeUtils.ts | 45 ---- .../maintenanceApp/src/views/maintenanceView.tsx | 246 --------------------- .../sdnr/wt/odlux/bundles/MyOdluxBundle.java | 68 ------ .../resources/OSGI-INF/blueprint/blueprint.xml | 30 --- .../sdnr/wt/odlux/bundles/test/TestBundleRes.java | 46 ---- .../maintenanceApp/src2/test/resources/test.js | 5 - sdnr/wt/odlux/apps/maintenanceApp/tsconfig.json | 37 ---- .../wt/odlux/apps/maintenanceApp/webpack.config.js | 168 -------------- 21 files changed, 1563 deletions(-) delete mode 100644 sdnr/wt/odlux/apps/maintenanceApp/.babelrc delete mode 100644 sdnr/wt/odlux/apps/maintenanceApp/package.json delete mode 100644 sdnr/wt/odlux/apps/maintenanceApp/pom.xml delete mode 100644 sdnr/wt/odlux/apps/maintenanceApp/src/actions/maintenenceActions.ts delete mode 100644 sdnr/wt/odlux/apps/maintenanceApp/src/assets/icons/maintenanceAppIcon.svg delete mode 100644 sdnr/wt/odlux/apps/maintenanceApp/src/components/editMaintenenceEntryDialog.tsx delete mode 100644 sdnr/wt/odlux/apps/maintenanceApp/src/components/refreshMaintenanceEntries.tsx delete mode 100644 sdnr/wt/odlux/apps/maintenanceApp/src/handlers/maintenanceAppRootHandler.ts delete mode 100644 sdnr/wt/odlux/apps/maintenanceApp/src/handlers/maintenanceEntriesHandler.ts delete mode 100644 sdnr/wt/odlux/apps/maintenanceApp/src/index.html delete mode 100644 sdnr/wt/odlux/apps/maintenanceApp/src/models/maintenanceEntryType.ts delete mode 100644 sdnr/wt/odlux/apps/maintenanceApp/src/pluginMaintenance.tsx delete mode 100644 sdnr/wt/odlux/apps/maintenanceApp/src/services/maintenenceService.ts delete mode 100644 sdnr/wt/odlux/apps/maintenanceApp/src/utils/timeUtils.ts delete mode 100644 sdnr/wt/odlux/apps/maintenanceApp/src/views/maintenanceView.tsx delete mode 100644 sdnr/wt/odlux/apps/maintenanceApp/src2/main/java/org/onap/ccsdk/features/sdnr/wt/odlux/bundles/MyOdluxBundle.java delete mode 100644 sdnr/wt/odlux/apps/maintenanceApp/src2/main/resources/OSGI-INF/blueprint/blueprint.xml delete mode 100644 sdnr/wt/odlux/apps/maintenanceApp/src2/test/java/org/onap/ccsdk/features/sdnr/wt/odlux/bundles/test/TestBundleRes.java delete mode 100644 sdnr/wt/odlux/apps/maintenanceApp/src2/test/resources/test.js delete mode 100644 sdnr/wt/odlux/apps/maintenanceApp/tsconfig.json delete mode 100644 sdnr/wt/odlux/apps/maintenanceApp/webpack.config.js (limited to 'sdnr/wt/odlux/apps/maintenanceApp') diff --git a/sdnr/wt/odlux/apps/maintenanceApp/.babelrc b/sdnr/wt/odlux/apps/maintenanceApp/.babelrc deleted file mode 100644 index 3d8cd1260..000000000 --- a/sdnr/wt/odlux/apps/maintenanceApp/.babelrc +++ /dev/null @@ -1,17 +0,0 @@ -{ - "presets": [ - ["@babel/preset-react"], - ["@babel/preset-env", { - "targets": { - "chrome": "66" - }, - "spec": true, - "loose": false, - "modules": false, - "debug": false, - "useBuiltIns": "usage", - "forceAllTransforms": true - }] - ], - "plugins": [] -} diff --git a/sdnr/wt/odlux/apps/maintenanceApp/package.json b/sdnr/wt/odlux/apps/maintenanceApp/package.json deleted file mode 100644 index d7c325409..000000000 --- a/sdnr/wt/odlux/apps/maintenanceApp/package.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "name": "@odlux/maintenance-app", - "version": "0.1.0", - "description": "A react based modular UI for the maintenance app.", - "main": "index.js", - "scripts": { - "start": "webpack-dev-server --env debug", - "build": "webpack --env release --config webpack.config.js", - "build:dev": "webpack --env debug --config webpack.config.js" - }, - "repository": { - "type": "git", - "url": "https://git.mfico.de/highstreet-technologies/odlux.git" - }, - "keywords": [ - "reactjs", - "redux", - "ui", - "framework" - ], - "author": "Matthias Fischer", - "license": "Apache-2.0", - "dependencies": { - "@emotion/react": "^11.7.0", - "@emotion/styled": "^11.6.0", - "@mui/icons-material": "^5.2.0", - "@mui/material": "^5.2.2", - "@mui/styles": "^5.2.2", - "@odlux/connect-app": "*", - "@odlux/framework": "*" - }, - "peerDependencies": { - "@types/classnames": "2.2.6", - "@types/flux": "3.1.8", - "@types/jquery": "3.3.10", - "@types/react": "17.0.37", - "@types/react-dom": "17.0.11", - "@types/react-router-dom": "5.1.7", - "jquery": "3.3.1", - "react": "17.0.2", - "react-dom": "17.0.2", - "react-router-dom": "5.2.0", - "@fortawesome/free-solid-svg-icons": "5.6.3", - "@fortawesome/react-fontawesome": "0.1.14" - } -} diff --git a/sdnr/wt/odlux/apps/maintenanceApp/pom.xml b/sdnr/wt/odlux/apps/maintenanceApp/pom.xml deleted file mode 100644 index 84ca56839..000000000 --- a/sdnr/wt/odlux/apps/maintenanceApp/pom.xml +++ /dev/null @@ -1,159 +0,0 @@ - - - - 4.0.0 - - - org.onap.ccsdk.parent - binding-parent - 2.6.1 - - - - org.onap.ccsdk.features.sdnr.wt - sdnr-wt-odlux-app-maintenanceApp - 1.7.0-SNAPSHOT - bundle - - ccsdk-features :: ${project.artifactId} - - - Apache License, Version 2.0 - http://www.apache.org/licenses/LICENSE-2.0 - - - - - true - - - - - ${project.groupId} - sdnr-wt-odlux-core-model - ${project.version} - - - ${project.groupId} - sdnr-wt-odlux-core-provider - ${project.version} - test - - - junit - junit - test - - - - - src2/main/java - - - dist - odlux - - - src2/main/resources - - - src2/test/resources - - - - - maven-clean-plugin - - - - dist - false - - - node - false - - - node_modules - false - - - ../node_modules - false - - - - bin - false - - - - - - org.codehaus.mojo - build-helper-maven-plugin - - - add-test-source - generate-test-sources - - add-test-source - - - - src2/test/java - - - - - - - de.jacks-it-lab - frontend-maven-plugin - 1.7.2 - - - install node and yarn - - install-node-and-yarn - - - initialize - - v16.17.0 - v1.22.19 - - - - yarn build - - yarn - - - run build - - - - - - - diff --git a/sdnr/wt/odlux/apps/maintenanceApp/src/actions/maintenenceActions.ts b/sdnr/wt/odlux/apps/maintenanceApp/src/actions/maintenenceActions.ts deleted file mode 100644 index 740abff85..000000000 --- a/sdnr/wt/odlux/apps/maintenanceApp/src/actions/maintenenceActions.ts +++ /dev/null @@ -1,77 +0,0 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions */ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ -import { AddSnackbarNotification } from '../../../../framework/src/actions/snackbarActions'; -import { Action } from '../../../../framework/src/flux/action'; -import { Dispatch } from '../../../../framework/src/flux/store'; - -import { maintenanceEntriesReloadAction } from '../handlers/maintenanceEntriesHandler'; -import { MaintenanceEntry, spoofSymbol } from '../models/maintenanceEntryType'; -import { maintenenceService } from '../services/maintenenceService'; - -export class BaseAction extends Action { } - -export class LoadAllMainteneceEntriesAction extends BaseAction { } - -export class AllMainteneceEntriesLoadedAction extends BaseAction { - - constructor(public maintenenceEntries: MaintenanceEntry[] | null) { - super(); - - } -} - - -export class UpdateMaintenanceEntry extends BaseAction { - constructor(public maintenenceEntry: MaintenanceEntry) { - super(); - } -} - -/** Represents an async thunk action creator to add an element to the maintenence entries. */ -export const addOrUpdateMaintenenceEntryAsyncActionCreator = (entry: MaintenanceEntry) => (dispatch: Dispatch) => { - maintenenceService.writeMaintenenceEntry(entry).then(result => { - result && window.setTimeout(() => { - // dispatch(loadAllMountedNetworkElementsAsync); - dispatch(new UpdateMaintenanceEntry(entry)); - dispatch(new AddSnackbarNotification({ message: `Successfully ${result && result.created ? 'created' : 'updated'} maintenance settings for [${entry.nodeId}]`, options: { variant: 'success' } })); - }, 900); - dispatch(maintenanceEntriesReloadAction); - }); -}; - -/** Represents an async thunk action creator to delete an element from the maintenence entries. */ -export const removeFromMaintenenceEntrysAsyncActionCreator = (entry: MaintenanceEntry) => (dispatch: Dispatch) => { - maintenenceService.deleteMaintenenceEntry(entry).then(result => { - result && window.setTimeout(() => { - dispatch(new UpdateMaintenanceEntry({ - [spoofSymbol]: true, - mId: entry.mId, - nodeId: entry.nodeId, - description: '', - start: '', - end: '', - active: false, - })); - dispatch(new AddSnackbarNotification({ message: `Successfully removed [${entry.nodeId}]`, options: { variant: 'success' } })); - }, 900); - dispatch(maintenanceEntriesReloadAction); - }); -}; - -// Hint: since there is no notification of changed required network elements, this code is not aware of changes caused outiside of this browser. \ No newline at end of file diff --git a/sdnr/wt/odlux/apps/maintenanceApp/src/assets/icons/maintenanceAppIcon.svg b/sdnr/wt/odlux/apps/maintenanceApp/src/assets/icons/maintenanceAppIcon.svg deleted file mode 100644 index 8b99a5e7f..000000000 --- a/sdnr/wt/odlux/apps/maintenanceApp/src/assets/icons/maintenanceAppIcon.svg +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - - - diff --git a/sdnr/wt/odlux/apps/maintenanceApp/src/components/editMaintenenceEntryDialog.tsx b/sdnr/wt/odlux/apps/maintenanceApp/src/components/editMaintenenceEntryDialog.tsx deleted file mode 100644 index 9ab147ca7..000000000 --- a/sdnr/wt/odlux/apps/maintenanceApp/src/components/editMaintenenceEntryDialog.tsx +++ /dev/null @@ -1,207 +0,0 @@ -/* eslint-disable @typescript-eslint/no-unused-expressions */ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ -import * as React from 'react'; - -import Button from '@mui/material/Button'; -import Dialog from '@mui/material/Dialog'; -import DialogActions from '@mui/material/DialogActions'; -import DialogContent from '@mui/material/DialogContent'; -import DialogContentText from '@mui/material/DialogContentText'; -import DialogTitle from '@mui/material/DialogTitle'; -import TextField from '@mui/material/TextField'; - -import { connect, Connect, IDispatcher } from '../../../../framework/src/flux/connect'; - -import { FormControl, InputLabel, MenuItem, Select, Typography } from '@mui/material'; -import { - addOrUpdateMaintenenceEntryAsyncActionCreator, - removeFromMaintenenceEntrysAsyncActionCreator, -} from '../actions/maintenenceActions'; -import { MaintenanceEntry } from '../models/maintenanceEntryType'; - -export enum EditMaintenenceEntryDialogMode { - None = 'none', - AddMaintenenceEntry = 'addMaintenenceEntry', - EditMaintenenceEntry = 'editMaintenenceEntry', - RemoveMaintenenceEntry = 'removeMaintenenceEntry', -} - -const mapDispatch = (dispatcher: IDispatcher) => ({ - addOrUpdateMaintenenceEntry: (entry: MaintenanceEntry) => { - dispatcher.dispatch(addOrUpdateMaintenenceEntryAsyncActionCreator(entry)); - }, - removeMaintenenceEntry: (entry: MaintenanceEntry) => { - dispatcher.dispatch(removeFromMaintenenceEntrysAsyncActionCreator(entry)); - }, -}); - -type DialogSettings = { - dialogTitle: string; - dialogDescription: string; - applyButtonText: string; - cancelButtonText: string; - enableMountIdEditor: boolean; - enableTimeEditor: boolean; -}; - -const settings: { [key: string]: DialogSettings } = { - [EditMaintenenceEntryDialogMode.None]: { - dialogTitle: '', - dialogDescription: '', - applyButtonText: '', - cancelButtonText: '', - enableMountIdEditor: false, - enableTimeEditor: false, - }, - [EditMaintenenceEntryDialogMode.AddMaintenenceEntry]: { - dialogTitle: 'Add new maintenence entry', - dialogDescription: '', - applyButtonText: 'Add', - cancelButtonText: 'Cancel', - enableMountIdEditor: true, - enableTimeEditor: true, - }, - [EditMaintenenceEntryDialogMode.EditMaintenenceEntry]: { - dialogTitle: 'Edit maintenence entry', - dialogDescription: '', - applyButtonText: 'Save', - cancelButtonText: 'Cancel', - enableMountIdEditor: false, - enableTimeEditor: true, - }, - [EditMaintenenceEntryDialogMode.RemoveMaintenenceEntry]: { - dialogTitle: 'Remove maintenence entry', - dialogDescription: '', - applyButtonText: 'Remove', - cancelButtonText: 'Cancel', - enableMountIdEditor: false, - enableTimeEditor: false, - }, -}; - -type EditMaintenenceEntryDIalogComponentProps = Connect & { - mode: EditMaintenenceEntryDialogMode; - initialMaintenenceEntry: MaintenanceEntry; - onClose: () => void; -}; - -type EditMaintenenceEntryDIalogComponentState = MaintenanceEntry & { isErrorVisible: boolean }; - -class EditMaintenenceEntryDIalogComponent extends React.Component { - constructor(props: EditMaintenenceEntryDIalogComponentProps) { - super(props); - - this.state = { - ...this.props.initialMaintenenceEntry, - isErrorVisible: false, - }; - } - - render(): JSX.Element { - const setting = settings[this.props.mode]; - return ( - - {setting.dialogTitle} - - - {setting.dialogDescription} - - { this.setState({ nodeId: event.target.value }); }} /> - {this.state.isErrorVisible && Name must not be empty.} - { this.setState({ start: event.target.value }); }} /> - { this.setState({ end: event.target.value }); }} /> - - Active - - - - - - - - - ); - } - - private onApply = (entry: MaintenanceEntry) => { - this.props.onClose && this.props.onClose(); - switch (this.props.mode) { - case EditMaintenenceEntryDialogMode.AddMaintenenceEntry: - entry && this.props.addOrUpdateMaintenenceEntry(entry); - break; - case EditMaintenenceEntryDialogMode.EditMaintenenceEntry: - entry && this.props.addOrUpdateMaintenenceEntry(entry); - break; - case EditMaintenenceEntryDialogMode.RemoveMaintenenceEntry: - entry && this.props.removeMaintenenceEntry(entry); - break; - } - }; - - - private onCancel = () => { - this.props.onClose && this.props.onClose(); - }; - - static getDerivedStateFromProps(props: EditMaintenenceEntryDIalogComponentProps, state: EditMaintenenceEntryDIalogComponentState & { initialMaintenenceEntrie: MaintenanceEntry }): EditMaintenenceEntryDIalogComponentState & { initialMaintenenceEntrie: MaintenanceEntry } { - if (props.initialMaintenenceEntry !== state.initialMaintenenceEntrie) { - // eslint-disable-next-line no-param-reassign - state = { - ...state, - ...props.initialMaintenenceEntry, - initialMaintenenceEntrie: props.initialMaintenenceEntry, - }; - } - return state; - } - -} - -export const EditMaintenenceEntryDIalog = connect(undefined, mapDispatch)(EditMaintenenceEntryDIalogComponent); -export default EditMaintenenceEntryDIalog; \ No newline at end of file diff --git a/sdnr/wt/odlux/apps/maintenanceApp/src/components/refreshMaintenanceEntries.tsx b/sdnr/wt/odlux/apps/maintenanceApp/src/components/refreshMaintenanceEntries.tsx deleted file mode 100644 index e8bd635dd..000000000 --- a/sdnr/wt/odlux/apps/maintenanceApp/src/components/refreshMaintenanceEntries.tsx +++ /dev/null @@ -1,113 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ -import * as React from 'react'; - -import Button from '@mui/material/Button'; -import Dialog from '@mui/material/Dialog'; -import DialogActions from '@mui/material/DialogActions'; -import DialogContent from '@mui/material/DialogContent'; -import DialogContentText from '@mui/material/DialogContentText'; -import DialogTitle from '@mui/material/DialogTitle'; - -import { connect, Connect, IDispatcher } from '../../../../framework/src/flux/connect'; - -import { maintenanceEntriesReloadAction } from '../handlers/maintenanceEntriesHandler'; -import { MaintenanceEntry } from '../models/maintenanceEntryType'; - -export enum RefreshMaintenanceEntriesDialogMode { - None = 'none', - RefreshMaintenanceEntriesTable = 'RefreshMaintenanceEntriesTable', -} - -const mapDispatch = (dispatcher: IDispatcher) => ({ - refreshMaintenanceEntries: () => dispatcher.dispatch(maintenanceEntriesReloadAction), -}); - -type DialogSettings = { - dialogTitle: string; - dialogDescription: string; - applyButtonText: string; - cancelButtonText: string; - enableMountIdEditor: boolean; - enableUsernameEditor: boolean; - enableExtendedEditor: boolean; -}; - -const settings: { [key: string]: DialogSettings } = { - [RefreshMaintenanceEntriesDialogMode.None]: { - dialogTitle: '', - dialogDescription: '', - applyButtonText: '', - cancelButtonText: '', - enableMountIdEditor: false, - enableUsernameEditor: false, - enableExtendedEditor: false, - }, - [RefreshMaintenanceEntriesDialogMode.RefreshMaintenanceEntriesTable]: { - dialogTitle: 'Do you want to refresh Maintenance Entries?', - dialogDescription: '', - applyButtonText: 'Yes', - cancelButtonText: 'Cancel', - enableMountIdEditor: true, - enableUsernameEditor: true, - enableExtendedEditor: true, - }, -}; - -type RefreshMaintenanceEntriesDialogComponentProps = Connect & { - mode: RefreshMaintenanceEntriesDialogMode; - onClose: () => void; -}; - -type RefreshMaintenanceEntriesDialogComponentState = MaintenanceEntry & { isNameValid: boolean; isHostSet: boolean }; - -class RefreshMaintenanceEntriesDialogComponent extends React.Component { - render(): JSX.Element { - const setting = settings[this.props.mode]; - return ( - - {setting.dialogTitle} - - - {setting.dialogDescription} - - - - - - - - ); - } - - private onRefresh = () => { - this.props.refreshMaintenanceEntries(); - this.props.onClose(); - }; - - private onCancel = () => { - this.props.onClose(); - }; -} - -export const RefreshMaintenanceEntriesDialog = connect(undefined, mapDispatch)(RefreshMaintenanceEntriesDialogComponent); -export default RefreshMaintenanceEntriesDialog; \ No newline at end of file diff --git a/sdnr/wt/odlux/apps/maintenanceApp/src/handlers/maintenanceAppRootHandler.ts b/sdnr/wt/odlux/apps/maintenanceApp/src/handlers/maintenanceAppRootHandler.ts deleted file mode 100644 index ced7f2160..000000000 --- a/sdnr/wt/odlux/apps/maintenanceApp/src/handlers/maintenanceAppRootHandler.ts +++ /dev/null @@ -1,39 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ -// main state handler - -import { combineActionHandler } from '../../../../framework/src/flux/middleware'; - -import { IMaintenanceEntriesState, maintenanceEntriesActionHandler } from './maintenanceEntriesHandler'; - -export interface IMaintenanceAppStoreState { - maintenanceEntries : IMaintenanceEntriesState; -} - -declare module '../../../../framework/src/store/applicationStore' { - interface IApplicationStoreState { - maintenance: IMaintenanceAppStoreState; - } -} - -const actionHandlers = { - maintenanceEntries: maintenanceEntriesActionHandler, -}; - -export const maintenanceAppRootHandler = combineActionHandler(actionHandlers); -export default maintenanceAppRootHandler; diff --git a/sdnr/wt/odlux/apps/maintenanceApp/src/handlers/maintenanceEntriesHandler.ts b/sdnr/wt/odlux/apps/maintenanceApp/src/handlers/maintenanceEntriesHandler.ts deleted file mode 100644 index c3fe51e80..000000000 --- a/sdnr/wt/odlux/apps/maintenanceApp/src/handlers/maintenanceEntriesHandler.ts +++ /dev/null @@ -1,35 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ -import { createExternal, IExternalTableState } from '../../../../framework/src/components/material-table/utilities'; -import { createSearchDataHandler } from '../../../../framework/src/utilities/elasticSearch'; - -import { MaintenanceEntry } from '../models/maintenanceEntryType'; -export interface IMaintenanceEntriesState extends IExternalTableState { } - -// create elastic search material data fetch handler -const maintenanceEntriesSearchHandler = createSearchDataHandler('maintenance'); - -export const { - actionHandler: maintenanceEntriesActionHandler, - createActions: createmaintenanceEntriesActions, - createProperties: createmaintenanceEntriesProperties, - reloadAction: maintenanceEntriesReloadAction, - - // set value action, to change a value -} = createExternal(maintenanceEntriesSearchHandler, appState => appState.maintenance.maintenanceEntries); - diff --git a/sdnr/wt/odlux/apps/maintenanceApp/src/index.html b/sdnr/wt/odlux/apps/maintenanceApp/src/index.html deleted file mode 100644 index c84aecee1..000000000 --- a/sdnr/wt/odlux/apps/maintenanceApp/src/index.html +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - Minimal App - - - -
- - - - - - \ No newline at end of file diff --git a/sdnr/wt/odlux/apps/maintenanceApp/src/models/maintenanceEntryType.ts b/sdnr/wt/odlux/apps/maintenanceApp/src/models/maintenanceEntryType.ts deleted file mode 100644 index 27cdc8c12..000000000 --- a/sdnr/wt/odlux/apps/maintenanceApp/src/models/maintenanceEntryType.ts +++ /dev/null @@ -1,33 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ -/** Represents the elestic search db type for maintenence enrties */ - - -export const spoofSymbol = Symbol('Spoof'); - -/** Represents the type for an maintenence entry. */ -export type MaintenanceEntry = { - mId: string; - nodeId: string; - description?: string; - end: string; - start: string; - active: boolean; - [spoofSymbol]?: boolean; -}; - diff --git a/sdnr/wt/odlux/apps/maintenanceApp/src/pluginMaintenance.tsx b/sdnr/wt/odlux/apps/maintenanceApp/src/pluginMaintenance.tsx deleted file mode 100644 index 0f686cb84..000000000 --- a/sdnr/wt/odlux/apps/maintenanceApp/src/pluginMaintenance.tsx +++ /dev/null @@ -1,44 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ -// app configuration and main entry point for the app - -import React, { FC } from 'react'; - -import applicationManager from '../../../framework/src/services/applicationManager'; - -import { maintenanceAppRootHandler } from './handlers/maintenanceAppRootHandler'; - -import { MaintenanceView } from './views/maintenanceView'; - -const appIcon = require('./assets/icons/maintenanceAppIcon.svg'); // select app icon - -const App : FC = () => { - return ; -}; - -export function register() { - applicationManager.registerApplication({ - name: 'maintenance', - icon: appIcon, - rootComponent: App, - rootActionHandler: maintenanceAppRootHandler, - menuEntry: 'Maintenance', - }); -} - - diff --git a/sdnr/wt/odlux/apps/maintenanceApp/src/services/maintenenceService.ts b/sdnr/wt/odlux/apps/maintenanceApp/src/services/maintenenceService.ts deleted file mode 100644 index 5fdccc349..000000000 --- a/sdnr/wt/odlux/apps/maintenanceApp/src/services/maintenenceService.ts +++ /dev/null @@ -1,72 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ -import { DeleteResponse, PostResponse } from '../../../../framework/src/models/elasticSearch'; -import { requestRest } from '../../../../framework/src/services/restService'; -import { convertPropertyNames, replaceUpperCase } from '../../../../framework/src/utilities/yangHelper'; -import { MaintenanceEntry } from '../models/maintenanceEntryType'; - -import { convertToISODateString } from '../utils/timeUtils'; - - -export const maintenenceEntryDatabasePath = 'mwtn/maintenancemode'; - -/** - * Represents a web api accessor service for all maintenence entries related actions. - */ -class MaintenenceService { - - /** - * Adds or updates one maintenence entry to the backend. - */ - public async writeMaintenenceEntry(maintenenceEntry: MaintenanceEntry): Promise { - const path = '/rests/operations/data-provider:create-maintenance'; - - const query = { - 'id': maintenenceEntry.mId, - 'node-id': maintenenceEntry.nodeId, - 'active': maintenenceEntry.active, - 'description': maintenenceEntry.description, - 'end': convertToISODateString(maintenenceEntry.end), - 'start': convertToISODateString(maintenenceEntry.start), - }; - - const result = await requestRest(path, { method: 'POST', body: JSON.stringify(convertPropertyNames({ 'data-provider:input': query }, replaceUpperCase)) }); - return result || null; - } - - /** - * Deletes one maintenence entry by its mountId from the backend. - */ - public async deleteMaintenenceEntry(maintenenceEntry: MaintenanceEntry): Promise<(DeleteResponse) | null> { - const path = '/rests/operations/data-provider:delete-maintenance'; - - const query = { - 'id': maintenenceEntry.mId, - 'node-id': maintenenceEntry.nodeId, - 'active': maintenenceEntry.active, - 'description': maintenenceEntry.description, - 'end': convertToISODateString(maintenenceEntry.end), - 'start': convertToISODateString(maintenenceEntry.start), - }; - const result = await requestRest(path, { method: 'POST', body: JSON.stringify(convertPropertyNames({ 'data-provider:input': query }, replaceUpperCase)) }); - return result || null; - } -} - -export const maintenenceService = new MaintenenceService(); -export default maintenenceService; \ No newline at end of file diff --git a/sdnr/wt/odlux/apps/maintenanceApp/src/utils/timeUtils.ts b/sdnr/wt/odlux/apps/maintenanceApp/src/utils/timeUtils.ts deleted file mode 100644 index 0fde5fcad..000000000 --- a/sdnr/wt/odlux/apps/maintenanceApp/src/utils/timeUtils.ts +++ /dev/null @@ -1,45 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ -export function convertToGMTString(dateString: string): string { - const date = new Date(dateString); - const pad = (n: number) => (n < 10) ? '0' + n : n; - - return date.getUTCFullYear() + - '-' + pad(date.getUTCMonth() + 1) + - '-' + pad(date.getUTCDate()) + - 'T' + pad(date.getUTCHours()) + - ':' + pad(date.getUTCMinutes()) + - '+00:00'; -} - -export function convertToLocaleString(rawDate: string | number): string { - const date = new Date(rawDate); - const pad = (n: number) => (n < 10) ? '0' + n : n; - - return date.getFullYear() + - '-' + pad(date.getMonth() + 1) + - '-' + pad(date.getDate()) + - 'T' + pad(date.getHours()) + - ':' + pad(date.getMinutes()); -} - -export function convertToISODateString(rawDate: string | number): string { - const date = new Date(rawDate); - const displayDate = date.toISOString(); - return displayDate.replace(/\.[0-9]{2}/, '.'); -} \ No newline at end of file diff --git a/sdnr/wt/odlux/apps/maintenanceApp/src/views/maintenanceView.tsx b/sdnr/wt/odlux/apps/maintenanceApp/src/views/maintenanceView.tsx deleted file mode 100644 index d54d63c04..000000000 --- a/sdnr/wt/odlux/apps/maintenanceApp/src/views/maintenanceView.tsx +++ /dev/null @@ -1,246 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ -import React from 'react'; - -import { faBan } from '@fortawesome/free-solid-svg-icons'; -import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; -import AddIcon from '@mui/icons-material/Add'; -import EditIcon from '@mui/icons-material/Edit'; -import Refresh from '@mui/icons-material/Refresh'; -import RemoveIcon from '@mui/icons-material/RemoveCircleOutline'; -import { Divider, MenuItem, Theme, Typography } from '@mui/material'; -import { WithStyles } from '@mui/styles'; -import createStyles from '@mui/styles/createStyles'; -import withStyles from '@mui/styles/withStyles'; - -import MaterialTable, { ColumnType, MaterialTableCtorType } from '../../../../framework/src/components/material-table'; -import { connect, Connect, IDispatcher } from '../../../../framework/src/flux/connect'; -import { IApplicationStoreState } from '../../../../framework/src/store/applicationStore'; - -import EditMaintenenceEntryDialog, { EditMaintenenceEntryDialogMode } from '../components/editMaintenenceEntryDialog'; -import RefreshMaintenanceEntriesDialog, { RefreshMaintenanceEntriesDialogMode } from '../components/refreshMaintenanceEntries'; -import { createmaintenanceEntriesActions, createmaintenanceEntriesProperties, maintenanceEntriesReloadAction } from '../handlers/maintenanceEntriesHandler'; -import { MaintenanceEntry } from '../models/maintenanceEntryType'; -import { convertToLocaleString } from '../utils/timeUtils'; - -const styles = (theme: Theme) => createStyles({ - button: { - margin: 0, - padding: '6px 6px', - minWidth: 'unset', - }, - spacer: { - marginLeft: theme.spacing(1), - marginRight: theme.spacing(1), - display: 'inline', - }, -}); - -const MaintenanceEntriesTable = MaterialTable as MaterialTableCtorType; - -const mapProps = (state: IApplicationStoreState) => ({ - maintenanceEntriesProperties: createmaintenanceEntriesProperties(state), -}); - -const mapDispatcher = (dispatcher: IDispatcher) => ({ - maintenanceEntriesActions: createmaintenanceEntriesActions(dispatcher.dispatch), - onLoadMaintenanceEntries: async () => { - await dispatcher.dispatch(maintenanceEntriesReloadAction); - }, -}); - -const emptyMaintenenceEntry: MaintenanceEntry = { - mId: '', - nodeId: '', - description: '', - start: convertToLocaleString(new Date().valueOf()), - end: convertToLocaleString(new Date().valueOf()), - active: false, -}; - -type MaintenanceViewComponentProps = Connect & WithStyles & {}; - -type MaintenenceViewComponentState = { - maintenenceEntryToEdit: MaintenanceEntry; - maintenanceEntryEditorMode: EditMaintenenceEntryDialogMode; - refreshMaintenenceEntriesEditorMode: RefreshMaintenanceEntriesDialogMode; -}; - -let initialSorted = false; - -class MaintenenceViewComponent extends React.Component { - - constructor(props: MaintenanceViewComponentProps) { - super(props); - - this.state = { - maintenenceEntryToEdit: emptyMaintenenceEntry, - maintenanceEntryEditorMode: EditMaintenenceEntryDialogMode.None, - refreshMaintenenceEntriesEditorMode: RefreshMaintenanceEntriesDialogMode.None, - }; - - } - - getContextMenu(rowData: MaintenanceEntry): JSX.Element[] { - let buttonArray = [ - this.onOpenPlus1hEditMaintenenceEntryDialog(event, rowData)}>+1h, - this.onOpenPlus8hEditMaintenenceEntryDialog(event, rowData)}>+8h, - , - this.onOpenEditMaintenenceEntryDialog(event, rowData)}>Edit, - this.onOpenRemoveMaintenenceEntryDialog(event, rowData)}>Remove, - ]; - return buttonArray; - } - - render() { - const addMaintenenceEntryAction = { - icon: AddIcon, tooltip: 'Add', ariaLabel:'add-element', onClick: () => { - const startTime = (new Date().valueOf()); - const endTime = startTime; - this.setState({ - maintenenceEntryToEdit: { - ...emptyMaintenenceEntry, - start: convertToLocaleString(startTime), - end: convertToLocaleString(endTime), - }, - maintenanceEntryEditorMode: EditMaintenenceEntryDialogMode.AddMaintenenceEntry, - }); - }, - }; - - const refreshMaintenanceEntriesAction = { - icon: Refresh, tooltip: 'Refresh Maintenance Entries', ariaLabel: 'refresh', onClick: () => { - this.setState({ - refreshMaintenenceEntriesEditorMode: RefreshMaintenanceEntriesDialogMode.RefreshMaintenanceEntriesTable, - }); - }, - }; - - const now = new Date().valueOf(); - return ( - <> - ( - rowData.active && (Date.parse(rowData.start).valueOf() <= now) && (Date.parse(rowData.end).valueOf() >= now) && || null - ), - }, - { property: 'active', title: 'Activation State', type: ColumnType.boolean, labels: { 'true': 'active', 'false': 'not active' } }, - { property: 'start', title: 'Start Date (UTC)', type: ColumnType.text }, - { property: 'end', title: 'End Date (UTC)', type: ColumnType.text }, - ] - } idProperty={'mId'}{...this.props.maintenanceEntriesActions} {...this.props.maintenanceEntriesProperties} asynchronus createContextMenu={rowData => { - return this.getContextMenu(rowData); - }} > - - - - - ); - } - - public componentDidMount() { - - if (!initialSorted) { - initialSorted = true; - this.props.maintenanceEntriesActions.onHandleRequestSort('node-id'); - } else { - this.props.onLoadMaintenanceEntries(); - } - - - } - - private onOpenPlus1hEditMaintenenceEntryDialog = (event: React.MouseEvent, entry: MaintenanceEntry) => { - // event.preventDefault(); - // event.stopPropagation(); - const startTime = (new Date().valueOf()); - const endTime = startTime + (1 * 60 * 60 * 1000); - this.setState({ - maintenenceEntryToEdit: { - ...entry, - start: convertToLocaleString(startTime), - end: convertToLocaleString(endTime), - }, - maintenanceEntryEditorMode: EditMaintenenceEntryDialogMode.EditMaintenenceEntry, - }); - }; - - private onOpenPlus8hEditMaintenenceEntryDialog = (event: React.MouseEvent, entry: MaintenanceEntry) => { - // event.preventDefault(); - // event.stopPropagation(); - const startTime = (new Date().valueOf()); - const endTime = startTime + (8 * 60 * 60 * 1000); - this.setState({ - maintenenceEntryToEdit: { - ...entry, - start: convertToLocaleString(startTime), - end: convertToLocaleString(endTime), - }, - maintenanceEntryEditorMode: EditMaintenenceEntryDialogMode.EditMaintenenceEntry, - }); - }; - - private onOpenEditMaintenenceEntryDialog = (event: React.MouseEvent, entry: MaintenanceEntry) => { - // event.preventDefault(); - // event.stopPropagation(); - const startTime = (new Date().valueOf()); - const endTime = startTime; - this.setState({ - maintenenceEntryToEdit: { - ...entry, - ...(entry.start && endTime ? { start: convertToLocaleString(entry.start), end: convertToLocaleString(entry.end) } : { start: convertToLocaleString(startTime), end: convertToLocaleString(endTime) }), - }, - maintenanceEntryEditorMode: EditMaintenenceEntryDialogMode.EditMaintenenceEntry, - }); - }; - - private onOpenRemoveMaintenenceEntryDialog = (event: React.MouseEvent, entry: MaintenanceEntry) => { - // event.preventDefault(); - // event.stopPropagation(); - const startTime = (new Date().valueOf()); - const endTime = startTime; - this.setState({ - maintenenceEntryToEdit: { - ...entry, - ...(entry.start && endTime ? { start: convertToLocaleString(entry.start), end: convertToLocaleString(entry.end) } : { start: convertToLocaleString(startTime), end: convertToLocaleString(endTime) }), - }, - maintenanceEntryEditorMode: EditMaintenenceEntryDialogMode.RemoveMaintenenceEntry, - }); - }; - - private onCloseEditMaintenenceEntryDialog = () => { - this.setState({ - maintenenceEntryToEdit: emptyMaintenenceEntry, - maintenanceEntryEditorMode: EditMaintenenceEntryDialogMode.None, - }); - }; - - private onCloseRefreshMaintenenceEntryDialog = () => { - this.setState({ - refreshMaintenenceEntriesEditorMode: RefreshMaintenanceEntriesDialogMode.None, - }); - }; -} - -export const MaintenanceView = withStyles(styles)(connect(mapProps, mapDispatcher)(MaintenenceViewComponent)); - diff --git a/sdnr/wt/odlux/apps/maintenanceApp/src2/main/java/org/onap/ccsdk/features/sdnr/wt/odlux/bundles/MyOdluxBundle.java b/sdnr/wt/odlux/apps/maintenanceApp/src2/main/java/org/onap/ccsdk/features/sdnr/wt/odlux/bundles/MyOdluxBundle.java deleted file mode 100644 index 43b072c4b..000000000 --- a/sdnr/wt/odlux/apps/maintenanceApp/src2/main/java/org/onap/ccsdk/features/sdnr/wt/odlux/bundles/MyOdluxBundle.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt - * ================================================================================================= - * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ -package org.onap.ccsdk.features.sdnr.wt.odlux.bundles; - -import org.onap.ccsdk.features.sdnr.wt.odlux.model.bundles.OdluxBundle; -import org.onap.ccsdk.features.sdnr.wt.odlux.model.bundles.OdluxBundleLoader; - -public class MyOdluxBundle extends OdluxBundle { - - @Override - public void initialize() { - super.initialize(); - } - - @Override - public void clean() { - super.clean(); - } - - @Override - public String getResourceFileContent(String filename) { - return super.getResourceFileContent(filename); - } - - @Override - public boolean hasResource(String filename) { - return super.hasResource(filename); - } - - @Override - public void setBundleName(String bundleName) { - super.setBundleName(bundleName); - } - - @Override - public void setLoader(OdluxBundleLoader loader) { - super.setLoader(loader); - } - - @Override - public String getBundleName() { - return super.getBundleName(); - } - - @Override - public OdluxBundleLoader getLoader() { - return super.getLoader(); - } - - public MyOdluxBundle() { - super(); - } -} diff --git a/sdnr/wt/odlux/apps/maintenanceApp/src2/main/resources/OSGI-INF/blueprint/blueprint.xml b/sdnr/wt/odlux/apps/maintenanceApp/src2/main/resources/OSGI-INF/blueprint/blueprint.xml deleted file mode 100644 index 0c6a6d90a..000000000 --- a/sdnr/wt/odlux/apps/maintenanceApp/src2/main/resources/OSGI-INF/blueprint/blueprint.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - diff --git a/sdnr/wt/odlux/apps/maintenanceApp/src2/test/java/org/onap/ccsdk/features/sdnr/wt/odlux/bundles/test/TestBundleRes.java b/sdnr/wt/odlux/apps/maintenanceApp/src2/test/java/org/onap/ccsdk/features/sdnr/wt/odlux/bundles/test/TestBundleRes.java deleted file mode 100644 index c319bb189..000000000 --- a/sdnr/wt/odlux/apps/maintenanceApp/src2/test/java/org/onap/ccsdk/features/sdnr/wt/odlux/bundles/test/TestBundleRes.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt - * ================================================================================================= - * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - * ============LICENSE_END========================================================================== - */ -package org.onap.ccsdk.features.sdnr.wt.odlux.bundles.test; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; -import org.junit.Test; -import org.onap.ccsdk.features.sdnr.wt.odlux.OdluxBundleLoaderImpl; -import org.onap.ccsdk.features.sdnr.wt.odlux.bundles.MyOdluxBundle; - -public class TestBundleRes { - - @Test - public void test() { - OdluxBundleLoaderImpl loader = OdluxBundleLoaderImpl.getInstance(); - MyOdluxBundle b = new MyOdluxBundle(); - b.setLoader(loader); - b.setIndex(0); - b.setBundleName("abc"); - b.initialize(); - assertTrue(loader.getNumberOfBundles()==1); - assertNotNull(b.getLoader()); - assertEquals("abc",b.getBundleName()); - assertTrue(b.hasResource("test.js")); - assertNotNull(b.getResourceFileContent("test.js")); - b.clean(); - assertTrue(loader.getNumberOfBundles()==0); - } - -} diff --git a/sdnr/wt/odlux/apps/maintenanceApp/src2/test/resources/test.js b/sdnr/wt/odlux/apps/maintenanceApp/src2/test/resources/test.js deleted file mode 100644 index b47fdc39f..000000000 --- a/sdnr/wt/odlux/apps/maintenanceApp/src2/test/resources/test.js +++ /dev/null @@ -1,5 +0,0 @@ -asdac sad -as -d -sad - sadfa \ No newline at end of file diff --git a/sdnr/wt/odlux/apps/maintenanceApp/tsconfig.json b/sdnr/wt/odlux/apps/maintenanceApp/tsconfig.json deleted file mode 100644 index ca65092e0..000000000 --- a/sdnr/wt/odlux/apps/maintenanceApp/tsconfig.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "compilerOptions": { - "baseUrl": "./src", - "outDir": "./dist", - "sourceMap": true, - "forceConsistentCasingInFileNames": true, - "allowSyntheticDefaultImports": true, - "allowUnreachableCode": false, - "allowUnusedLabels": false, - "noFallthroughCasesInSwitch": true, - "noImplicitAny": true, - "noImplicitReturns": true, - "noImplicitThis": true, - "strictNullChecks": true, - "pretty": true, - "newLine": "LF", - "module": "es2015", - "target": "es2016", - "moduleResolution": "node", - "experimentalDecorators": true, - "jsx": "preserve", - "lib": [ - "dom", - "es2015", - "es2016" - ], - "types": [ - "prop-types", - "react", - "react-dom" - ] - }, - "exclude": [ - "dist", - "node_modules" - ] -} diff --git a/sdnr/wt/odlux/apps/maintenanceApp/webpack.config.js b/sdnr/wt/odlux/apps/maintenanceApp/webpack.config.js deleted file mode 100644 index 845fc43a6..000000000 --- a/sdnr/wt/odlux/apps/maintenanceApp/webpack.config.js +++ /dev/null @@ -1,168 +0,0 @@ -/** - * Webpack 4 configuration file - * see https://webpack.js.org/configuration/ - * see https://webpack.js.org/configuration/dev-server/ - */ - -"use strict"; - -const path = require("path"); -const webpack = require("webpack"); -const CopyWebpackPlugin = require("copy-webpack-plugin"); -const TerserPlugin = require('terser-webpack-plugin'); - -// const __dirname = (path => path.replace(/^([a-z]\:)/, c => c.toUpperCase()))(process.__dirname()); - -module.exports = (env) => { - const distPath = path.resolve(__dirname, env === "release" ? "." : "../..", "dist"); - const frameworkPath = path.resolve(__dirname, env === "release" ? "../../framework" : "../..", "dist"); - return [{ - name: "App", - - mode: "none", //disable default behavior - - target: "web", - - context: path.resolve(__dirname, "src"), - - entry: { - maintenanceApp: ["./pluginMaintenance.tsx"] - }, - - devtool: env === "release" ? false : "source-map", - - resolve: { - extensions: [".ts", ".tsx", ".js", ".jsx"] - }, - - output: { - path: distPath, - filename: "[name].js", - library: "[name]", - libraryTarget: "umd2", - chunkFilename: "[name].js" - }, - module: { - rules: [{ - test: /\.tsx?$/, - exclude: /node_modules/, - use: [{ - loader: "babel-loader" - }, { - loader: "ts-loader" - }] - }, { - test: /\.jsx?$/, - exclude: /node_modules/, - use: [{ - loader: "babel-loader" - }] - }, { - //don't minify images - test: /\.(png|gif|jpg|svg)$/, - use: [{ - loader: 'url-loader', - options: { - limit: 10, - name: './images/[name].[ext]' - } - }] - }] - }, - - optimization: { - noEmitOnErrors: true, - namedModules: env !== "release", - minimize: env === "release", - minimizer: env !== "release" ? [] : [new TerserPlugin({ - terserOptions: { - warnings: false, // false, true, "verbose" - compress: { - drop_console: true, - drop_debugger: true, - } - } - })], - }, - - plugins: [ - new webpack.DllReferencePlugin({ - context: path.resolve(__dirname, "../../framework/src"), - manifest: require(path.resolve(frameworkPath, "vendor-manifest.json")), - sourceType: "umd2" - }), - new webpack.DllReferencePlugin({ - context: path.resolve(__dirname, "../../framework/src"), - manifest: require(path.resolve(frameworkPath, "app-manifest.json")), - sourceType: "umd2" - }), - ...(env === "release" ? [ - new webpack.DefinePlugin({ - "process.env": { - NODE_ENV: "'production'", - VERSION: JSON.stringify(require("./package.json").version) - } - }), - ] : [ - new webpack.DefinePlugin({ - "process.env": { - NODE_ENV: "'development'", - VERSION: JSON.stringify(require("./package.json").version) - } - }), - new CopyWebpackPlugin([{ - from: 'index.html', - to: distPath - }]), - ]) - ], - - devServer: { - public: "http://localhost:3100", - contentBase: frameworkPath, - - compress: true, - headers: { - "Access-Control-Allow-Origin": "*" - }, - host: "0.0.0.0", - port: 3100, - disableHostCheck: true, - historyApiFallback: true, - inline: true, - hot: false, - quiet: false, - stats: { - colors: true - }, - proxy: { - "/oauth2/": { - target: "http://10.20.6.29:48181", - secure: false - }, - "/database/": { - target: "http://10.20.6.29:48181", - secure: false - }, - "/restconf/": { - target: "http://10.20.6.29:48181", - secure: false - }, - "/rests/": { - target: "http://10.20.6.29:48181", - secure: false - }, - "/help/": { - target: "http://10.20.6.29:48181", - secure: false - }, - "/websocket": { - target: "http://10.20.6.29:48181", - ws: true, - changeOrigin: true, - secure: false - } - } - } - }]; -} -- cgit 1.2.3-korg