Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ben pantheon urls resolve merge conflicts #2

Open
wants to merge 3 commits into
base: pantheonUrls
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions pantheon-bundle/frontend/src/app/Constants.tsx
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
export class Fields {
public static JCR_DESCRIPTION = 'jcr:description'
public static JCR_PRIMARYTYPE = 'jcr:primaryType'
public static JCR_TITLE = 'jcr:title'
public static JCR_UUID = 'jcr:uuid'
public static PANT_MODULE_TYPE = 'moduleType'
public static NAME = 'name'
public static PANT_PUBLISHED_DATE = 'pant:publishedDate'
public static PANT_DATE_UPLOADED = 'pant:dateUploaded'
public static SLING_RESOURCETYPE = 'sling:resourceType'
public static PANT_PRODUCT_VERSION_REF = 'productVersion'
public static URL_FRAGMENT = 'urlFragment'
public static JCR_DESCRIPTION = "jcr:description"
public static JCR_PRIMARYTYPE = "jcr:primaryType"
public static JCR_TITLE = "jcr:title"
public static JCR_UUID = "jcr:uuid"
public static PANT_MODULE_TYPE = "moduleType"
public static NAME = "name"
public static PANT_PUBLISHED_DATE = "pant:publishedDate"
public static PANT_DATE_UPLOADED = "pant:dateUploaded"
public static SLING_RESOURCETYPE = "sling:resourceType"
public static PANT_PRODUCT_VERSION_REF = "productVersion"
public static URL_FRAGMENT = "urlFragment"
}

// tslint:disable-next-line: max-classes-per-file
export class JcrTypes {
public static PRODUCT_VERSION = 'pant:productVersion'
public static PRODUCT_VERSION = "pant:productVersion"
}

// tslint:disable-next-line: max-classes-per-file
export class SlingTypes {
public static PRODUCT_VERSION = 'pantheon/productVersion'
public static PRODUCT_VERSION = "pantheon/productVersion"
}

// tslint:disable-next-line: max-classes-per-file
export class SlingTypesPrefixes {
public static PANTHEON = 'pantheon'
public static PANTHEON = "pantheon"
}

// tslint:disable-next-line: max-classes-per-file
export class PathPrefixes {
public static MODULE_PATH_PREFIX = '/module'
public static ASSEBMLY_PATH_PREFIX = '/assembly'
public static MODULE_PATH_PREFIX = "/module"
public static ASSEBMLY_PATH_PREFIX = "/assembly"
}

// tslint:disable-next-line: max-classes-per-file
export class PantheonContentTypes {
public static MODULE = 'module'
public static ASSEMBLY = 'assembly'
public static MODULE = "module"
public static ASSEMBLY = "assembly"
}
24 changes: 12 additions & 12 deletions pantheon-bundle/frontend/src/app/Dropdown.test.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import React from 'react'
import { Dropdown } from '@app/Dropdown'
import '@app/fetchMock'
import { mount, shallow } from 'enzyme'
import sinon from 'sinon'
import renderer from 'react-test-renderer'
import React from "react"
import { Dropdown } from "@app/Dropdown"
import "@app/fetchMock"
import { mount, shallow } from "enzyme"
import sinon from "sinon"
import renderer from "react-test-renderer"

