Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Revert "[Refactor] TabsComponent to CodeComponent custom element " #1184

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,856 changes: 1,980 additions & 876 deletions package-lock.json

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
"@angular/common": "9.1.2",
"@angular/compiler": "9.1.2",
"@angular/core": "9.1.2",
"@angular/elements": "9.1.2",
"@angular/flex-layout": "8.0.0-beta.27",
"@angular/forms": "9.1.2",
"@angular/http": "7.2.16",
Expand Down
5 changes: 1 addition & 4 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { HttpClientModule } from '@angular/common/http';
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import {
Expand Down Expand Up @@ -35,23 +35,20 @@ import { BasePageComponent } from './homepage/pages/page/page.component';
import { PipesComponent } from './homepage/pages/pipes/pipes.component';
import { SupportComponent } from './homepage/pages/support/support.component';
import { SharedModule } from './shared/shared.module';
import { CustomElementsModule } from './custom-elements/custom-elements.module';

const DEFAULT_PERFECT_SCROLLBAR_CONFIG: PerfectScrollbarConfigInterface = {
suppressScrollX: true,
wheelPropagation: true,
};

@NgModule({
schemas: [CUSTOM_ELEMENTS_SCHEMA],
imports: [
BrowserModule,
BrowserAnimationsModule,
AppRoutingModule,
HttpClientModule,
PerfectScrollbarModule,
SharedModule,
CustomElementsModule,
],
declarations: [
AppComponent,
Expand Down
26 changes: 0 additions & 26 deletions src/app/custom-elements/README.md

This file was deleted.

19 changes: 0 additions & 19 deletions src/app/custom-elements/code/code.component.html

This file was deleted.

45 changes: 0 additions & 45 deletions src/app/custom-elements/code/code.component.scss

This file was deleted.

26 changes: 0 additions & 26 deletions src/app/custom-elements/code/code.component.ts

This file was deleted.

18 changes: 0 additions & 18 deletions src/app/custom-elements/custom-elements.module.ts

This file was deleted.

3 changes: 1 addition & 2 deletions src/app/homepage/pages/cli/cli.module.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { CommonModule } from '@angular/common';
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { SharedModule } from './../../../shared/shared.module';
import { CliLibrariesComponent } from './libraries/libaries.component';
Expand Down Expand Up @@ -51,7 +51,6 @@ const routes: Routes = [
];

@NgModule({
schemas: [CUSTOM_ELEMENTS_SCHEMA],
imports: [CommonModule, SharedModule, RouterModule.forChild(routes)],
declarations: [
CliOverviewComponent,
Expand Down
3 changes: 1 addition & 2 deletions src/app/homepage/pages/faq/faq.module.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { CommonModule } from '@angular/common';
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { SharedModule } from '../../../shared/shared.module';
import { GlobalPrefixComponent } from './global-prefix/global-prefix.component';
Expand Down Expand Up @@ -37,7 +37,6 @@ const routes: Routes = [
];

@NgModule({
schemas: [CUSTOM_ELEMENTS_SCHEMA],
imports: [CommonModule, SharedModule, RouterModule.forChild(routes)],
declarations: [
GlobalPrefixComponent,
Expand Down
3 changes: 1 addition & 2 deletions src/app/homepage/pages/fundamentals/fundamentals.module.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { CommonModule } from '@angular/common';
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { SharedModule } from '../../../shared/shared.module';
import { AsyncComponentsComponent } from './async-components/async-components.component';
Expand Down Expand Up @@ -83,7 +83,6 @@ const routes: Routes = [
];

@NgModule({
schemas: [CUSTOM_ELEMENTS_SCHEMA],
imports: [CommonModule, SharedModule, RouterModule.forChild(routes)],
declarations: [
AsyncComponentsComponent,
Expand Down
3 changes: 1 addition & 2 deletions src/app/homepage/pages/graphql/graphql.module.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { CommonModule } from '@angular/common';
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { SharedModule } from '../../../shared/shared.module';
import { CliPluginComponent } from './cli-plugin/cli-plugin.component';
Expand Down Expand Up @@ -105,7 +105,6 @@ const routes: Routes = [
];

@NgModule({
schemas: [CUSTOM_ELEMENTS_SCHEMA],
imports: [CommonModule, SharedModule, RouterModule.forChild(routes)],
declarations: [
QuickStartComponent,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';

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

describe('CustomTransportComponent', () => {
beforeEach(async(() => {
return TestBed.configureTestingModule({
declarations: [
TabsComponent,
ExtensionPipe,
CustomTransportComponent
]
Expand Down
3 changes: 1 addition & 2 deletions src/app/homepage/pages/microservices/microservices.module.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { CommonModule } from '@angular/common';
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { SharedModule } from '../../../shared/shared.module';
import { BasicsComponent } from './basics/basics.component';
Expand Down Expand Up @@ -79,7 +79,6 @@ const routes: Routes = [
];

@NgModule({
schemas: [CUSTOM_ELEMENTS_SCHEMA],
imports: [CommonModule, SharedModule, RouterModule.forChild(routes)],
declarations: [
BasicsComponent,
Expand Down
3 changes: 1 addition & 2 deletions src/app/homepage/pages/recipes/recipes.module.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { CommonModule } from '@angular/common';
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { SharedModule } from '../../../shared/shared.module';
import { CqrsComponent } from './cqrs/cqrs.component';
Expand Down Expand Up @@ -76,7 +76,6 @@ const routes: Routes = [
];

@NgModule({
schemas: [CUSTOM_ELEMENTS_SCHEMA],
imports: [CommonModule, SharedModule, RouterModule.forChild(routes)],
declarations: [
SqlTypeormComponent,
Expand Down
3 changes: 1 addition & 2 deletions src/app/homepage/pages/techniques/techniques.module.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { CommonModule } from '@angular/common';
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { SharedModule } from '../../../shared/shared.module';
import { AuthenticationComponent } from './authentication/authentication.component';
Expand Down Expand Up @@ -111,7 +111,6 @@ const routes: Routes = [
];

@NgModule({
schemas: [CUSTOM_ELEMENTS_SCHEMA],
imports: [CommonModule, SharedModule, RouterModule.forChild(routes)],
declarations: [
SqlComponent,
Expand Down
3 changes: 1 addition & 2 deletions src/app/homepage/pages/websockets/websockets.module.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { CommonModule } from '@angular/common';
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { SharedModule } from '../../../shared/shared.module';
import { AdapterComponent } from './adapter/adapter.component';
Expand Down Expand Up @@ -43,7 +43,6 @@ const routes: Routes = [
];

@NgModule({
schemas: [CUSTOM_ELEMENTS_SCHEMA],
imports: [CommonModule, SharedModule, RouterModule.forChild(routes)],
declarations: [
GatewaysComponent,
Expand Down
8 changes: 8 additions & 0 deletions src/app/shared/components/tabs/tabs.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<div class="tabs-wrapper">
<span class="tab" [class.active]="isJsActive" (click)="isJsActive = true">
JS
</span>
<span class="tab active" [class.active]="!isJsActive" (click)="isJsActive = false">
TS
</span>
</div>
41 changes: 41 additions & 0 deletions src/app/shared/components/tabs/tabs.component.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
@import './../../../../scss/utils.scss';

.tabs-wrapper {
position: absolute;
right: 0;
top: 0;
bottom: 0;

/*@include media(medium) {
position: static;
margin: 15px -20px -15px;

.tab {
float: none;
display: inline-block;
margin: 0 !important;
}
}*/
}

.tab {
color: #dfdfdf;
cursor: pointer;
margin: 0;
float: right;
font-weight: 600;
height: 100%;
padding: 12px 20px;
box-sizing: border-box;
-webkit-box-sizing: border-box;

&:hover:not(.active) {
color: #efefef;
// background: #232323;
}
&.active {
// color: #fff;
// background: #1d1d1d;
display: none;
}
}
24 changes: 24 additions & 0 deletions src/app/shared/components/tabs/tabs.component.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';

import { TabsComponent } from './tabs.component';

describe('TabsComponent', () => {
beforeEach(async(() => {
return TestBed.configureTestingModule({
declarations: [ TabsComponent ]
})
.compileComponents();
}));

let fixture: ComponentFixture<TabsComponent>;
let component: TabsComponent;
beforeEach(() => {
fixture = TestBed.createComponent(TabsComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should be created', () => {
expect(component).toBeTruthy();
});
});
Loading