Skip to content
This repository has been archived by the owner on Jun 12, 2024. It is now read-only.

Commit

Permalink
Customizing Zally frontend and links
Browse files Browse the repository at this point in the history
  • Loading branch information
u217269 committed Jul 27, 2020
1 parent 2e144bf commit b00a1f3
Show file tree
Hide file tree
Showing 21 changed files with 74 additions and 34 deletions.
8 changes: 4 additions & 4 deletions CONTRIBUTING
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@ We are happy to accept contributions! This is what makes Open Source possible. W
that you follow these guidelines when contributing.

## Issues
Found a bug or have an idea for a feature? You can help us by [creating an issue](https://github.com/zalando/zally/issues).
Found a bug or have an idea for a feature? You can help us by [creating an issue](https://github.com/schweizerischebundesbahnen/zally/issues).
Just make sure that an issue describing the bug or feature does not already exist. You can go even further and
[open a Pull Request](https://github.com/zalando/zally/pulls) with the fix or proposed feature.
[open a Pull Request](https://github.com/schweizerischebundesbahnen/zally/pulls) with the fix or proposed feature.

## Pull Requests
Follow these steps to contribute your work to Zally:

1. [Open an issue](https://github.com/zalando/zally/issues) describing the problem or proposed feature. Ask maintainers (in the issue thread) to assign the issue to you so we know who is working on what.
1. [Open an issue](https://github.com/schweizerischebundesbahnen/zally/issues) describing the problem or proposed feature. Ask maintainers (in the issue thread) to assign the issue to you so we know who is working on what.
1. Fork this repo and create a branch for your work.
1. Push changes to your branch.
1. Test your changes.
1. Open a [Pull Request](https://github.com/zalando/zally/pulls) when your code is ready for review.
1. Open a [Pull Request](https://github.com/schweizerischebundesbahnen/zally/pulls) when your code is ready for review.
1. Mention the issue number in the comment (e.g. Fixes #37).
1. We will review your PR, give feedback, and merge when it is ready.

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Zally is a quality assurance tool. It's a linter for OpenAPI specifications, whi
- Checks compliance
- Delivers early feedback for API designers
- Ensures the same look-and-feel of APIs
- Supports [API-First approach](https://opensource.zalando.com/restful-api-guidelines/#100)
- Supports API-First approach
- Provides best practices and advices

Its standard configuration will check your APIs against the rules defined in
Expand Down
2 changes: 1 addition & 1 deletion documentation/build-under-wsl.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ The following notes document my working environment for building and testing a f

```bash
cd /mnt/c
git clone https://github.com/zalando/zally
git clone https://github.com/schweizerischebundesbahnen/zally
cd zally
## Build and Run
Expand Down
2 changes: 1 addition & 1 deletion examples/.travis.yml.example
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jdk:

install:
# Clone Zally
- git clone https://github.com/zalando/zally.git
- git clone https://github.com/schweizerischebundesbahnen/zally.git

# Build a local Zally server
- cd zally/server
Expand Down
Binary file modified logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions server/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ subprojects {
from(components["java"])
pom {
description.set("OpenAPI linter service")
url.set("https://github.com/zalando/zally")
url.set("https://github.com/schweizerischebundesbahnen/zally")
name.set("OpenAPI linter")
licenses {
license {
Expand Down Expand Up @@ -118,7 +118,7 @@ subprojects {
scm {
connection.set("scm:git:git://github.com/zalando/zally.git")
developerConnection.set("scm:git:ssh://github.com:zalando/zally.git")
url.set("https://github.com/zalando/zally/tree/master")
url.set("https://github.com/schweizerischebundesbahnen/zally/tree/master")
}
}
}
Expand Down
4 changes: 4 additions & 0 deletions server/rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ The rules cannot be disabled or configured.

Primarily Zally exists to enforce the various guidelines of the [Zalando RESTful API and Event Scheme Guidelines](http://zalando.github.io/restful-api-guidelines/). Individual rules descriptions won't be repeated here.

# SBBRuleSet

We have added an SBB specific RuleSet which checks the compliance of the rules compared to [SBB's API Principles](https://schweizerischebundesbahnen.github.io/api-principles/).

# ZallyRuleSet

Zally also contains some additional rules enforcing aspects of the OpenAPI spec or other common sense rules that don't form part of the Zalando guidelines. Those addiitonal rules are documented here.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ abstract class RulesValidator<RootT : Any>(val rules: RulesManager) : ApiValidat
parseResult.violations.map { violation ->
Result(
id = "InternalRuleSet",
url = URI.create("https://github.com/zalando/zally/blob/master/server/rules.md"),
url = URI.create("https://github.com/schweizerischebundesbahnen/zally/blob/master/server/rules.md"),
title = "Unable to parse API specification",
description = violation.description,
violationType = Severity.MUST,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import org.zalando.zally.rule.api.Rule
import java.net.URI

class ZallyRuleSet : AbstractRuleSet() {
override val url: URI = URI.create("https://github.com/zalando/zally/blob/master/server/rules.md")
override val url: URI = URI.create("https://github.com/schweizerischebundesbahnen/zally/blob/master/server/rules.md")

override fun url(rule: Rule): URI {
val heading = "${rule.id}: ${rule.title}"
Expand Down
4 changes: 2 additions & 2 deletions server/zally-server/src/main/resources/api/zally-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ paths:
API Violations
description: |
The API Violations endpoint validates given Swagger Specification
against the rules defined in *Zalando* RESTful API Guidelines
(http://zalando.github.io/restful-api-guidelines/).
against the rules defined in *SBB's* RESTful API Principles
(https://schweizerischebundesbahnen.github.io/api-principles/).
A successful response includes the list of violations grouped by
the API Guidelines rules.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class RestApiTestConfiguration {
.contains(
"https://zally.example.com/TestRuleSet",
"https://zalando.github.io/restful-api-guidelines/",
"https://github.com/zalando/zally/blob/master/server/rules.md"
"https://github.com/schweizerischebundesbahnen/zally/blob/master/server/rules.md"
)
}
}
Expand Down
9 changes: 5 additions & 4 deletions web-ui/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@zalando/zally-web-ui",
"version": "0.4.0",
"description": "Zally API Linter Web UI",
"description": "SBB's API Linter",
"main": "src/server/index.js",
"engines": {
"node": ">=10"
Expand All @@ -23,7 +23,7 @@
},
"repository": {
"type": "git",
"url": "git+https://github.com/zalando/zally.git"
"url": "git+https://github.com/schweizerischebundesbahnen/zally.git"
},
"lint-staged": {
"linters": {
Expand All @@ -38,9 +38,10 @@
"keywords": ["API", "Linter", "Zally"],
"license": "MIT",
"bugs": {
"url": "https://github.com/zalando/zally/issues"
"url": "https://github.com/schweizerischebundesbahnen/zally/issues"
},
"homepage": "https://github.com/zalando/zally/web-ui#readme",
"homepage":
"https://github.com/schweizerischebundesbahnen/zally/web-ui#readme",
"dependencies": {
"aurelia-fetch-client": "1.1.3",
"compression": "1.7.1",
Expand Down
2 changes: 1 addition & 1 deletion web-ui/src/client/app/components/rules.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export function RulesTab({ rules, error }) {
<div>
{error ? <Msg type="error" title="ERROR" text={error} /> : null}
<FluidContainer>
<ul className="violations-content">
<ul className="dc-list">
{rules.map((rule, index) => {
return <Rule key={index} rule={rule} />;
})}
Expand Down
2 changes: 1 addition & 1 deletion web-ui/src/client/app/components/violations.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export function Violations(props) {
<FluidContainer>
<div className="dc-row">
<div className="dc-column">
<ul className="violations-content">
<ul className="dc-list">
{props.violations.map((violation, index) => {
return <Violation key={index} violation={violation} />;
})}
Expand Down
29 changes: 22 additions & 7 deletions web-ui/src/client/app/containers/app.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,11 @@ export function App(props) {
className="main-navigation-bar__logo"
src={MOUNTPATH + 'assets/logo.png'}
/>
API Linter
SBB's API Linter
</Link>{' '}
<Link to="https://www.sbb.ch" className="main-navigation-bar__link">
<img className="sbb-logo" src={MOUNTPATH + 'assets/SBB.svg'} />
</Link>{' '}
- an UI instance of the{' '}
<Link to="https://github.com/zalando/zally" target="_blank">
'Zally' open source project
</Link>
</h1>
{OAUTH_ENABLED === true ? (
<UserInfo
Expand Down Expand Up @@ -71,12 +70,28 @@ export function App(props) {
<footer>
<a
className="dc-link"
href="https://github.com/zalando/zally"
href="https://github.com/schweizerischebundesbahnen/zally"
target="_blank"
>
Github Project
</a>{' '}
- Copyright ZALANDO SE {new Date().getFullYear()}
- An SBB customised fork of Zaland's awesome{' '}
<a
className="dc-link"
href="https://github.com/zalando/zally"
target="_blank"
>
Zally
</a>
{', '}
which is open sourced under{' '}
<a
className="dc-link"
href="https://github.com/zalando/zally/blob/master/LICENSE"
target="_blank"
>
ZALANDO's License
</a>{' '}
</footer>
</div>
);
Expand Down
4 changes: 2 additions & 2 deletions web-ui/src/client/app/containers/violations-tab.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ export function ViolationsTab({
</a>{' '}
conforms to&nbsp;
<a
href="http://zalando.github.io/restful-api-guidelines/"
href="https://schweizerischebundesbahnen.github.io/api-principles/"
target="_blank"
className="dc-link"
>
Zalando's REST API Guidelines
SBB's REST API Principles
</a>
</h4>

Expand Down
19 changes: 16 additions & 3 deletions web-ui/src/client/app/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ footer {
padding: 1.2rem;
font-size: 1.2rem;
text-align: center;
border-bottom: 1px solid $dc-gray60;
background: $dc-gray80;
box-shadow: 1px 0 4px rgba(0, 0, 0, 0.2);
}

/**
Expand All @@ -42,7 +45,7 @@ footer {
}

.main-navigation-bar__logo {
display: inline-block;
position: relative;
float: left;
width: 55px;
margin-right: 8px;
Expand All @@ -60,6 +63,17 @@ footer {
}
}

/*
* SBB Logo
*/
.sbb-logo {
position: relative;
float: right;
width: 187px;
margin-right: 8px;
margin-top: 12px;
}

/*
* userinfo
*/
Expand Down Expand Up @@ -100,7 +114,7 @@ footer {
* tabs
*/
.tab-contents {
background: $dc-gray80;
background: $dc-white;
padding: 1.8rem 1.2rem;
height: 100%;
position: relative;
Expand Down Expand Up @@ -209,4 +223,3 @@ footer {
height: 80%;
}
}

7 changes: 7 additions & 0 deletions web-ui/src/client/public/assets/SBB.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified web-ui/src/client/public/assets/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion web-ui/src/server/__tests__/integration.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ describe('zally-web-ui standalone', () => {
.expect(200)
.expect('Content-Type', /html/)
.then(res => {
expect(res.text).toMatch(/<title>Zally API Linter WEB UI/);
expect(res.text).toMatch(/<title>SBB's API Linter/);
expect(res.text).toMatch(
/<script src="\/env.js" type="text\/javascript"><\/script>/
);
Expand Down
2 changes: 1 addition & 1 deletion web-ui/src/server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const DEFAULT_OPTIONS = {
ZALLY_API_URL: 'http://localhost:8000',
},
env: {
HEAD_TITLE: 'Zally API Linter WEB UI',
HEAD_TITLE: "SBB's API Linter",
},
logger: console,
handlers: {
Expand Down

0 comments on commit b00a1f3

Please sign in to comment.