Skip to content
Snippets Groups Projects
Commit ab88a4aa authored by OZGCloud's avatar OZGCloud
Browse files

OZG-5981 Rename containers to wrappers

parent cafea3dc
Branches
Tags
No related merge requests found
Showing
with 71 additions and 50 deletions
......@@ -15,7 +15,7 @@
</div>
<main class="flex-auto bg-background-50 p-6">
<div class="w-96">
<ods-attachment-container>
<ods-attachment-wrapper>
<ods-attachment
caption="Mein_2Bescheid.pdf"
description="234 kB"
......@@ -39,7 +39,7 @@
fileType="pdf"
>
</ods-attachment>
</ods-attachment-container>
</ods-attachment-wrapper>
</div>
<form id="antrag_bescheiden_form" [formGroup]="exampleForm">
......
......@@ -5,8 +5,8 @@ import { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms';
import { RouterModule } from '@angular/router';
import {
AttachmentComponent,
AttachmentContainerComponent,
AttachmentIconComponent,
AttachmentWrapperComponent,
BescheidGenerateIconComponent,
BescheidUploadIconComponent,
ButtonCardComponent,
......@@ -34,7 +34,7 @@ import { CustomStepperComponent } from './components/cdk-demo/custom-stepper.com
imports: [
CommonModule,
AttachmentComponent,
AttachmentContainerComponent,
AttachmentWrapperComponent,
ButtonComponent,
ButtonCardComponent,
FileUploadButtonComponent,
......
<div class="flex max-w-xl flex-col gap-4">
<ods-bescheid-container
<ods-bescheid-wrapper
*ngFor="let bescheid of bescheidList | toEmbeddedResources: bescheidListLinkRel.BESCHEID_LIST"
data-test-id="bescheid-container-in-vorgang"
>
......@@ -23,5 +23,5 @@
[resource]="bescheid"
[linkRel]="bescheidLinkRel.ATTACHMENTS"
></alfa-binary-file-list-container>
</ods-bescheid-container>
</ods-bescheid-wrapper>
</div>
......@@ -5,7 +5,7 @@ import { existsAsHtmlElement, notExistsAsHtmlElement } from '@alfa-client/test-u
import { DatePipe } from '@angular/common';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { MatIcon } from '@angular/material/icon';
import { BescheidContainerComponent, BescheidStatusTextComponent } from '@ods/system';
import { BescheidStatusTextComponent, BescheidWrapperComponent } from '@ods/system';
import {
createBescheidListResource,
createBescheidResource,
......@@ -37,7 +37,7 @@ describe('BescheidListInVorgangComponent', () => {
MockComponent(DocumentInBescheidContainerComponent),
MockComponent(BinaryFileListContainerComponent),
MockComponent(BescheidStatusTextComponent),
MockComponent(BescheidContainerComponent),
MockComponent(BescheidWrapperComponent),
],
}).compileComponents();
......
<ng-container *ngIf="documentStateResource$ | async as documentStateResource">
<ods-attachment-container>
<ods-attachment-wrapper>
<alfa-binary-file-uri-container
*ngIf="documentStateResource.resource | hasLink: documentLinkRel.FILE"
data-test-class="binary-file-uri-container"
[binaryFileUri]="documentStateResource.resource | getUrl: documentLinkRel.FILE"
></alfa-binary-file-uri-container>
</ods-attachment-container>
</ods-attachment-wrapper>
</ng-container>
......@@ -16,7 +16,7 @@ import {
import { ComponentFixture, TestBed } from '@angular/core/testing';
import faker from '@faker-js/faker';
import { ResourceUri, getUrl } from '@ngxp/rest';
import { AttachmentContainerComponent } from '@ods/system';
import { AttachmentWrapperComponent } from '@ods/system';
import { DocumentLinkRel } from 'libs/bescheid-shared/src/lib/document.linkrel';
import { DocumentResource } from 'libs/bescheid-shared/src/lib/document.model';
import { getDataTestClassOf } from 'libs/tech-shared/test/data-test';
......@@ -45,7 +45,7 @@ describe('DocumentInBescheidContainerComponent', () => {
HasLinkPipe,
GetUrlPipe,
MockComponent(BinaryFileUriContainerComponent),
MockComponent(AttachmentContainerComponent),
MockComponent(AttachmentWrapperComponent),
],
providers: [
{
......
......@@ -16,8 +16,8 @@ import { CreateBescheidButtonContainerComponent } from './create-bescheid-button
import { CreateBescheidButtonComponent } from './create-bescheid-button-container/create-bescheid-button/create-bescheid-button.component';
import {
BescheidContainerComponent,
BescheidStatusTextComponent,
BescheidWrapperComponent,
CloseIconComponent,
StampIconComponent,
} from '@ods/system';
......@@ -31,7 +31,7 @@ import {
UiModule,
CommandSharedModule,
BescheidStatusTextComponent,
BescheidContainerComponent,
BescheidWrapperComponent,
StampIconComponent,
CloseIconComponent,
],
......
<ods-attachment-container>
<ods-attachment-wrapper>
<alfa-binary-file-list
[binaryFileListStateResource]="binaryFileListStateResource$ | async"
></alfa-binary-file-list>
</ods-attachment-container>
</ods-attachment-wrapper>
......@@ -11,7 +11,7 @@ import { of } from 'rxjs';
import { BinaryFileListContainerComponent } from './binary-file-list-container.component';
import { BinaryFileListComponent } from './binary-file-list/binary-file-list.component';
import { AttachmentContainerComponent } from '@ods/system';
import { AttachmentWrapperComponent } from '@ods/system';
describe('BinaryFileListContainerComponent', () => {
let component: BinaryFileListContainerComponent;
......@@ -30,7 +30,7 @@ describe('BinaryFileListContainerComponent', () => {
declarations: [
BinaryFileListContainerComponent,
MockComponent(BinaryFileListComponent),
MockComponent(AttachmentContainerComponent),
MockComponent(AttachmentWrapperComponent),
],
providers: [
{
......
<ng-container *ngIf="binaryFileStateResource$ | async as binaryFileStateResource">
<ods-attachment-container>
<ods-attachment-wrapper>
<alfa-binary-file2-container
*ngIf="binaryFileStateResource.resource as binaryFile"
data-test-class="binary-file-container"
......@@ -7,5 +7,5 @@
[isLoading]="binaryFileStateResource.loading"
[deletable]="false"
></alfa-binary-file2-container>
</ods-attachment-container>
</ods-attachment-wrapper>
</ng-container>
......@@ -21,7 +21,7 @@ import { of } from 'rxjs';
import { BinaryFile2ContainerComponent } from '../binary-file2-container/binary-file2-container.component';
import { BinaryFileUriContainerComponent } from './binary-file-uri-container.component';
import { AttachmentContainerComponent } from '@ods/system';
import { AttachmentWrapperComponent } from '@ods/system';
describe('BinaryFileUriContainerComponent', () => {
let component: BinaryFileUriContainerComponent;
......@@ -37,7 +37,7 @@ describe('BinaryFileUriContainerComponent', () => {
declarations: [
BinaryFileUriContainerComponent,
MockComponent(BinaryFile2ContainerComponent),
MockComponent(AttachmentContainerComponent),
MockComponent(AttachmentWrapperComponent),
],
providers: [
{
......
......@@ -27,7 +27,7 @@ import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import {
AttachmentComponent,
AttachmentContainerComponent,
AttachmentWrapperComponent,
CloseIconComponent,
SpinnerIconComponent,
} from '@ods/system';
......@@ -49,7 +49,7 @@ import { VerticalBinaryFileListComponent } from './vertical-binary-file-list/ver
UiModule,
TechSharedModule,
AttachmentComponent,
AttachmentContainerComponent,
AttachmentWrapperComponent,
SpinnerIconComponent,
CloseIconComponent,
],
......
......@@ -24,7 +24,7 @@
-->
<ozgcloud-spinner [stateResource]="binaryFileListStateResource">
<ods-attachment-container [title]="title" data-test-id="file-list">
<ods-attachment-wrapper [title]="title" data-test-id="file-list">
<alfa-download-archive-file-button-container
*ngIf="archiveDownloadUri"
data-test-class="download-archive-file-button"
......@@ -43,5 +43,5 @@
>
</alfa-binary-file2-container>
</ng-container>
</ods-attachment-container>
</ods-attachment-wrapper>
</ozgcloud-spinner>
......@@ -32,7 +32,7 @@ import { SpinnerComponent } from '@alfa-client/ui';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import faker from '@faker-js/faker';
import { ResourceUri } from '@ngxp/rest';
import { AttachmentContainerComponent } from '@ods/system';
import { AttachmentWrapperComponent } from '@ods/system';
import {
createBinaryFileListResource,
createBinaryFileResource,
......@@ -56,7 +56,7 @@ describe('VerticalBinaryFileListComponent', () => {
declarations: [
VerticalBinaryFileListComponent,
ToEmbeddedResourcesPipe,
MockComponent(AttachmentContainerComponent),
MockComponent(AttachmentWrapperComponent),
MockComponent(BinaryFile2ContainerComponent),
MockComponent(SpinnerComponent),
MockComponent(DownloadArchiveFileButtonContainerComponent),
......
export * from './lib/attachment-container/attachment-container.component';
export * from './lib/attachment-wrapper/attachment-wrapper.component';
export * from './lib/attachment/attachment.component';
export * from './lib/bescheid-container/bescheid-container.component';
export * from './lib/bescheid-status-text/bescheid-status-text.component';
export * from './lib/bescheid-wrapper/bescheid-wrapper.component';
export * from './lib/button-card/button-card.component';
export * from './lib/button/button.component';
export * from './lib/form/error-message/error-message.component';
......
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { BescheidContainerComponent } from './bescheid-container.component';
import { AttachmentWrapperComponent } from './attachment-wrapper.component';
describe('BescheidContainerComponent', () => {
let component: BescheidContainerComponent;
let fixture: ComponentFixture<BescheidContainerComponent>;
describe('AttachmentWrapperComponent', () => {
let component: AttachmentWrapperComponent;
let fixture: ComponentFixture<AttachmentWrapperComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [BescheidContainerComponent],
imports: [AttachmentWrapperComponent],
}).compileComponents();
fixture = TestBed.createComponent(BescheidContainerComponent);
fixture = TestBed.createComponent(AttachmentWrapperComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
......
......@@ -2,7 +2,7 @@ import { CommonModule } from '@angular/common';
import { Component, Input } from '@angular/core';
@Component({
selector: 'ods-attachment-container',
selector: 'ods-attachment-wrapper',
standalone: true,
imports: [CommonModule],
styles: [
......@@ -14,6 +14,6 @@ import { Component, Input } from '@angular/core';
</div>
<ng-content></ng-content>`,
})
export class AttachmentContainerComponent {
export class AttachmentWrapperComponent {
@Input() title: string = '';
}
......@@ -3,21 +3,21 @@ import { argsToTemplate, moduleMetadata, type Meta, type StoryObj } from '@story
import { DownloadButtonComponent } from '../../../../design-component/src/lib/download-button/download-button.component';
import { AttachmentComponent } from '../attachment/attachment.component';
import { AttachmentContainerComponent } from './attachment-container.component';
import { AttachmentWrapperComponent } from './attachment-wrapper.component';
const meta: Meta<AttachmentContainerComponent> = {
title: 'Containers/Attachment container',
component: AttachmentContainerComponent,
const meta: Meta<AttachmentWrapperComponent> = {
title: 'Wrappers/Attachment wrapper',
component: AttachmentWrapperComponent,
parameters: {
docs: {
description: {
component: 'Container for multiple attachments',
component: 'Wrapper for multiple attachments',
},
},
},
decorators: [
moduleMetadata({
imports: [AttachmentContainerComponent, AttachmentComponent, DownloadButtonComponent],
imports: [AttachmentWrapperComponent, AttachmentComponent, DownloadButtonComponent],
}),
],
excludeStories: /.*Data$/,
......@@ -25,7 +25,7 @@ const meta: Meta<AttachmentContainerComponent> = {
};
export default meta;
type Story = StoryObj<AttachmentContainerComponent>;
type Story = StoryObj<AttachmentWrapperComponent>;
export const Default: Story = {
args: {
......@@ -38,10 +38,10 @@ export const Default: Story = {
},
render: (args) => ({
props: args,
template: `<ods-attachment-container ${argsToTemplate(args)}>
template: `<ods-attachment-wrapper ${argsToTemplate(args)}>
<ods-download-button action-buttons />
<ods-attachment caption="Attachment" description="200 kB" fileType="pdf"></ods-attachment>
<ods-attachment caption="Second attachment" description="432 kB" fileType="doc"></ods-attachment>
</ods-attachment-container>`,
</ods-attachment-wrapper>`,
}),
};
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { AttachmentContainerComponent } from './attachment-container.component';
import { BescheidWrapperComponent } from './bescheid-wrapper.component';
describe('AttachmentContainerComponent', () => {
let component: AttachmentContainerComponent;
let fixture: ComponentFixture<AttachmentContainerComponent>;
describe('BescheidWrapperComponent', () => {
let component: BescheidWrapperComponent;
let fixture: ComponentFixture<BescheidWrapperComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [AttachmentContainerComponent],
imports: [BescheidWrapperComponent],
}).compileComponents();
fixture = TestBed.createComponent(AttachmentContainerComponent);
fixture = TestBed.createComponent(BescheidWrapperComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
......
......@@ -2,11 +2,11 @@ import { CommonModule } from '@angular/common';
import { Component } from '@angular/core';
@Component({
selector: 'ods-bescheid-container',
selector: 'ods-bescheid-wrapper',
standalone: true,
imports: [CommonModule],
template: ` <article class="bg-background-150 flex flex-col gap-4 rounded-lg p-4">
template: ` <article class="flex flex-col gap-4 rounded-lg bg-background-150 p-4">
<ng-content></ng-content>
</article>`,
})
export class BescheidContainerComponent {}
export class BescheidWrapperComponent {}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment