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

Revert "Make documentation link more visible." #1052

Merged
merged 1 commit into from
Aug 10, 2018
Merged
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
5 changes: 0 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ script:
- make dev/waitenv
- make dev/test


# check images running
- docker ps -a
- docker images
Expand All @@ -39,10 +38,6 @@ script:
- ansible-playbook -i inventory test.yml
- popd

# Run JavaScript test
- make dev/jslint
- make test/prettier

# Check the logs
- docker ps -a
- make dev/log
Expand Down
2 changes: 0 additions & 2 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ Chris Church <[email protected]>
Chris Houseknecht <[email protected]>
Christopher Chase <[email protected]>
David Newswanger <[email protected]>
David Zager <[email protected]>
Ivan Remizov <[email protected]>
James Cammarata <[email protected]>
Jiri Tyr <[email protected]>
Joe Fiorini <[email protected]>
Expand Down
20 changes: 0 additions & 20 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -430,26 +430,6 @@ To run lint checks against JavaScript/TypeScript sources, execute:

$ make dev/jslint

Formatting your code
^^^^^^^^^^^^^^^^^^^^

We use prettier to enforce code formatting for all of our TypeScript and less files.
To automatically format your Angular code run:

.. code-block:: console

$ make dev/prettier

Unformatted code will cause the travis build to fail when you push your changes to
GitHub.

It's recommended that you set up prettier on your editor if you're making lots of
changes to anything in ``galaxyui/``. Prettier is supported by most major editors
and you can find more `information about that here <https://prettier.io/docs/en/editors.html>`_.

Our prettier configuration can be found at ``galaxyui/.prettierrc.yaml``. Please
use it when setting up your editor.

Testing your code
^^^^^^^^^^^^^^^^^

Expand Down
18 changes: 0 additions & 18 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,6 @@ test/flake8:
test/jslint:
cd galaxyui; ng lint

# for some reason yarn won't add prettier to /usr/local/bin
.PHONY: test/prettier
test/prettier:
@echo "Checking formatting..."
@echo "If this fails, run make dev/prettier locally to format your code"
cd galaxyui; ./node_modules/.bin/prettier -l "{src/**/*.ts, src/**/*.less}"

# ---------------------------------------------------------
# Docker targets
# ---------------------------------------------------------
Expand Down Expand Up @@ -151,17 +144,6 @@ dev/jslint:
@echo "Linting Javascript..."
@$(DOCKER_COMPOSE) exec galaxy bash -c 'cd galaxyui; ng lint'

# for some reason yarn won't add prettier to /usr/local/bin
.PHONY: dev/prettier
dev/prettier:
@echo "Running prettier..."
@$(DOCKER_COMPOSE) exec galaxy bash -c 'cd galaxyui; ./node_modules/.bin/prettier --write "{src/**/*.ts, src/**/*.less}"'

.PHONY: dev/shellcheck
dev/shellcheck:
@$(DOCKER_COMPOSE) exec galaxy bash -c '\
find ./scripts -name *.sh | xargs shellcheck'

.PHONY: dev/test
dev/test:
@echo "Running tests"
Expand Down
34 changes: 4 additions & 30 deletions galaxy/importer/loaders/apb.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,6 @@ class APBMetaParser(object):
# Tags should contain lowercase letters and digits only
TAG_REGEXP = re.compile('^[a-z0-9]+$')

# APB parameters should be in json-schema form
PARAM_KEY_MAP = {
'maxlength': 'maxLength',
'max_length': 'maxLength',
'min_length': 'minLength',
'multiple_of': 'multipleOf',
'exclusive_maximum': 'exclusiveMaximum',
'exclusive_minimum': 'exclusiveMinimum',
'display_type': 'displayType',
'display_group': 'displayGroup'
}

def __init__(self, metadata, logger=None):
self.metadata = metadata
self.log = logger or base.default_logger
Expand Down Expand Up @@ -112,13 +100,9 @@ def _check_plans(self):
raise exc.APBContentLoadError(
'Expecting "plans" in metadata to be a list')

