Skip to content

Commit

Permalink
Merge pull request #1838 from DSD-DBS/git-repository-link
Browse files Browse the repository at this point in the history
refactor: Apply new code style and write Stories for Git components
  • Loading branch information
MoritzWeber0 authored Sep 24, 2024
2 parents d1d406e + 7690399 commit a97f2df
Show file tree
Hide file tree
Showing 29 changed files with 877 additions and 718 deletions.
2 changes: 1 addition & 1 deletion backend/capellacollab/settings/modelsources/git/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def edit_git_instance(
)
],
)
def delete_git_instances(
def delete_git_instance(
git_instance: models.DatabaseGitInstance = fastapi.Depends(
injectables.get_existing_git_instance
),
Expand Down
21 changes: 18 additions & 3 deletions frontend/src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { SessionComponent } from 'src/app/sessions/session/session.component';
import { ConfigurationSettingsComponent } from 'src/app/settings/core/configuration-settings/configuration-settings.component';
import { PipelinesOverviewComponent } from 'src/app/settings/core/pipelines-overview/pipelines-overview.component';
import { CreateToolComponent } from 'src/app/settings/core/tools-settings/create-tool/create-tool.component';
import { AddGitInstanceComponent } from 'src/app/settings/modelsources/git-settings/add-git-instance/add-git-instance.component';
import { BasicAuthTokenComponent } from 'src/app/users/basic-auth-token/basic-auth-token.component';
import { UserWrapperComponent } from 'src/app/users/user-wrapper/user-wrapper.component';
import { UsersProfileComponent } from 'src/app/users/users-profile/users-profile.component';
Expand Down Expand Up @@ -394,16 +395,30 @@ export const routes: Routes = [
data: { breadcrumb: undefined },
children: [
{
path: 'git',
path: 'git-instances',
data: { breadcrumb: 'Git Instances' },
children: [
{
path: '',
data: { breadcrumb: undefined },
component: GitSettingsComponent,
children: [{ path: '', component: GitSettingsComponent }],
},
{
path: 'instances/:id',
path: 'create',
data: { breadcrumb: 'new' },
component: AddGitInstanceComponent,
},
],
},
{
path: 'git-instance',
data: {
breadcrumb: 'Git Instances',
redirect: '/settings/modelsources/git-instances',
},
children: [
{
path: ':id',
data: {
breadcrumb: (data: Data) => data.gitInstance?.name,
},
Expand Down
17 changes: 2 additions & 15 deletions frontend/src/app/general/auth/auth/auth.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
* SPDX-FileCopyrightText: Copyright DB InfraGO AG and contributors
* SPDX-License-Identifier: Apache-2.0
*/
import { ActivatedRoute, convertToParamMap, Params } from '@angular/router';
import { ActivatedRoute } from '@angular/router';
import { Meta, moduleMetadata, StoryObj } from '@storybook/angular';
import { BehaviorSubject } from 'rxjs';
import { MetadataService } from 'src/app/general/metadata/metadata.service';
import { mockMetadata, MockMetadataService } from 'src/storybook/metadata';
import { MockActivedRoute } from 'src/storybook/routes';
import { AuthComponent } from './auth.component';

const meta: Meta<AuthComponent> = {
Expand All @@ -33,19 +33,6 @@ const meta: Meta<AuthComponent> = {
export default meta;
type Story = StoryObj<AuthComponent>;

export class MockActivedRoute {
_queryParams = new BehaviorSubject<Params>({});
queryParams = this._queryParams.asObservable();

_queryParamMap = new BehaviorSubject(convertToParamMap({}));
queryParamMap = this._queryParamMap.asObservable();

constructor(params: Params) {
this._queryParams.next(params);
this._queryParamMap.next(convertToParamMap(params));
}
}

export const IdentityProviderError: Story = {
decorators: [
moduleMetadata({
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
-->

<h2 class="mb-2 text-xl font-medium">Git repositories</h2>
<div class="flex flex-wrap gap-2">
<div class="flex flex-wrap gap-5">
<a [routerLink]="['..', 'git-model', 'create']" class="w-full sm:w-fit">
<div matRipple class="mat-card-overview new collab-card">
<div class="content">
Expand Down Expand Up @@ -61,7 +61,7 @@ <h2 class="mb-2 text-xl font-medium">Git repositories</h2>
userService.user?.role === "administrator"
) {
<h2 class="mb-2 mt-5 text-xl font-medium">TeamForCapella repositories</h2>
<div class="flex flex-wrap gap-2">
<div class="flex flex-wrap gap-5">
<a
[routerLink]="['..', 't4c-model', 'create-existing']"
class="w-full sm:w-fit"
Expand Down

This file was deleted.

Loading

0 comments on commit a97f2df

Please sign in to comment.