describe('Tests for Dropdown', () => {
describe("Tests for Dropdown", () => {

test('should render Dropdown component', () => {
test("should render Dropdown component", () => {
const view = shallow(<Dropdown
perPageValue={move}
newPerPagevalue={"25 items per page"}
Expand All @@ -16,25 +16,25 @@ describe('Tests for Dropdown', () => {
expect(view).toMatchSnapshot()
})

it('should render dropdown list', () => {
it("should render dropdown list", () => {
const wrapper = mount(<Dropdown
perPageValue={move}
newPerPagevalue={"25 items per page"}
/>
)
})

it('test changeSelection function', () => {
it("test changeSelection function", () => {
const wrapper = renderer.create(<Dropdown
perPageValue={move}
newPerPagevalue={"25 items per page"}
/>)
const inst = wrapper.getInstance()
const spy = sinon.spy(inst, 'changeSelection')
const spy = sinon.spy(inst, "changeSelection")
inst.changeSelection(wrapper)
sinon.assert.called(spy)

const spy2 = sinon.spy(inst, 'changeExpandState')
const spy2 = sinon.spy(inst, "changeExpandState")
inst.changeExpandState()
sinon.assert.called(spy2)
})
Expand Down
12 changes: 6 additions & 6 deletions pantheon-bundle/frontend/src/app/Dropdown.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { Component } from 'react';
import '@app/app.css';
import React, { Component } from "react";
import "@app/app.css";

export interface IProps {
perPageValue: (itemsPerPage) => any
Expand All @@ -9,10 +9,10 @@ export interface IProps {
class Dropdown extends Component<IProps> {

public dropdownItems = [
'25 items per page',
'50 items per page',
'75 items per page',
'100 items per page'
"25 items per page",
"50 items per page",
"75 items per page",
"100 items per page"
];

public state = {
Expand Down
16 changes: 8 additions & 8 deletions pantheon-bundle/frontend/src/app/Pagination.test.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import React from 'react'
import { Pagination } from '@app/Pagination'
import '@app/fetchMock'
import React from "react"
import { Pagination } from "@app/Pagination"
import "@app/fetchMock"

import { mount, shallow } from 'enzyme'
import { LevelItem } from '@patternfly/react-core'
import { mount, shallow } from "enzyme"
import { LevelItem } from "@patternfly/react-core"

describe('Tests for Pagination', () => {
describe("Tests for Pagination", () => {

test('should render Pagination component', () => {
test("should render Pagination component", () => {
const view = shallow(<Pagination
handleMoveLeft={move}
handleMoveRight={move}
Expand All @@ -22,7 +22,7 @@ describe('Tests for Pagination', () => {
expect(view).toMatchSnapshot()
})

it('should render Badge for displaying page number', () => {
it("should render Badge for displaying page number", () => {
const wrapper = mount(<Pagination
handleMoveLeft={move}
handleMoveRight={move}
Expand Down
20 changes: 10 additions & 10 deletions pantheon-bundle/frontend/src/app/Pagination.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { Fragment } from 'react';
import { Level, LevelItem } from '@patternfly/react-core';
import { ContextSelector, ContextSelectorItem } from '@patternfly/react-core';
import { Dropdown } from '@app/Dropdown';
import React, { Fragment } from "react";
import { Level, LevelItem } from "@patternfly/react-core";
import { ContextSelector, ContextSelectorItem } from "@patternfly/react-core";
import { Dropdown } from "@app/Dropdown";

export interface IProps {
handleMoveLeft: () => any
Expand All @@ -18,10 +18,10 @@ export interface IProps {
class Pagination extends React.Component<IProps> {

public dropdownItems = [
'25 items per page',
'50 items per page',
'75 items per page',
'100 items per page'
"25 items per page",
"50 items per page",
"75 items per page",
"100 items per page"
];

public state = {
Expand All @@ -30,7 +30,7 @@ class Pagination extends React.Component<IProps> {
isOpen: false,
itemsPerPage: 25,
renderSearch: false,
searchValue: '',
searchValue: "",
selected: this.dropdownItems[0]

};
Expand Down Expand Up @@ -117,7 +117,7 @@ class Pagination extends React.Component<IProps> {
private dropDownValue = (value) => {
this.setState({
isOpen: !this.state.isOpen,
itemsPerPage: Number(value.substr(0,value.indexOf(' '))),
itemsPerPage: Number(value.substr(0,value.indexOf(" "))),
selected: value
},()=>{
this.props.handlePerPageLimit(this.state.itemsPerPage)
Expand Down
2 changes: 1 addition & 1 deletion pantheon-bundle/frontend/src/app/TestResources.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { IAppState } from './app';
import { IAppState } from "./app";

const mockStateUser: IAppState = {
isAdmin: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ exports[`ModuleDisplay tests should render ModuleDisplay component 1`] = `
<br />
<Card>
<Versions
assemblies={Array []}
attributesFilePath=""
contentType="module"
modulePath=""
Expand Down
18 changes: 9 additions & 9 deletions pantheon-bundle/frontend/src/app/app.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import React, { Component } from 'react'
import React, { Component } from "react"
import {
Page,
PageSection,
PageSectionVariants,
PageSidebar
} from '@patternfly/react-core'
import { Header } from '@app/components/Chrome/Header/Header'
import { Sidebar } from '@app/components/Chrome/Sidebar/Sidebar'
import { Routes } from '@app/routes'
import '@app/app.css'
} from "@patternfly/react-core"
import { Header } from "@app/components/Chrome/Header/Header"
import { Sidebar } from "@app/components/Chrome/Sidebar/Sidebar"
import { Routes } from "@app/routes"
import "@app/app.css"

export interface IAppState {
isAdmin: boolean
Expand All @@ -18,8 +18,8 @@ export interface IAppState {
}

class App extends Component<any, IAppState> {
public static ANON_USER = 'anonymous'
public static ADMIN_USER = 'admin'
public static ANON_USER = "anonymous"
public static ADMIN_USER = "admin"

public static thisApp: App

Expand Down Expand Up @@ -49,7 +49,7 @@ class App extends Component<any, IAppState> {

public onNavToggle() {
// No idea why this roundabout setState is necessary, but if we replace this with the simpler "this.setState",
// then we get a console error saying "`this` is undefined" - which I don't even understand how that's
// then we get a console error saying "`this` is undefined" - which I don"t even understand how that"s
// possible - but this works around it.
App.thisApp.setState({
isNavOpen: !App.thisApp.state.isNavOpen
Expand Down
Loading