expected_plan_keys = ('description',
'free',
'metadata',
'bindable',
'parameters')
expected_plan_keys = ('description', 'free', 'metadata', 'parameters')
expected_plan_meta_keys = ('displayName', 'longDescription', 'cost')
expected_parameter_keys = ('name', 'title', 'type', 'required')
expected_parameter_keys = ('name', 'title', 'type')
idx = 0
for plan in plans:
if not isinstance(plan, dict):
Expand Down Expand Up @@ -153,13 +137,6 @@ def _check_plans(self):
expected_parameter_keys,
'plans[{0}].parameters[{1}]'.format(idx, pidx),
params)
for param_key in params.keys():
if param_key in self.PARAM_KEY_MAP:
new_key = self.PARAM_KEY_MAP[param_key]
self.metadata[fieldname][idx]['parameters'][pidx][
new_key] = self.metadata[fieldname][idx][
'parameters'][pidx].pop(param_key)

pidx += 1
idx += 1

Expand Down Expand Up @@ -190,9 +167,6 @@ def _validate_tag(self, tag):
return False
return True

def parse_metadata(self):
return self.metadata

def parse_tags(self):
tags = []
apb_tags = self.metadata.get('tags', [])
Expand All @@ -214,11 +188,11 @@ def __init__(self, content_type, path, root, metadata_path, logger=None):

def load(self):
self.log.info('Loading metadata file: {0}'.format(self.metadata_file))
meta_parser = APBMetaParser(self._load_metadata(), logger=self.log)
metadata = self._load_metadata()
meta_parser = APBMetaParser(metadata, logger=self.log)
name = meta_parser.parse_name()
description = meta_parser.parse_description()
meta_parser.check_data()
metadata = meta_parser.parse_metadata()
data = {'tags': meta_parser.parse_tags()}
readme = self._get_readme()

Expand Down
10 changes: 0 additions & 10 deletions galaxy/importer/tests/test_apb_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,16 +327,6 @@ def test_missing_version(self):
msg = 'Missing "version" field in metadata.'
assert msg in excinfo.value.message

def test_param_keys(self):
parser = apb_loader.APBMetaParser(self.data, self.log)
parser.check_data()
metadata = parser.parse_metadata()
assert 'displayGroup' in metadata['plans'][0]['parameters'][0]
assert 'displayType' in metadata['plans'][0]['parameters'][1]
assert 'displayGroup' in metadata['plans'][0]['parameters'][1]
assert 'minLength' in metadata['plans'][0]['parameters'][1]
assert 'maxLength' in metadata['plans'][0]['parameters'][1]

def test_version_format(self):
self.data['version'] = 'foo'
parser = apb_loader.APBMetaParser(self.data, self.log)
Expand Down
3 changes: 0 additions & 3 deletions galaxyui/.prettierrc.yaml

This file was deleted.

3 changes: 1 addition & 2 deletions galaxyui/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "galaxyui",
"version": "0.0.0",
"license": "Apache-2.0",
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "ng serve",
Expand Down Expand Up @@ -43,7 +43,6 @@
"karma-coverage-istanbul-reporter": "^1.2.1",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"prettier": "1.14.0",
"protractor": "~5.1.2",
"ts-node": "~4.1.0",
"tslint": "~5.9.1",
Expand Down
79 changes: 11 additions & 68 deletions galaxyui/src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
@@ -1,82 +1,25 @@
import { NgModule } from '@angular/core';
import { AuthorDetailComponent } from './authors/detail/author-detail.component';
import { ContentDetailComponent } from './content-detail/content-detail.component';
import { NotFoundComponent } from './exception-pages/not-found/not-found.component';

import {
ContentResolver,
NamespaceResolver,
RepositoryResolver as ContentRepositoryResolver,
} from './content-detail/content-detail.resolver.service';

import { NamespaceDetailResolver, RepositoryResolver as AuthorRepositoryResolver } from './authors/authors.resolver.service';

import { PreloadAllModules, RouterModule, Routes } from '@angular/router';
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { NotFoundComponent } from './exception-pages/not-found/not-found.component';

