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">
|
||||
<mat-toolbar color="primary">
|
||||
<h1>Files</h1>
|
||||
</mat-toolbar>
|
||||
<mat-tab-group>
|
||||
<mat-tab label="Search">
|
||||
<app-search-page></app-search-page>
|
||||
<mat-tab-group #tabGroup>
|
||||
<mat-tab label="Repositories">
|
||||
<app-repositories-tab></app-repositories-tab>
|
||||
</mat-tab>
|
||||
<mat-tab *ngIf="this.selectedRepository" label="Search">
|
||||
<app-search-tab></app-search-tab>
|
||||
</mat-tab>
|
||||
</mat-tab-group>
|
||||
</div>
|
||||
|
@ -1,8 +1,8 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
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 {ErrorBrokerService} from "../../../services/error-broker/error-broker.service";
|
||||
import {ErrorBrokerService} from "../../../../services/error-broker/error-broker.service";
|
||||
|
||||
@Component({
|
||||
selector: 'app-repo-form',
|
@ -1,4 +1,4 @@
|
||||
@import 'src/styles';
|
||||
@import '../../../../styles';
|
||||
|
||||
|
||||
.repository-container {
|
@ -1,20 +1,20 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { RepositoriesComponent } from './repositories.component';
|
||||
import { RepositoriesTabComponent } from './repositories-tab.component';
|
||||
|
||||
describe('RepositoriesComponent', () => {
|
||||
let component: RepositoriesComponent;
|
||||
let fixture: ComponentFixture<RepositoriesComponent>;
|
||||
let component: RepositoriesTabComponent;
|
||||
let fixture: ComponentFixture<RepositoriesTabComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [ RepositoriesComponent ]
|
||||
declarations: [ RepositoriesTabComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(RepositoriesComponent);
|
||||
fixture = TestBed.createComponent(RepositoriesTabComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
@ -1,15 +1,15 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import {Repository} from "../../models/Repository";
|
||||
import {RepositoryService} from "../../services/repository/repository.service";
|
||||
import {Repository} from "../../../models/Repository";
|
||||
import {RepositoryService} from "../../../services/repository/repository.service";
|
||||
import {MatSnackBar} from "@angular/material/snack-bar";
|
||||
import {FormBuilder, FormGroup} from "@angular/forms";
|
||||
|
||||
@Component({
|
||||
selector: 'app-repositories',
|
||||
templateUrl: './repositories.component.html',
|
||||
styleUrls: ['./repositories.component.scss']
|
||||
selector: 'app-repositories-tab',
|
||||
templateUrl: './repositories-tab.component.html',
|
||||
styleUrls: ['./repositories-tab.component.scss']
|
||||
})
|
||||
export class RepositoriesComponent implements OnInit {
|
||||
export class RepositoriesTabComponent implements OnInit {
|
||||
|
||||
repositories: Repository[] = [];
|
||||
|
@ -0,0 +1 @@
|
||||
@import "../../../../../styles";
|
@ -1,28 +1,24 @@
|
||||
import {Component, Input, OnInit} from '@angular/core';
|
||||
import {Repository} from "../../../models/Repository";
|
||||
import {RepositoryService} from "../../../services/repository/repository.service";
|
||||
import {Repository} from "../../../../models/Repository";
|
||||
import {RepositoryService} from "../../../../services/repository/repository.service";
|
||||
import {Router} from "@angular/router";
|
||||
import {ErrorBrokerService} from "../../../services/error-broker/error-broker.service";
|
||||
import {ErrorBrokerService} from "../../../../services/error-broker/error-broker.service";
|
||||
|
||||
@Component({
|
||||
selector: 'app-repository-card',
|
||||
templateUrl: './repository-card.component.html',
|
||||
styleUrls: ['./repository-card.component.scss']
|
||||
})
|
||||
export class RepositoryCardComponent implements OnInit {
|
||||
export class RepositoryCardComponent {
|
||||
|
||||
@Input() repository?: Repository;
|
||||
|
||||
constructor(private repoService: RepositoryService, private router: Router, private errorBroker: ErrorBrokerService) {}
|
||||
|
||||
ngOnInit(): void {
|
||||
}
|
||||
|
||||
async selectRepository() {
|
||||
if (this.repository) {
|
||||
try {
|
||||
await this.repoService.setRepository(this.repository);
|
||||
await this.router.navigate([""]);
|
||||
} catch(err) {
|
||||
this.errorBroker.showError(err);
|
||||
}
|
@ -1,20 +1,20 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { SearchPageComponent } from './search-page.component';
|
||||
import { SearchTabComponent } from './search-tab.component';
|
||||
|
||||
describe('SearchPageComponent', () => {
|
||||
let component: SearchPageComponent;
|
||||
let fixture: ComponentFixture<SearchPageComponent>;
|
||||
let component: SearchTabComponent;
|
||||
let fixture: ComponentFixture<SearchTabComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [ SearchPageComponent ]
|
||||
declarations: [ SearchTabComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(SearchPageComponent);
|
||||
fixture = TestBed.createComponent(SearchTabComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
@ -1 +0,0 @@
|
||||
@import "src/styles";
|
Loading…
Reference in New Issue