diff --git a/src/Ombi.Mapping/Profiles/TvProfileV2.cs b/src/Ombi.Mapping/Profiles/TvProfileV2.cs index 51e2ac94b..d54321d01 100644 --- a/src/Ombi.Mapping/Profiles/TvProfileV2.cs +++ b/src/Ombi.Mapping/Profiles/TvProfileV2.cs @@ -14,31 +14,7 @@ namespace Ombi.Mapping.Profiles { public TvProfileV2() { - CreateMap() - .ForMember(dest => dest.Id, opts => opts.MapFrom(src => src.externals.thetvdb)) - .ForMember(dest => dest.FirstAired, opts => opts.MapFrom(src => src.premiered)) - .ForMember(dest => dest.ImdbId, opts => opts.MapFrom(src => src.externals.imdb)) - .ForMember(dest => dest.Network, opts => opts.MapFrom(src => src.network.name)) - .ForMember(dest => dest.NetworkId, opts => opts.MapFrom(src => src.network.id.ToString())) - .ForMember(dest => dest.Overview, opts => opts.MapFrom(src => src.summary.RemoveHtml())) - .ForMember(dest => dest.Rating, - opts => opts.MapFrom(src => src.rating.average.ToString(CultureInfo.CurrentUICulture))) - .ForMember(dest => dest.Runtime, opts => opts.MapFrom(src => src.runtime.ToString())) - .ForMember(dest => dest.SeriesId, opts => opts.MapFrom(src => src.id)) - .ForMember(dest => dest.Title, opts => opts.MapFrom(src => src.name)) - .ForMember(dest => dest.Network, opts => opts.MapFrom(src => src.network)) - //.ForMember(dest => dest.Images, opts => opts.MapFrom(src => src.image)) - .ForMember(dest => dest.Cast, opts => opts.MapFrom(src => src._embedded.cast)) - .ForMember(dest => dest.Crew, opts => opts.MapFrom(src => src._embedded.crew)) - .ForMember(dest => dest.Banner, - opts => opts.MapFrom(src => - !string.IsNullOrEmpty(src.image.medium) - ? src.image.medium.ToHttpsUrl() - : string.Empty)) - .ForMember(dest => dest.Status, opts => opts.MapFrom(src => src.status)); - - - + CreateMap() .ForMember(dest => dest.Id, opts => opts.MapFrom(src => src.id)) .ForMember(dest => dest.FirstAired, opts => opts.MapFrom(src => src.first_air_date)) @@ -78,11 +54,6 @@ namespace Ombi.Mapping.Profiles .ForMember(dest => dest.id, opts => opts.MapFrom(src => src.id)) .ForMember(dest => dest.name, opts => opts.MapFrom(src => src.name)); - CreateMap() - .ForMember(dest => dest.Id, opts => opts.MapFrom(src => src.id)) - .ForMember(dest => dest.Country, opts => opts.MapFrom(src => src.country)) - .ForMember(dest => dest.Name, opts => opts.MapFrom(src => src.name)); - CreateMap() .ForMember(dest => dest.Id, opts => opts.MapFrom(src => src.id)) .ForMember(dest => dest.Country, opts => opts.MapFrom(src => src.origin_country)) @@ -93,49 +64,17 @@ namespace Ombi.Mapping.Profiles .ForMember(dest => dest.Code, opts => opts.MapFrom(src => src.code)) .ForMember(dest => dest.Timezone, opts => opts.MapFrom(src => src.timezone)); - //CreateMap() - // .ForMember(dest => dest.Medium, opts => opts.MapFrom(src => src.medium.ToHttpsUrl())) - // .ForMember(dest => dest.Original, opts => opts.MapFrom(src => src.original.ToHttpsUrl())); - - //CreateMap() - // .ForMember(dest => dest.Character, opts => opts.MapFrom(src => src.character)) - // .ForMember(dest => dest.Person, opts => opts.MapFrom(src => src.person)) - // .ForMember(dest => dest.Voice, opts => opts.MapFrom(src => src.voice)) - // .ForMember(dest => dest.Self, opts => opts.MapFrom(src => src.self)); - CreateMap() .ForMember(dest => dest.Character, opts => opts.MapFrom(src => src.character)) .ForMember(dest => dest.Person, opts => opts.MapFrom(src => src.name)) .ForMember(dest => dest.Image, opts => opts.MapFrom(src => src.profile_path)) .ForMember(dest => dest.Id, opts => opts.MapFrom(src => src.id)); - CreateMap() - .ForMember(dest => dest.Id, opts => opts.MapFrom(src => src.id)) - .ForMember(dest => dest.Name, opts => opts.MapFrom(src => src.name)) - .ForMember(dest => dest.Image, opts => opts.MapFrom(src => src.image)) - .ForMember(dest => dest.Url, opts => opts.MapFrom(src => src.url.ToHttpsUrl())); - - //CreateMap() - // .ForMember(dest => dest.Person, opts => opts.MapFrom(src => src.person)) - // .ForMember(dest => dest.Type, opts => opts.MapFrom(src => src.type)); - CreateMap() .ForMember(dest => dest.Id, opts => opts.MapFrom(src => src.id)) .ForMember(dest => dest.Image, opts => opts.MapFrom(src => src.profile_path)) .ForMember(dest => dest.Name, opts => opts.MapFrom(src => src.name)); - CreateMap() - .ForMember(dest => dest.Person, opts => opts.MapFrom(src => src.person)) - .ForMember(dest => dest.Self, opts => opts.MapFrom(src => src.self)) - .ForMember(dest => dest.Voice, opts => opts.MapFrom(src => src.voice)) - .ForMember(dest => dest.Character, opts => opts.MapFrom(src => src.character)); - - CreateMap() - .ForMember(dest => dest.Name, opts => opts.MapFrom(src => src.name)) - .ForMember(dest => dest.Id, opts => opts.MapFrom(src => src.id)) - .ForMember(dest => dest.Url, opts => opts.MapFrom(src => src.url.ToHttpsUrl())) - .ForMember(dest => dest.Image, opts => opts.MapFrom(src => src.image)); - CreateMap().ReverseMap(); } diff --git a/src/Ombi/ClientApp/src/app/user-preferences/components/user-preference/user-preference.component.html b/src/Ombi/ClientApp/src/app/user-preferences/components/user-preference/user-preference.component.html index 0b0016c98..ab47343e4 100644 --- a/src/Ombi/ClientApp/src/app/user-preferences/components/user-preference/user-preference.component.html +++ b/src/Ombi/ClientApp/src/app/user-preferences/components/user-preference/user-preference.component.html @@ -10,8 +10,8 @@
- - + + {{lang.display}} @@ -24,7 +24,8 @@
- +
+
@@ -35,8 +36,8 @@
- - + + {{value}} diff --git a/src/Ombi/ClientApp/src/app/usermanagement/usermanagement.component.scss b/src/Ombi/ClientApp/src/app/usermanagement/usermanagement.component.scss index 4f5477693..e0404f197 100644 --- a/src/Ombi/ClientApp/src/app/usermanagement/usermanagement.component.scss +++ b/src/Ombi/ClientApp/src/app/usermanagement/usermanagement.component.scss @@ -81,4 +81,8 @@ background: $accent-dark !important; color: #303030; } -*/ \ No newline at end of file +*/ + +table { + width: 100%; +} \ No newline at end of file diff --git a/src/Ombi/wwwroot/translations/en.json b/src/Ombi/wwwroot/translations/en.json index 91ff09e17..3e8ff96c8 100644 --- a/src/Ombi/wwwroot/translations/en.json +++ b/src/Ombi/wwwroot/translations/en.json @@ -313,6 +313,7 @@ "StreamingCountryDescription": "This is the country code that we will display streaming information for. If you are in the US please select US and you will have US related streaming information.", "LanguageDescription": "This is the language you would like the Ombi interface to be displayed in.", "MobileQRCode":"Mobile QR Code", - "LegacyApp":"Launch Legacy App" + "LegacyApp":"Launch Legacy App", + "NoQrCode":"Please contact your administrator to enable QR codes" } } diff --git a/tests/cypress/integration/page-objects/index.ts b/tests/cypress/integration/page-objects/index.ts index e45b130bc..d4bf55488 100644 --- a/tests/cypress/integration/page-objects/index.ts +++ b/tests/cypress/integration/page-objects/index.ts @@ -3,3 +3,4 @@ export * from './login/login.page'; export * from './wizard/wizard.page'; export * from './details/tv/tvdetails.page'; export * from './search/search.page'; +export * from './user-preferences/user-preferences.page'; diff --git a/tests/cypress/integration/page-objects/user-preferences/user-preferences.page.ts b/tests/cypress/integration/page-objects/user-preferences/user-preferences.page.ts new file mode 100644 index 000000000..d0b40f822 --- /dev/null +++ b/tests/cypress/integration/page-objects/user-preferences/user-preferences.page.ts @@ -0,0 +1,42 @@ +import { BasePage } from "../base.page"; + +class UserPreferencesPage extends BasePage { + + get languageSelectBox(): Cypress.Chainable { + return cy.get('#langSelect'); + } + + languageSelectBoxOption(lang: string): Cypress.Chainable { + return cy.get('#langSelect'+lang); + } + + get streamingSelectBox(): Cypress.Chainable { + return cy.get('#streamingSelect'); + } + + streamingSelectBoxOption(country: string): Cypress.Chainable { + return cy.get('#streamingSelect'+country); + } + + get qrCode(): Cypress.Chainable { + return cy.get('#qrCode'); + } + + get noQrCode(): Cypress.Chainable { + return cy.get('#noQrCode'); + } + + constructor() { + super(); + } + + visit(options: Cypress.VisitOptions): Cypress.Chainable; + visit(): Cypress.Chainable; + visit(id: string): Cypress.Chainable; + visit(id: string, options: Cypress.VisitOptions): Cypress.Chainable; + visit(id?: any, options?: any) { + return cy.visit(`/user-preferences`, options); + } +} + +export const userPreferencesPage = new UserPreferencesPage(); diff --git a/tests/cypress/tests/details/tv/tvdetails-requests-grid.spec.ts b/tests/cypress/tests/details/tv/tvdetails-requests-grid.spec.ts index b1467a2f1..deff3491c 100644 --- a/tests/cypress/tests/details/tv/tvdetails-requests-grid.spec.ts +++ b/tests/cypress/tests/details/tv/tvdetails-requests-grid.spec.ts @@ -129,7 +129,7 @@ describe("TV Requests Grid", function () { cy.verifyNotification('You need to select some episodes!'); }); - it.only("Request single episodes", () => { + it("Request single episodes", () => { Page.visit('1399'); Page.requestPanel.seasonTab(2).click(); diff --git a/tests/cypress/tests/search/search.spec.ts b/tests/cypress/tests/search/search.spec.ts index af44112ba..a332645d3 100644 --- a/tests/cypress/tests/search/search.spec.ts +++ b/tests/cypress/tests/search/search.spec.ts @@ -1,5 +1,4 @@ import { searchPage as Page } from "@/integration/page-objects"; -import { verify } from "cypress/types/sinon"; describe("Search Tests", () => { beforeEach(() => { @@ -152,4 +151,17 @@ describe("Search Tests", () => { expect(+x).to.be.greaterThan(0); }); }); + + it("Searching via the search bar", () => { + Page.navbar.searchFilter.applyFilter(true, true, false); + Page.visit(" "); + + cy.wait('@searchResponse'); + + Page.navbar.searchBar.searchInput.type('007'); + + Page.searchResultsContainer.invoke('attr', 'search-count').then((x: string) => { + expect(+x).to.be.greaterThan(0); + }); + }); }); diff --git a/tests/cypress/tests/user-preferences/user-preferences.spec.ts b/tests/cypress/tests/user-preferences/user-preferences.spec.ts new file mode 100644 index 000000000..6e49ead76 --- /dev/null +++ b/tests/cypress/tests/user-preferences/user-preferences.spec.ts @@ -0,0 +1,57 @@ +import { userPreferencesPage as Page } from "@/integration/page-objects"; + +describe("User Preferences Tests", () => { + beforeEach(() => { + cy.login(); + }); + +const langs = [ + { code: 'fr', discover: 'Découvrir'}, + { code: 'de', discover: 'Entdecken'}, + { code: 'en', discover: 'Discover'}, +]; + +langs.forEach((l) => { + it(`Change language to ${l.code}, UI should update`, () => { + cy.intercept('POST','/language').as('langSave'); + Page.visit(); + + Page.languageSelectBox.click(); + Page.languageSelectBoxOption(l.code).click(); + + Page.navbar.discover.contains(l.discover); + + cy.wait('@langSave').then((intercept) => { + expect(intercept.request.body.lang).equal(l.code); + }) + }); +}) + +const streamingCountries = [ + 'GB', + 'US', + 'FR', + 'HU' +]; + +streamingCountries.forEach((country) => { + // derive test name from data + it(`Change streaming to ${country} UI should update`, () => { + cy.intercept('GET','streamingcountry').as('countryApi'); + cy.intercept('POST','streamingcountry').as('countryApiSave'); + Page.visit(); + cy.wait('@countryApi'); + + Page.streamingSelectBox.click(); + Page.streamingSelectBoxOption(country).click(); + + Page.streamingSelectBox.should('have.attr','ng-reflect-value', country); + + cy.wait('@countryApiSave').then((intercept) => { + expect(intercept.request.body.code).equal(country); + }) + }) + }) + + +});