-
Notifications
You must be signed in to change notification settings - Fork 0
Add transfers to route #515
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
Merged
Merged
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
4b7cd58
Add transfers to route
jiep c013051
Fix tests
jiep 2593382
Update test command
jiep 7e0c073
Add verbose to unit tests command
jiep e6cc0f6
Check whether Netlify detects error on test
jiep ddbed97
Fix test for MetroMadrid
jiep 483972b
Refactor variable name
jiep d721a40
Add transfers to route
jiep bd441b1
Fix test
jiep 6112a51
Add current line to stations
jiep 10860e2
Move transfer to station
jiep a75cb9d
Remove unnecessary class
jiep d68e787
Add color line
jiep 921abba
Update station border to current line
jiep 408bfa7
Add new component for station separator
jiep 7b4632c
Remove rounded border radius on station item
jiep cc6be64
Add gradient for transfer station
jiep 0a023b5
Format text
jiep 1c02933
Remove StationSeparator component
jiep 9b2246d
Add LineBadge component
jiep 5e1a633
Fix border color of Metro Ligero stations
jiep 92e5452
Fix error with border style of R line
jiep ff3942a
Add more tests for Line
jiep b1b5915
Format code
jiep 21eb8d1
Remove transfers from route
jiep 1794721
Add new images
jiep 099b68e
Fix images
jiep 6de0bae
Adjust image width
jiep 8c7e0e5
Bump version to 1.6.0
jiep File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| <template lang="pug"> | ||
| span.font-medium.text-xs.text-center.rounded.py-1.px-2(:style="badgeStyle") {{ content }} | ||
| </template> | ||
|
|
||
| <script lang="ts"> | ||
| import { defineComponent } from 'vue' | ||
|
|
||
| export default defineComponent({ | ||
| name: 'LineBadge', | ||
| props: { | ||
| bgColor: { | ||
| type: String, | ||
| required: true, | ||
| }, | ||
| textColor: { | ||
| type: String, | ||
| required: true, | ||
| }, | ||
| borderColor: { | ||
| type: String, | ||
| required: true, | ||
| }, | ||
| content: { | ||
| type: String, | ||
| required: true, | ||
| }, | ||
| }, | ||
| computed: { | ||
| badgeStyle() { | ||
| return { | ||
| backgroundColor: this.bgColor, | ||
| color: this.textColor, | ||
| border: `1px solid ${this.borderColor}`, | ||
| } | ||
| }, | ||
| }, | ||
| }) | ||
| </script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,24 +1,76 @@ | ||
| <template lang="pug"> | ||
| .flex.flex-col.items-center.w-full | ||
| .flex.bg-red-50.px-2.py-2.border-l-4.border-r-4.border.border-red-600.shadow-xl.rounded-xl.justify-between.w-full(class="md:w-3/4") | ||
| .flex.px-2.py-2.border-l-4.border-r-4.border.shadow-xl.justify-between.w-full(class="md:w-3/4", :style="borderStyle") | ||
| .flex-row.flex.mr-4 | ||
| span.text-left.antialiased.text-gray-800 {{station.name}} | ||
| .flex.items-center.flex.flex-nowrap.overflow-auto | ||
| template(v-for="line in station.getLines()") | ||
| span.font-medium.text-xs.text-center.rounded.mr-1.py-1.px-2(class="last:mr-0" :style="[{'background-color': lines.get(line).bgColor}, {'color': lines.get(line).textColor}, {'border': `1px solid ${lines.get(line).borderColor}`}]") {{line}} | ||
| SeparatorIcon.rotate-90.w-4.fill-current.text-blue-400.m-2(class="last:display-none", v-if="!isLast") | ||
| LineBadge(v-if="!transfer" | ||
| :bgColor="lines.get(currentLine).bgColor" | ||
| :textColor="lines.get(currentLine).textColor" | ||
| :borderColor="lines.get(currentLine).borderColor" | ||
| :content="currentLine") | ||
| .flex.items-center(v-if="transfer") | ||
| span.mr-2.text-xs.text-center.rounded.py-1 De | ||
| LineBadge.mr-2( | ||
| :bgColor="lines.get(transfer.fromLine).bgColor" | ||
| :textColor="lines.get(transfer.fromLine).textColor" | ||
| :borderColor="lines.get(transfer.fromLine).borderColor" | ||
| :content="transfer.fromLine") | ||
| span.mr-2.text-xs.text-center.rounded.py-1 a | ||
| LineBadge( | ||
| :bgColor="lines.get(transfer.toLine).bgColor" | ||
| :textColor="lines.get(transfer.toLine).textColor" | ||
| :borderColor="lines.get(transfer.toLine).borderColor" | ||
| :content="transfer.toLine") | ||
| </template> | ||
|
|
||
| <script lang="ts"> | ||
| import { defineComponent } from 'vue' | ||
|
|
||
| import SeparatorIcon from '@/components/SeparatorIcon.vue' | ||
| import LineBadge from '@/components/LineBadge.vue' | ||
|
|
||
| export default defineComponent({ | ||
| name: 'StationItem', | ||
| props: ['station', 'lines', 'isLast'], | ||
| components: { | ||
| SeparatorIcon, | ||
| LineBadge, | ||
| }, | ||
| props: ['station', 'lines', 'isLast', 'transfer', 'currentLine'], | ||
| computed: { | ||
| borderStyle() { | ||
| if (this.transfer) { | ||
| let fromColor, toColor | ||
|
|
||
| const fromLine = this.lines.get(this.transfer.fromLine) | ||
|
|
||
| const toLine = this.lines.get(this.transfer.toLine) | ||
| if (this.transfer.fromLine.startsWith('ML') || this.transfer.fromLine.startsWith('R')) { | ||
| fromColor = fromLine.borderColor | ||
| } else { | ||
| fromColor = fromLine.bgColor | ||
| } | ||
|
|
||
| if (this.transfer.toLine.startsWith('ML') || this.transfer.toLine.startsWith('R')) { | ||
| toColor = toLine.borderColor | ||
| } else { | ||
| toColor = toLine.bgColor | ||
| } | ||
|
|
||
| return { | ||
| borderImage: `linear-gradient(to bottom, ${fromColor}, ${toColor}) 1`, | ||
| } | ||
| } | ||
|
|
||
| let currentColor | ||
|
|
||
| if (this.currentLine.startsWith('ML') || this.currentLine.startsWith('R')) { | ||
| currentColor = this.lines.get(this.currentLine).borderColor | ||
| } else { | ||
| currentColor = this.lines.get(this.currentLine).bgColor | ||
| } | ||
|
|
||
| return { | ||
| borderColor: currentColor, | ||
| } | ||
| }, | ||
| }, | ||
| }) | ||
| </script> | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.