From 6e9ebfb69d2177744138c182ab88474ee7388c3e Mon Sep 17 00:00:00 2001 From: piotrpekala7 <31202938+piotrpekala7@users.noreply.github.com> Date: Thu, 27 May 2021 18:58:28 +0200 Subject: [PATCH] Removing react-related components --- src/app/app-routing.module.ts | 2 - src/app/app.module.ts | 6 +- src/app/components/help/help.component.html | 1 - .../components/help/report-issue/filter.tsx | 24 ----- .../help/report-issue/issue-list.tsx | 95 ------------------- .../components/help/report-issue/issue.tsx | 42 -------- .../report-issue/report-issue.component.html | 1 - .../report-issue/report-issue.component.scss | 0 .../report-issue.component.spec.ts | 0 .../report-issue/report-issue.component.tsx | 52 ---------- 10 files changed, 1 insertion(+), 222 deletions(-) delete mode 100644 src/app/components/help/report-issue/filter.tsx delete mode 100644 src/app/components/help/report-issue/issue-list.tsx delete mode 100644 src/app/components/help/report-issue/issue.tsx delete mode 100644 src/app/components/help/report-issue/report-issue.component.html delete mode 100644 src/app/components/help/report-issue/report-issue.component.scss delete mode 100644 src/app/components/help/report-issue/report-issue.component.spec.ts delete mode 100644 src/app/components/help/report-issue/report-issue.component.tsx diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 2e95bbec..539d1efb 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -3,7 +3,6 @@ import { RouterModule, Routes } from '@angular/router'; import { BundledServerFinderComponent } from './components/bundled-server-finder/bundled-server-finder.component'; import { DirectLinkComponent } from './components/direct-link/direct-link.component'; import { HelpComponent } from './components/help/help.component'; -import { ReportIssueComponent } from './components/help/report-issue/report-issue.component'; import { InstalledSoftwareComponent } from './components/installed-software/installed-software.component'; import { PageNotFoundComponent } from './components/page-not-found/page-not-found.component'; import { BuiltInPreferencesComponent } from './components/preferences/built-in/built-in-preferences.component'; @@ -69,7 +68,6 @@ const routes: Routes = [ resolve: { server: ServerResolve }, }, { path: 'help', component: HelpComponent }, - { path: 'help/reportissue', component: ReportIssueComponent }, { path: 'settings', component: SettingsComponent }, { path: 'settings/console', component: ConsoleComponent }, { path: 'installed-software', component: InstalledSoftwareComponent }, diff --git a/src/app/app.module.ts b/src/app/app.module.ts index bed8fb6f..efa22d09 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -1,4 +1,3 @@ -import { AngularReactBrowserModule } from '@angular-react/core'; import { DragDropModule } from '@angular/cdk/drag-drop'; import { OverlayModule } from '@angular/cdk/overlay'; import { CdkTableModule } from '@angular/cdk/table'; @@ -43,7 +42,6 @@ import { NodeLabelDraggedComponent } from './components/drawings-listeners/node- import { TextAddedComponent } from './components/drawings-listeners/text-added/text-added.component'; import { TextEditedComponent } from './components/drawings-listeners/text-edited/text-edited.component'; import { HelpComponent } from './components/help/help.component'; -import { ReportIssueComponent } from './components/help/report-issue/report-issue.component'; import { InstallSoftwareComponent } from './components/installed-software/install-software/install-software.component'; import { InstalledSoftwareComponent } from './components/installed-software/installed-software.component'; import { PageNotFoundComponent } from './components/page-not-found/page-not-found.component'; @@ -456,11 +454,9 @@ import { RotationValidator } from './validators/rotation-validator'; InformationDialogComponent, TemplateNameDialogComponent, ConfigureCustomAdaptersDialogComponent, - EditNetworkConfigurationDialogComponent, - ReportIssueComponent, + EditNetworkConfigurationDialogComponent ], imports: [ - AngularReactBrowserModule, BrowserModule, HttpClientModule, AppRoutingModule, diff --git a/src/app/components/help/help.component.html b/src/app/components/help/help.component.html index 124fe11e..9be618b9 100644 --- a/src/app/components/help/help.component.html +++ b/src/app/components/help/help.component.html @@ -34,6 +34,5 @@ - diff --git a/src/app/components/help/report-issue/filter.tsx b/src/app/components/help/report-issue/filter.tsx deleted file mode 100644 index 0ced31d4..00000000 --- a/src/app/components/help/report-issue/filter.tsx +++ /dev/null @@ -1,24 +0,0 @@ -import React, {Component} from "react"; -import Form from 'react-bootstrap/Form'; - -const formGroupStyle = { - margin: '20px' -}; - -class FilterComponent extends Component { - constructor(props) { - super(props); - } - - render() { - return ( -
- - - -
- ) - } -} - -export default FilterComponent; \ No newline at end of file diff --git a/src/app/components/help/report-issue/issue-list.tsx b/src/app/components/help/report-issue/issue-list.tsx deleted file mode 100644 index 835f6099..00000000 --- a/src/app/components/help/report-issue/issue-list.tsx +++ /dev/null @@ -1,95 +0,0 @@ -import React, { Component } from "react"; -import Card from 'react-bootstrap/Card'; -import Spinner from 'react-bootstrap/Spinner'; -import IssueComponent from './issue'; -import FilterComponent from './filter'; -import e from '../../../event-bus'; - -const wrapperStyle = { - justifyContent: 'center' as 'center', - display: 'flex', - flex: 1, - flexDirection: 'row' as 'row', - flexWrap: 'wrap' as 'wrap', - margin: '20px' -}; - -const cardStyle = { - width: '300px', - margin: '20px' -}; - -const cardTitleStyle = { - color: 'red' -}; -const message = 'Thank you for reporting the issue!'; -const apiUrl = 'https://api.github.com/repos/GNS3/gns3-web-ui/issues'; -const newIssueLink = 'https://github.com/GNS3/gns3-web-ui/issues/new'; - -class IssueListComponent extends Component { - constructor(props) { - super(props); - this.state = { - issues: [], - filteredIssues: [], - isFetching: true - }; - } - - componentDidMount() { - fetch(apiUrl) - .then(response => response.json()) - .then(data => this.setState({ - issues: data, - filteredIssues: data, - isFetching: false - })); - } - - handleChange = (event) => { - let filter = event.target.value; - let filteredIssues = this.state.issues; - - filteredIssues = filteredIssues.filter((issue) => { - return issue.title.toLowerCase().includes(filter.toLowerCase()) - }); - - this.setState({ - filteredIssues: filteredIssues - }); - } - - newIssueOpened = (event) => { - e.emit('message', { text: message }); - } - - render() { - return ( -
-
- -
- - {this.state.isFetching ? ( -
- -
- ) : ( -
- {this.state.filteredIssues.map(issue => - - )} - - - Don't see your issue here? - Open new issue - - -
- )} -
- ); - } -}; - -export default IssueListComponent; \ No newline at end of file diff --git a/src/app/components/help/report-issue/issue.tsx b/src/app/components/help/report-issue/issue.tsx deleted file mode 100644 index cc8e6dc7..00000000 --- a/src/app/components/help/report-issue/issue.tsx +++ /dev/null @@ -1,42 +0,0 @@ -import React, { Component } from "react"; -import Card from 'react-bootstrap/Card'; - -const cardStyle = { - width: '300px', - margin: '20px' -}; - -const cardTitleStyle = { - color: 'black' -}; - -const cardTextStyle = { - color: 'black', - overflow: 'auto', - height: '100px' -}; - -class IssueComponent extends Component { - constructor(props) { - super(props); - this.state = { - data: this.props.data - } - } - - render() { - const issue = this.state.data; - return ( - - - {issue.title} - Status: {issue.state} - {issue.body} - {issue.html_url} - - - ); - } -}; - -export default IssueComponent; \ No newline at end of file diff --git a/src/app/components/help/report-issue/report-issue.component.html b/src/app/components/help/report-issue/report-issue.component.html deleted file mode 100644 index de3af182..00000000 --- a/src/app/components/help/report-issue/report-issue.component.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/src/app/components/help/report-issue/report-issue.component.scss b/src/app/components/help/report-issue/report-issue.component.scss deleted file mode 100644 index e69de29b..00000000 diff --git a/src/app/components/help/report-issue/report-issue.component.spec.ts b/src/app/components/help/report-issue/report-issue.component.spec.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/src/app/components/help/report-issue/report-issue.component.tsx b/src/app/components/help/report-issue/report-issue.component.tsx deleted file mode 100644 index f56212a7..00000000 --- a/src/app/components/help/report-issue/report-issue.component.tsx +++ /dev/null @@ -1,52 +0,0 @@ -import { HttpClient } from '@angular/common/http'; -import { - AfterViewInit, - Component, - ElementRef, - EventEmitter, - Input, - OnInit, - OnChanges, - OnDestroy, - Output, - SimpleChanges, - ViewChild, - ViewEncapsulation, - AfterContentInit - } from '@angular/core'; -import IssueListComponent from '../report-issue/issue-list'; -import * as React from 'react'; -import * as ReactDOM from 'react-dom'; -import e from '../../../event-bus'; -import { ToasterService } from '../../../services/toaster.service'; - -@Component({ -selector: 'app-report-issue', -templateUrl: './report-issue.component.html', -styleUrls: ['./report-issue.component.scss'] -}) -export class ReportIssueComponent implements OnDestroy, AfterViewInit, AfterContentInit { - @ViewChild('issueListComponentContainer') containerRef: ElementRef; - - constructor(private toasterService: ToasterService) {} - - ngAfterViewInit() { - this.render(); - } - - ngAfterContentInit() { - e.on('message', message => { - this.toasterService.success(message.text); - }); - } - - ngOnDestroy() { - ReactDOM.unmountComponentAtNode(this.containerRef.nativeElement); - } - - private render() { - ReactDOM.render(
- -
, this.containerRef.nativeElement); - } -}