Skip to content

Commit 36e9d02

Browse files
Revert "[Refactor] TabsComponent to CodeComponent custom element "
1 parent 9351204 commit 36e9d02

24 files changed

+2102
-1048
lines changed

Diff for: package-lock.json

+1,980-876
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: package.json

-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
"@angular/common": "9.1.2",
2626
"@angular/compiler": "9.1.2",
2727
"@angular/core": "9.1.2",
28-
"@angular/elements": "9.1.2",
2928
"@angular/flex-layout": "8.0.0-beta.27",
3029
"@angular/forms": "9.1.2",
3130
"@angular/http": "7.2.16",

Diff for: src/app/app.module.ts

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { HttpClientModule } from '@angular/common/http';
2-
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
2+
import { NgModule } from '@angular/core';
33
import { BrowserModule } from '@angular/platform-browser';
44
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
55
import {
@@ -35,23 +35,20 @@ import { BasePageComponent } from './homepage/pages/page/page.component';
3535
import { PipesComponent } from './homepage/pages/pipes/pipes.component';
3636
import { SupportComponent } from './homepage/pages/support/support.component';
3737
import { SharedModule } from './shared/shared.module';
38-
import { CustomElementsModule } from './custom-elements/custom-elements.module';
3938

4039
const DEFAULT_PERFECT_SCROLLBAR_CONFIG: PerfectScrollbarConfigInterface = {
4140
suppressScrollX: true,
4241
wheelPropagation: true,
4342
};
4443

4544
@NgModule({
46-
schemas: [CUSTOM_ELEMENTS_SCHEMA],
4745
imports: [
4846
BrowserModule,
4947
BrowserAnimationsModule,
5048
AppRoutingModule,
5149
HttpClientModule,
5250
PerfectScrollbarModule,
5351
SharedModule,
54-
CustomElementsModule,
5552
],
5653
declarations: [
5754
AppComponent,

Diff for: src/app/custom-elements/README.md

-26
This file was deleted.

Diff for: src/app/custom-elements/code/code.component.html

-19
This file was deleted.

Diff for: src/app/custom-elements/code/code.component.scss

-45
This file was deleted.

Diff for: src/app/custom-elements/code/code.component.ts

-26
This file was deleted.

Diff for: src/app/custom-elements/custom-elements.module.ts

-18
This file was deleted.

Diff for: src/app/homepage/pages/cli/cli.module.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { CommonModule } from '@angular/common';
2-
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
2+
import { NgModule } from '@angular/core';
33
import { RouterModule, Routes } from '@angular/router';
44
import { SharedModule } from './../../../shared/shared.module';
55
import { CliLibrariesComponent } from './libraries/libaries.component';
@@ -51,7 +51,6 @@ const routes: Routes = [
5151
];
5252

5353
@NgModule({
54-
schemas: [CUSTOM_ELEMENTS_SCHEMA],
5554
imports: [CommonModule, SharedModule, RouterModule.forChild(routes)],
5655
declarations: [
5756
CliOverviewComponent,

Diff for: src/app/homepage/pages/faq/faq.module.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { CommonModule } from '@angular/common';
2-
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
2+
import { NgModule } from '@angular/core';
33
import { RouterModule, Routes } from '@angular/router';
44
import { SharedModule } from '../../../shared/shared.module';
55
import { GlobalPrefixComponent } from './global-prefix/global-prefix.component';
@@ -37,7 +37,6 @@ const routes: Routes = [
3737
];
3838

3939
@NgModule({
40-
schemas: [CUSTOM_ELEMENTS_SCHEMA],
4140
imports: [CommonModule, SharedModule, RouterModule.forChild(routes)],
4241
declarations: [
4342
GlobalPrefixComponent,

Diff for: src/app/homepage/pages/fundamentals/fundamentals.module.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { CommonModule } from '@angular/common';
2-
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
2+
import { NgModule } from '@angular/core';
33
import { RouterModule, Routes } from '@angular/router';
44
import { SharedModule } from '../../../shared/shared.module';
55
import { AsyncComponentsComponent } from './async-components/async-components.component';
@@ -83,7 +83,6 @@ const routes: Routes = [
8383
];
8484

8585
@NgModule({
86-
schemas: [CUSTOM_ELEMENTS_SCHEMA],
8786
imports: [CommonModule, SharedModule, RouterModule.forChild(routes)],
8887
declarations: [
8988
AsyncComponentsComponent,

Diff for: src/app/homepage/pages/graphql/graphql.module.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { CommonModule } from '@angular/common';
2-
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
2+
import { NgModule } from '@angular/core';
33
import { RouterModule, Routes } from '@angular/router';
44
import { SharedModule } from '../../../shared/shared.module';
55
import { CliPluginComponent } from './cli-plugin/cli-plugin.component';
@@ -105,7 +105,6 @@ const routes: Routes = [
105105
];
106106

107107
@NgModule({
108-
schemas: [CUSTOM_ELEMENTS_SCHEMA],
109108
imports: [CommonModule, SharedModule, RouterModule.forChild(routes)],
110109
declarations: [
111110
QuickStartComponent,

Diff for: src/app/homepage/pages/microservices/custom-transport/custom-transport.component.spec.ts

+2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
22

33
import { CustomTransportComponent } from './custom-transport.component';
4+
import { TabsComponent } from '../../../../shared/components/tabs/tabs.component';
45
import { ExtensionPipe } from '../../../../shared/pipes/extension.pipe';
56

67
describe('CustomTransportComponent', () => {
78
beforeEach(async(() => {
89
return TestBed.configureTestingModule({
910
declarations: [
11+
TabsComponent,
1012
ExtensionPipe,
1113
CustomTransportComponent
1214
]

Diff for: src/app/homepage/pages/microservices/microservices.module.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { CommonModule } from '@angular/common';
2-
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
2+
import { NgModule } from '@angular/core';
33
import { RouterModule, Routes } from '@angular/router';
44
import { SharedModule } from '../../../shared/shared.module';
55
import { BasicsComponent } from './basics/basics.component';
@@ -79,7 +79,6 @@ const routes: Routes = [
7979
];
8080

8181
@NgModule({
82-
schemas: [CUSTOM_ELEMENTS_SCHEMA],
8382
imports: [CommonModule, SharedModule, RouterModule.forChild(routes)],
8483
declarations: [
8584
BasicsComponent,

Diff for: src/app/homepage/pages/recipes/recipes.module.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { CommonModule } from '@angular/common';
2-
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
2+
import { NgModule } from '@angular/core';
33
import { RouterModule, Routes } from '@angular/router';
44
import { SharedModule } from '../../../shared/shared.module';
55
import { CqrsComponent } from './cqrs/cqrs.component';
@@ -76,7 +76,6 @@ const routes: Routes = [
7676
];
7777

7878
@NgModule({
79-
schemas: [CUSTOM_ELEMENTS_SCHEMA],
8079
imports: [CommonModule, SharedModule, RouterModule.forChild(routes)],
8180
declarations: [
8281
SqlTypeormComponent,

Diff for: src/app/homepage/pages/techniques/techniques.module.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { CommonModule } from '@angular/common';
2-
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
2+
import { NgModule } from '@angular/core';
33
import { RouterModule, Routes } from '@angular/router';
44
import { SharedModule } from '../../../shared/shared.module';
55
import { AuthenticationComponent } from './authentication/authentication.component';
@@ -111,7 +111,6 @@ const routes: Routes = [
111111
];
112112

113113
@NgModule({
114-
schemas: [CUSTOM_ELEMENTS_SCHEMA],
115114
imports: [CommonModule, SharedModule, RouterModule.forChild(routes)],
116115
declarations: [
117116
SqlComponent,

Diff for: src/app/homepage/pages/websockets/websockets.module.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { CommonModule } from '@angular/common';
2-
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
2+
import { NgModule } from '@angular/core';
33
import { RouterModule, Routes } from '@angular/router';
44
import { SharedModule } from '../../../shared/shared.module';
55
import { AdapterComponent } from './adapter/adapter.component';
@@ -43,7 +43,6 @@ const routes: Routes = [
4343
];
4444

4545
@NgModule({
46-
schemas: [CUSTOM_ELEMENTS_SCHEMA],
4746
imports: [CommonModule, SharedModule, RouterModule.forChild(routes)],
4847
declarations: [
4948
GatewaysComponent,

Diff for: src/app/shared/components/tabs/tabs.component.html

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<div class="tabs-wrapper">
2+
<span class="tab" [class.active]="isJsActive" (click)="isJsActive = true">
3+
JS
4+
</span>
5+
<span class="tab active" [class.active]="!isJsActive" (click)="isJsActive = false">
6+
TS
7+
</span>
8+
</div>

Diff for: src/app/shared/components/tabs/tabs.component.scss

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
@import './../../../../scss/utils.scss';
2+
3+
.tabs-wrapper {
4+
position: absolute;
5+
right: 0;
6+
top: 0;
7+
bottom: 0;
8+
9+
/*@include media(medium) {
10+
position: static;
11+
margin: 15px -20px -15px;
12+
13+
.tab {
14+
float: none;
15+
display: inline-block;
16+
margin: 0 !important;
17+
}
18+
}*/
19+
}
20+
21+
.tab {
22+
color: #dfdfdf;
23+
cursor: pointer;
24+
margin: 0;
25+
float: right;
26+
font-weight: 600;
27+
height: 100%;
28+
padding: 12px 20px;
29+
box-sizing: border-box;
30+
-webkit-box-sizing: border-box;
31+
32+
&:hover:not(.active) {
33+
color: #efefef;
34+
// background: #232323;
35+
}
36+
&.active {
37+
// color: #fff;
38+
// background: #1d1d1d;
39+
display: none;
40+
}
41+
}
+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
2+
3+
import { TabsComponent } from './tabs.component';
4+
5+
describe('TabsComponent', () => {
6+
beforeEach(async(() => {
7+
return TestBed.configureTestingModule({
8+
declarations: [ TabsComponent ]
9+
})
10+
.compileComponents();
11+
}));
12+
13+
let fixture: ComponentFixture<TabsComponent>;
14+
let component: TabsComponent;
15+
beforeEach(() => {
16+
fixture = TestBed.createComponent(TabsComponent);
17+
component = fixture.componentInstance;
18+
fixture.detectChanges();
19+
});
20+
21+
it('should be created', () => {
22+
expect(component).toBeTruthy();
23+
});
24+
});

0 commit comments

Comments
 (0)