const appRoutes: Routes = [
{
path: '',
redirectTo: '/home',
pathMatch: 'full',
},

// Lazily loaded modules
{
path: 'search',
loadChildren: './search/search.module#SearchModule',
},
{
path: 'my-content',
loadChildren: './my-content/my-content.module#MyContentModule',
},
{
path: 'my-imports',
loadChildren: './my-imports/my-imports.module#MyImportsModule',
},

// Routes that resolve variables have to go in app-routing.module to ensure
// that they are resolved between the static routes ('/search', '/my-content' etc)
// and the wildcard ('**')
{
path: ':namespace/:repository/:content_name',
component: ContentDetailComponent,
resolve: {
content: ContentResolver,
repository: ContentRepositoryResolver,
namespace: NamespaceResolver,
},
},
{
path: ':namespace/:repository',
component: ContentDetailComponent,
resolve: {
content: ContentResolver,
repository: ContentRepositoryResolver,
namespace: NamespaceResolver,
},
},
{
path: ':namespace',
component: AuthorDetailComponent,
resolve: {
namespace: NamespaceDetailResolver,
repositories: AuthorRepositoryResolver,
},
},
{
pathMatch: 'full'
}, {
path: '**',
component: NotFoundComponent,
},
component: NotFoundComponent
}
];

@NgModule({
imports: [
RouterModule.forRoot(appRoutes, {
enableTracing: false,
onSameUrlNavigation: 'reload',
preloadingStrategy: PreloadAllModules,
}),
onSameUrlNavigation: 'reload'
})
],
exports: [RouterModule],
exports: [ RouterModule ]
})
export class AppRoutingModule {}
export class AppRoutingModule { }
25 changes: 15 additions & 10 deletions galaxyui/src/app/app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,32 @@
[updateActiveItemsOnClick]="false">
<div>
<ul class="nav navbar-nav navbar-right navbar-iconic">
<li>
<a href="" [routerLink]="" (click)="about(aboutTemplate)" class="nav-item-iconic nav-link">
<span class="fa pficon-info"></span> About
</a>
</li>
<li>
<a href="/docs/" class="nav-item-iconic nav-link">
<span class="fa pficon-help"></span> Documentation
<li class="dropdown" dropdown>
<a class="dropdown-toggle nav-item-iconic"
id="dropdownMenu1"
data-toggle="dropdown"
aria-haspopup="true"
aria-expanded="true"
dropdownToggle>
<span title="Help" class="fa pficon-help"></span>
<span class="caret"></span>
</a>
<ul *dropdownMenu class="dropdown-menu" aria-labelledby="dropdownMenu1">
<li><a href="" [routerLink]="" (click)="about(aboutTemplate)">About</a></li>
<li><a href="/docs/">Help</a></li>
</ul>
</li>
<li class="navbar-iconic">
<a class="nav-item-iconic nav-link" [routerLink]="['/login']" [queryParams]="{error: false}" *ngIf="!authenticated"><span class="fa fa-sign-in"></span> &nbsp;Login</a>
</li>
<li class="dropdown" dropdown *ngIf="authenticated">
<a class="dropdown-toggle nav-item-iconic nav-link"
<a class="dropdown-toggle nav-item-iconic"
id="dropdownMenu2"
data-toggle="dropdown"
aria-haspopup="true"
aria-expanded="true"
dropdownToggle>
<span class="fa fa-user"></span> {{ username }} <span class="caret"></span>
<span class="fa pficon-user"></span> {{ username }} <span class="caret"></span>
</a>
<ul *dropdownMenu class="dropdown-menu" aria-labelledby="dropdownMenu2">
<li><a href="#">Preferences</a></li>
Expand Down
46 changes: 24 additions & 22 deletions galaxyui/src/app/app.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
import { async, TestBed } from '@angular/core/testing';
import { TestBed, async } from '@angular/core/testing';
import { AppComponent } from './app.component';
describe('AppComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [AppComponent],
}).compileComponents();
}));
it('should create the app', async(() => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
expect(app).toBeTruthy();
}));
it(`should have as title 'app'`, async(() => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
expect(app.title).toEqual('app');
}));
it('should render title in a h1 tag', async(() => {
const fixture = TestBed.createComponent(AppComponent);
fixture.detectChanges();
const compiled = fixture.debugElement.nativeElement;
expect(compiled.querySelector('h1').textContent).toContain('Welcome to app!');
}));
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [
AppComponent
],
}).compileComponents();
}));
it('should create the app', async(() => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
expect(app).toBeTruthy();
}));
it(`should have as title 'app'`, async(() => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
expect(app.title).toEqual('app');
}));
it('should render title in a h1 tag', async(() => {
const fixture = TestBed.createComponent(AppComponent);
fixture.detectChanges();
const compiled = fixture.debugElement.nativeElement;
expect(compiled.querySelector('h1').textContent).toContain('Welcome to app!');
}));
});
Loading