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