Skip to content

Commit

Permalink
Merge 9ea6568 into aa53245
Browse files Browse the repository at this point in the history
  • Loading branch information
tidusjar authored Aug 3, 2022
2 parents aa53245 + 9ea6568 commit db2bea9
Show file tree
Hide file tree
Showing 10 changed files with 232 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/chromatic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
exitOnceUploaded: true

- name: Publish to Chromatic and auto accept changes
if: github.ref == 'refs/heads/master'
if: github.ref == 'refs/heads/develop'
uses: chromaui/action@v1
with:
projectToken: 7c47e1a1a4bd
Expand Down
5 changes: 4 additions & 1 deletion src/Ombi/ClientApp/.storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,8 @@ module.exports = {
"core": {
"builder": "@storybook/builder-webpack5"
},
"staticDirs": ['../../wwwroot/images']
"staticDirs": [{from :'../../wwwroot/images', to: 'images'}],
"features": {
interactionsDebugger: true,
}
}
4 changes: 4 additions & 0 deletions src/Ombi/ClientApp/.storybook/preview-body.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,8 @@
.test-class {
background-color: purple;
}

body {
background: #0f171f;
}
</style>
13 changes: 7 additions & 6 deletions src/Ombi/ClientApp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@
"@angular/platform-server": "^14.0.0",
"@angular/router": "^14.0.0",
"@angularclass/hmr": "^3.0.0",
"@microsoft/signalr": "^6.0.7",
"@auth0/angular-jwt": "^5.0.2",
"@fortawesome/fontawesome-free": "^6.0.0",
"@fullcalendar/core": "^4.2.0",
"@fullcalendar/daygrid": "^4.4.0",
"@fullcalendar/interaction": "^4.2.0",
"@microsoft/signalr": "^6.0.7",
"@ngx-translate/core": "^14.0.0",
"@ngx-translate/http-loader": "^7.0.0",
"@ngxs/devtools-plugin": "^3.7.3",
Expand All @@ -57,16 +57,16 @@
"popper.js": "^1.14.3",
"primeicons": "^5.0.0",
"primeng": "^13.2.0",
"protractor": "~5.4.0",
"rxjs": "^7.5.4",
"sass-recursive-map-merge": "^1.0.1",
"store": "^2.0.12",
"ts-md5": "^1.2.7",
"ts-node": "~5.0.1",
"tslib": "^1.10.0",
"tslint": "^5.12.0",
"tslint-angular": "^1.1.2",
"zone.js": "~0.11.4",
"protractor": "~5.4.0",
"ts-node": "~5.0.1",
"tslint": "^5.12.0"
"zone.js": "~0.11.4"
},
"devDependencies": {
"@angular-devkit/build-angular": "^14.0.0",
Expand All @@ -75,17 +75,18 @@
"@angular/language-service": "^14.0.0",
"@babel/core": "^7.18.9",
"@compodoc/compodoc": "^1.1.19",
"@types/node": "^16.11.45",
"@storybook/addon-actions": "^6.5.9",
"@storybook/addon-essentials": "^6.5.9",
"@storybook/addon-interactions": "^6.5.9",
"@storybook/addon-links": "^6.5.9",
"@storybook/angular": "^6.5.9",
"@storybook/builder-webpack5": "^6.5.9",
"@storybook/jest": "^0.0.10",
"@storybook/manager-webpack5": "^6.5.9",
"@storybook/testing-library": "^0.0.13",
"@types/jasmine": "~3.6.7",
"@types/jasminewd2": "~2.0.8",
"@types/node": "^16.11.45",
"babel-loader": "^8.2.5",
"chromatic": "^6.7.1",
"codelyzer": "^6.0.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@

<social-icons [homepage]="movie.homepage" [theMoviedbId]="movie.id"
[hasTrailer]="movie.videos?.results?.length > 0" [imdbId]="movie.imdbId"
[twitter]="movie.externalIds.twitterId" [facebook]="movie.externalIds.facebookId"
[instagram]="movie.externalIds.instagramId" [available]="movie.available" [plexUrl]="movie.plexUrl"
[embyUrl]="movie.embyUrl" [jellyfinUrl]="movie.jellyfinUrl" [isAdmin]="isAdmin"
[twitter]="movie.externalIds?.twitterId" [facebook]="movie.externalIds?.facebookId"
[instagram]="movie.externalIds?.instagramId" [available]="movie.available" [isAdmin]="isAdmin"
[canShowAdvanced]="showAdvanced && movieRequest" [type]="requestType" [has4KRequest]="movie.has4KRequest"
(openTrailer)="openDialog()" (onAdvancedOptions)="openAdvancedOptions()"
(onReProcessRequest)="reProcessRequest(false)" (onReProcess4KRequest)="reProcessRequest(true)">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<i matTooltip="The TV DB" class="fas fa-tv fa-2x grow-social"></i>
</a>

<a *ngIf="hasTrailer" class="media-icons youtube" (click)="openDialog()">
<a *ngIf="hasTrailer" data-testid="social-trailer" class="media-icons youtube" (click)="openDialog()">
<i matTooltip="Trailer" class="fab fa-youtube fa-2x grow-social"></i>
</a>
<a *ngIf="imdbId" class="media-icons imdb" [href]="doNotAppend ? imdbid : 'https://imdb.com/title/' + imdbId" target="_blank">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
// also exported from '@storybook/angular' if you can deal with breaking changes in 6.1
import { APP_BASE_HREF } from '@angular/common';
import { Story, Meta, moduleMetadata } from '@storybook/angular';
import { SocialIconsComponent } from './social-icons.component';
import { MatMenuModule } from "@angular/material/menu";
import { RequestType } from '../../../../interfaces';
import { userEvent, waitFor, within } from '@storybook/testing-library';
import { expect } from '@storybook/jest';

// More on default export: https://storybook.js.org/docs/angular/writing-stories/introduction#default-export
export default {
title: 'Social Icons',
component: SocialIconsComponent,
decorators: [
moduleMetadata({
providers: [
{
provide: APP_BASE_HREF,
useValue: ""
},
],
imports: [MatMenuModule]
})
]
} as Meta;

// More on component templates: https://storybook.js.org/docs/angular/writing-stories/introduction#using-args
const Template: Story<SocialIconsComponent> = (args: SocialIconsComponent) => ({
props: args,
});

export const All = Template.bind({});
// More on args: https://storybook.js.org/docs/angular/writing-stories/args
All.args = {
twitter: "test",
homepage: "test",
theMoviedbId: 1,
hasTrailer: true,
imdbId: "test",
tvdbId: "test",
facebook: "test",
instagram: "test",
available: true,
doNotAppend: false,
type: RequestType.movie,
isAdmin: false,
canShowAdvanced: false,
has4KRequest: false
};

export const Admin = Template.bind({});
Admin.args = {
twitter: "test",
homepage: "test",
theMoviedbId: 1,
hasTrailer: true,
imdbId: "test",
tvdbId: "test",
facebook: "test",
instagram: "test",
available: true,
doNotAppend: false,
type: RequestType.movie,
isAdmin: true,
canShowAdvanced: true,
has4KRequest: true
};
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,9 @@ export class SocialIconsComponent {
@Input() hasTrailer: boolean;
@Input() imdbId: string;
@Input() tvdbId: string;
@Input() twitter: string;
@Input() facebook: string;
@Input() instagram: string;
@Input() available: boolean;
@Input() plexUrl: string;
@Input() embyUrl: string;
@Input() jellyfinUrl: string;
@Input() twitter: string|undefined;
@Input() facebook: string|undefined;
@Input() instagram: string|undefined;
@Input() doNotAppend: boolean;
@Input() type: RequestType;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,11 @@ <h3> {{ 'MediaDetails.NotEnoughInfo' | translate }}</h3>
[homepage]="tv.homepage"
[theMoviedbId]="tv.id"
[hasTrailer]="tv.trailer"
[twitter]="tv.externalIds.twitterId"
[facebook]="tv.externalIds.facebookId"
[instagram]="tv.externalIds.instagramId"
[twitter]="tv.externalIds?.twitterId"
[facebook]="tv.externalIds?.facebookId"
[instagram]="tv.externalIds?.instagramId"
(openTrailer)="openDialog()"
[imdbId]="tv.imdbId"
[available]="tv.available || tv.partlyAvailable"
[plexUrl]="tv.plexUrl"
[embyUrl]="tv.embyUrl"
[jellyfinUrl]="tv.jellyfinUrl"
[isAdmin]="isAdmin"
[canShowAdvanced]="showAdvanced && showRequest"
[type]="requestType"
Expand Down
Loading

0 comments on commit db2bea9

Please sign in to comment.