Add repository overview to tabs
Signed-off-by: trivernis <trivernis@protonmail.com>pull/4/head
parent
e9a4602ee0
commit
d0b832fc89
@ -0,0 +1,31 @@
|
|||||||
|
@use 'sass:map';
|
||||||
|
@use '~@angular/material' as mat;
|
||||||
|
|
||||||
|
@mixin color($theme) {
|
||||||
|
$color: #0d071b;
|
||||||
|
$color-lighter: desaturate(lighten($color, 5), 5);
|
||||||
|
.mat-raised-button.mat-warn, .mat-fab.mat-warn, .mat-mini-fab.mat-warn, .mat-flat-button, .mat-raised-button, .mat-fab, .mat-mini-fab, .mat-drawer-inner-container, .mat-drawer-content {
|
||||||
|
background-color: $color;
|
||||||
|
}
|
||||||
|
.mat-card {
|
||||||
|
background-color: $color-lighter;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@mixin typography($theme) {
|
||||||
|
// Get the typography config from the theme.
|
||||||
|
$typography-config: mat.get-typography-config($theme);
|
||||||
|
}
|
||||||
|
|
||||||
|
@mixin theme($theme) {
|
||||||
|
$color-config: mat.get-color-config($theme);
|
||||||
|
@if $color-config != null {
|
||||||
|
@include color($theme);
|
||||||
|
}
|
||||||
|
|
||||||
|
$typography-config: mat.get-typography-config($theme);
|
||||||
|
@if $typography-config != null {
|
||||||
|
@include typography($theme);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1 +0,0 @@
|
|||||||
@import "src/styles";
|
|
@ -1,10 +1,10 @@
|
|||||||
<div id="content">
|
<div id="content">
|
||||||
<mat-toolbar color="primary">
|
<mat-tab-group #tabGroup>
|
||||||
<h1>Files</h1>
|
<mat-tab label="Repositories">
|
||||||
</mat-toolbar>
|
<app-repositories-tab></app-repositories-tab>
|
||||||
<mat-tab-group>
|
</mat-tab>
|
||||||
<mat-tab label="Search">
|
<mat-tab *ngIf="this.selectedRepository" label="Search">
|
||||||
<app-search-page></app-search-page>
|
<app-search-tab></app-search-tab>
|
||||||
</mat-tab>
|
</mat-tab>
|
||||||
</mat-tab-group>
|
</mat-tab-group>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import {FormControl, FormGroup, Validators} from "@angular/forms";
|
import {FormControl, FormGroup, Validators} from "@angular/forms";
|
||||||
import {RepositoryService} from "../../../services/repository/repository.service";
|
import {RepositoryService} from "../../../../services/repository/repository.service";
|
||||||
import {MatSnackBar} from "@angular/material/snack-bar";
|
import {MatSnackBar} from "@angular/material/snack-bar";
|
||||||
import {ErrorBrokerService} from "../../../services/error-broker/error-broker.service";
|
import {ErrorBrokerService} from "../../../../services/error-broker/error-broker.service";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-repo-form',
|
selector: 'app-repo-form',
|
@ -1,4 +1,4 @@
|
|||||||
@import 'src/styles';
|
@import '../../../../styles';
|
||||||
|
|
||||||
|
|
||||||
.repository-container {
|
.repository-container {
|
@ -1,20 +1,20 @@
|
|||||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
import { RepositoriesComponent } from './repositories.component';
|
import { RepositoriesTabComponent } from './repositories-tab.component';
|
||||||
|
|
||||||
describe('RepositoriesComponent', () => {
|
describe('RepositoriesComponent', () => {
|
||||||
let component: RepositoriesComponent;
|
let component: RepositoriesTabComponent;
|
||||||
let fixture: ComponentFixture<RepositoriesComponent>;
|
let fixture: ComponentFixture<RepositoriesTabComponent>;
|
||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await TestBed.configureTestingModule({
|
await TestBed.configureTestingModule({
|
||||||
declarations: [ RepositoriesComponent ]
|
declarations: [ RepositoriesTabComponent ]
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
fixture = TestBed.createComponent(RepositoriesComponent);
|
fixture = TestBed.createComponent(RepositoriesTabComponent);
|
||||||
component = fixture.componentInstance;
|
component = fixture.componentInstance;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
});
|
});
|
@ -1,15 +1,15 @@
|
|||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import {Repository} from "../../models/Repository";
|
import {Repository} from "../../../models/Repository";
|
||||||
import {RepositoryService} from "../../services/repository/repository.service";
|
import {RepositoryService} from "../../../services/repository/repository.service";
|
||||||
import {MatSnackBar} from "@angular/material/snack-bar";
|
import {MatSnackBar} from "@angular/material/snack-bar";
|
||||||
import {FormBuilder, FormGroup} from "@angular/forms";
|
import {FormBuilder, FormGroup} from "@angular/forms";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-repositories',
|
selector: 'app-repositories-tab',
|
||||||
templateUrl: './repositories.component.html',
|
templateUrl: './repositories-tab.component.html',
|
||||||
styleUrls: ['./repositories.component.scss']
|
styleUrls: ['./repositories-tab.component.scss']
|
||||||
})
|
})
|
||||||
export class RepositoriesComponent implements OnInit {
|
export class RepositoriesTabComponent implements OnInit {
|
||||||
|
|
||||||
repositories: Repository[] = [];
|
repositories: Repository[] = [];
|
||||||
|
|
@ -0,0 +1 @@
|
|||||||
|
@import "../../../../../styles";
|
@ -1,28 +1,24 @@
|
|||||||
import {Component, Input, OnInit} from '@angular/core';
|
import {Component, Input, OnInit} from '@angular/core';
|
||||||
import {Repository} from "../../../models/Repository";
|
import {Repository} from "../../../../models/Repository";
|
||||||
import {RepositoryService} from "../../../services/repository/repository.service";
|
import {RepositoryService} from "../../../../services/repository/repository.service";
|
||||||
import {Router} from "@angular/router";
|
import {Router} from "@angular/router";
|
||||||
import {ErrorBrokerService} from "../../../services/error-broker/error-broker.service";
|
import {ErrorBrokerService} from "../../../../services/error-broker/error-broker.service";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-repository-card',
|
selector: 'app-repository-card',
|
||||||
templateUrl: './repository-card.component.html',
|
templateUrl: './repository-card.component.html',
|
||||||
styleUrls: ['./repository-card.component.scss']
|
styleUrls: ['./repository-card.component.scss']
|
||||||
})
|
})
|
||||||
export class RepositoryCardComponent implements OnInit {
|
export class RepositoryCardComponent {
|
||||||
|
|
||||||
@Input() repository?: Repository;
|
@Input() repository?: Repository;
|
||||||
|
|
||||||
constructor(private repoService: RepositoryService, private router: Router, private errorBroker: ErrorBrokerService) {}
|
constructor(private repoService: RepositoryService, private router: Router, private errorBroker: ErrorBrokerService) {}
|
||||||
|
|
||||||
ngOnInit(): void {
|
|
||||||
}
|
|
||||||
|
|
||||||
async selectRepository() {
|
async selectRepository() {
|
||||||
if (this.repository) {
|
if (this.repository) {
|
||||||
try {
|
try {
|
||||||
await this.repoService.setRepository(this.repository);
|
await this.repoService.setRepository(this.repository);
|
||||||
await this.router.navigate([""]);
|
|
||||||
} catch(err) {
|
} catch(err) {
|
||||||
this.errorBroker.showError(err);
|
this.errorBroker.showError(err);
|
||||||
}
|
}
|
@ -1,20 +1,20 @@
|
|||||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
import { SearchPageComponent } from './search-page.component';
|
import { SearchTabComponent } from './search-tab.component';
|
||||||
|
|
||||||
describe('SearchPageComponent', () => {
|
describe('SearchPageComponent', () => {
|
||||||
let component: SearchPageComponent;
|
let component: SearchTabComponent;
|
||||||
let fixture: ComponentFixture<SearchPageComponent>;
|
let fixture: ComponentFixture<SearchTabComponent>;
|
||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await TestBed.configureTestingModule({
|
await TestBed.configureTestingModule({
|
||||||
declarations: [ SearchPageComponent ]
|
declarations: [ SearchTabComponent ]
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
fixture = TestBed.createComponent(SearchPageComponent);
|
fixture = TestBed.createComponent(SearchTabComponent);
|
||||||
component = fixture.componentInstance;
|
component = fixture.componentInstance;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
});
|
});
|
@ -1 +0,0 @@
|
|||||||
@import "src/styles";
|
|
Loading…
Reference in New Issue