wevisdemo / parliament-watch Goto Github PK
View Code? Open in Web Editor NEWCitizens are watching ð
Home Page: https://parliamentwatch.wevis.info
Citizens are watching ð
Home Page: https://parliamentwatch.wevis.info
View Figma file
NavigationBar
component first. They implement the search input field but not the result dropdown.SearchResult
which is some child under the NavigationBar
const
. The data should have the following type: (only filter from the name
property)interface SeachIndexes {
politicians: {
name: string;
description: string;
}[],
bills: {
name: string;
status: BillStatus
}[],
votings: {
name: string;
result?: DefaultVotingResult
}[]
}
Describe the bug
Half donut chart in section āļāļąāļāļāļēāļĢāđāļĄāļ·āļāļ is frozen
To Reproduce
Steps to reproduce the behavior:
Expected behavior
It should be changed related to data set
Screenshots
this is first time
this is after I change data set
you can see chart is frozen even though data in right section is changed.
Desktop (please complete the following information):
We have an old version of the component which was designed specifically for the politician's page. We want to refactor it and make it a shared component.
yarn gen:component
src/components/politicians/VotingOptionTag.svelte.svelte
if (typeof voteOption === 'string')
appropriated? or do we need that if else at all?See Figma file
yarn gen:component
yarn story:dev
/static/images/logo
src/components/icons
(available in Histoire as well).View Figma
changes: array of given mock data type below
: represent changes data to be rendered as a list (required)selectedDate: Date | undefined
(default is undefined): date to be highlighted with dark shadechanges
props, pagination is out of this component's scope./politicians/{politician.id}
yarn gen:component
const mockChanges = [
{
date: new Date("2024-05-27"),
type: "in",
politician: {
id: "āļĄāļēāļĢāļīāļĐ-āđāļŠāļāļĩāđāļĒāļĄāļāļāļĐāđ",
firstname: "āļĄāļēāļĢāļīāļĐ",
lastname: "āđāļŠāļāļĩāđāļĒāļĄāļāļāļĐāđ",
avatar: "https://placehold.co/128x128",
party: {
name: "āđāļāļ·āđāļāđāļāļĒ",
logo: "https://placehold.co/64x64/white/blue?text=PT",
color: "blue",
},
},
role: "āļĢāļąāļāļĄāļāļāļĢāļĩāļ§āđāļēāļāļēāļĢāļāļĢāļ°āļāļĢāļ§āļāļāđāļēāļāļāļĢāļ°āđāļāļĻ"
},
{
date: new Date("2024-05-27"),
type: "out",
politician: {
id: "āļāļēāļāļāļĢāļĩāļĒāđ-āļāļŦāļīāļāļāļēāļāļļāļāļĢ",
firstname: "āļāļēāļāļāļĢāļĩāļĒāđ",
lastname: "āļāļŦāļīāļāļāļēāļāļļāļāļĢ",
avatar: "https://placehold.co/128x128",
party: {
name: "āđāļāļ·āđāļāđāļāļĒ",
logo: "https://placehold.co/64x64/white/blue?text=PT",
color: "blue",
},
},
role: "āļĢāļąāļāļĄāļāļāļĢāļĩāļ§āđāļēāļāļēāļĢāļāļĢāļ°āļāļĢāļ§āļāļāđāļēāļāļāļĢāļ°āđāļāļĻ"
},
{
date: new Date("2024-05-27"),
type: "in",
politician: {
id: "āļŠāļļāļĢāļīāļĒāļ°-āļāļķāļāļĢāļļāđāļāđāļĢāļ·āļāļāļāļīāļ",
firstname: "āļŠāļļāļĢāļīāļĒāļ°",
lastname: "āļāļķāļāļĢāļļāđāļāđāļĢāļ·āļāļāļāļīāļ",
avatar: "https://placehold.co/128x128",
party: {
name: "āđāļāļ·āđāļāđāļāļĒ",
logo: "https://placehold.co/64x64/white/blue?text=PT",
color: "blue",
},
},
role: "āļĢāļāļāļāļēāļĒāļāļĢāļąāļāļĄāļāļāļĢāļĩ"
},
{
date: new Date("2024-05-20"),
type: "out",
politician: {
id: "āļāļēāļāļāļĢāļĩāļĒāđ-āļāļŦāļīāļāļāļēāļāļļāļāļĢ",
firstname: "āļāļēāļāļāļĢāļĩāļĒāđ",
lastname: "āļāļŦāļīāļāļāļēāļāļļāļāļĢ",
avatar: "https://placehold.co/128x128",
party: {
name: "āđāļāļ·āđāļāđāļāļĒ",
logo: "https://placehold.co/64x64/white/blue?text=PT",
color: "blue",
},
},
role: "āļĢāļāļāļāļēāļĒāļāļĢāļąāļāļĄāļāļāļĢāļĩ"
},
];
yarn gen:component
yarn story:dev
voting
and highlightedVoteByGroups
props which are the same type as described in the Interface VoteCard
in src/routes/assemblies/[id]/+page.ts
voting.result
, either if it's DefaultVotingResult.Passed
, DefaultVotingResult.Failed
, or any string
Please open a PR merging into branch cabinet/main
-----āļāļļāļāļāļĨ ------
āļāļĢāļāļīāļĻ āļāļēāļĄāļŠāļļāļāļāļāđāļĢāļąāļāļāļē
āļāļąāļāļ§āļĩāļĢāđ āļŠāļ·āļāđāļŠāļ
āđāļāļĢāļĩāļĒāļāļĻāļąāļāļāļīāđ āļāđāļēāļĒāļŠāļĩāļāļēāļĄ
âĶ
āļāļļāļāļąāļĒ āļāļīāļĄāļāđāđāļāļāļ
-----āļāļāļ°āļĢāļąāļāļĄāļāļāļĢāļĩ ------
āļāļāļ°āļĢāļąāļāļĄāļāļāļĢāļĩ āļāļļāļāļāļĩāđ 63 (āļāļĢāļ°āļĒāļļāļāļāđ, 2563)
āļāļāļ°āļĢāļąāļāļĄāļāļāļĢāļĩ āļāļļāļāļāļĩāđ 64 (āđāļĻāļĢāļĐāļāļē, 2566)
āļāļāļ°āļĢāļąāļāļĄāļāļāļĢāļĩ āļāļļāļāļāļĩāđ <term> (<prime minister first name>, <started year>)
proposedByCabinetId
too.onMount
function. Please check if it works for both politicians and the cabinet.Component src/components/Assemblies/SummaryGroup.svelte
Changes needed:
title
attribute for the tool-tip (need to check if it's working)View Figma
View Figma file
yarn gen:component
orientation: 'landscape' | 'portrait'
default = 'landscape'nickname: string
title: string
(āļāļ·āđāļāļāļēāļāļāļēāļĢ)proposedBy: { avatar: string, name: string, description: string }
proposedOn: Date
status: BillStatus
defined in src/models/bill.ts
currentState: string | undefined
daySinceProposed: number
billUrl: string
#
for billUrl
for now.Hst.Variant
in grid layout (see doc)Describe the bug
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A clear and concise description of what you expected to happen.
Desktop (please complete the following information):
Smartphone (please complete the following information):
Only what is included in the screenshot
srv/routes/legislative-process
)/static/images/legislative-process
with a meaning full name.src/components/legislative-process
yarn gen:component
true
, show the large variation. (default = false
= small)The search functionality was implemented in #39 for the NavigationBar
. Our search strategy is to create a SearchIndexes
data that provides minimum data which will be filtered and shown in SearchResults
. However, it only works with 3 fixed types of categories: politicians
(āļāļąāļāļāļēāļĢāđāļĄāļ·āļāļ), bills
(āļāļāļŦāļĄāļēāļĒ), and votings
(āļāļēāļĢāļĨāļāļĄāļāļī) as defined in src/models/search.ts
The corresponding UI looks like this:
Search functionality must be refactored in order to be able to be used in 2 more places
bills
and proposers
(view Figma)politicians
, bills
, and votings
only one category per input. (view Figma)I think the solution is to add support for the new category in SearchIndexes
and SearchResults
, and make it optional so each search input doesn't need to have the same category.
src/models/search.ts
src/libs/search.ts
SearchItem
, SearchResult
, SearchResultGroup
components in src/components
SearchInput
component (with yarn gen:component
) based on Carbon's TextInput which received flexible SearchIndexes
props. You can just mock it as a const
for now.yarn story:dev
Important Please feel free to raise an issue if something is not making sense, or you found a better way to do it.
Add the cabinet's member section to the assembly page. Keep representative and senate the same, only cabinet.
View Figma
src/routes/assemblies/[id]/+page.svelte
{#if isCabinet}
{JSON.stringify(mainMembers)}
{/if}
PoliticianProfile
component. We might need to make changes to that component to make showing the avatar image optional.Only what is included in the screenshot
srv/routes/legislative-process
)/static/images/legislative-process
with a meaning full name.src/components/legislative-process
Sidebar
component was already implemented in /legislative-process page (source: src/routes/legislative-process/+page.svelte
).āđāļāļ°āļāļģāļ āļēāļāļĢāļ§āļĄ
from the screenshot)
scrollama
to detect the section. See example in src/routes/politicians/[id]/+page.svelte
that implement similar thing.isSelected
props on the SideMenuItem
component refissue of overflowing is coming from NavigationBar.svelte
the width is set to w-screen
has need to change to w-full
instead
and the weird flickering effect on slide animation is coming from <header>
tag class has been using sticky
and it will taking a space of window while user scrolling down the nav will get hidden cause a window's Y axis got shorter and then event will fired to scrollEventHandler
and that will cause nearly infinite loop on window's Y axis , to fix this issue need to change sticky
class to fixed
instead to made NavigationBar
component not take any space in window and then need to set a class mt-12
(the height of NavigationBar
component) to the wrapper of main <slot/>
in routes/+layout.svelte
to push the main content down and prevent main content got overlapped by NavigationBar
component
See Figma file
yarn gen:component
yarn story:dev
View Figma file
yarn gen:component
yarn story:dev
/static/images/logo
View Figma
latestBills
variable in src/routes/assemblies/[id]/+page.svelte
page./bills/{bill.id}
.BillStatusTag
component for the "āļŠāļāļēāļāļ°" column./bills
page. Try to reuse it.href="#"
for "āļāļđāļĢāđāļēāļāļāļāļŦāļĄāļēāļĒāļāļąāđāļāļŦāļĄāļ" link. (We haven't implemented the destination page yet). I think you can use the button component from Carbon as well.View Figma file
yarn gen:component
src/models/bill.ts
true
, show the large variation. (default = false
= small)Only what is included in the screenshot
srv/routes/legislative-process
)/static/images/legislative-process
with a meaning full name.src/components/legislative-process
See Figma file
yarn gen:component
yarn story:dev
id
, firstname
, lastname
, avatar
as a stringparty
as a Partyrole
as a stringisLarge
as a boolean, to switch between the variation (default = false = small)Only what is included in the screenshot
srv/routes/legislative-process
)/static/images/legislative-process
with a meaning full name.src/components/legislative-process
Only what is included in the screenshot
srv/routes/legislative-process
)/static/images/legislative-process
with a meaning full name.src/components/legislative-process
Only what is included in the screenshot
srv/routes/legislative-process
)/static/images/legislative-process
with a meaning full name.src/components/legislative-process
Only what is included in the screenshot
srv/routes/legislative-process
)/static/images/legislative-process
with a meaning full name.src/components/legislative-process
Create a branch cabinet/<name>
and PR to merge into cabinet/main
Currently, this section uses mock data:
We need to add logic to changes
to src/routes/assemblies/[id]/+page.server.ts
to provide correct data to the UI (without changing both variable's types).
changes
should be created from politicians
variable by filtering their assemblyRoles
that match the current (cabinet) assembly.latestBills
just filter by proposedByAssemblyId
that matches the current (cabinet) assembly.The summary section on the assembly page currently does not support a cabinet.
/assemblies/āļŠāļ āļēāļāļđāđāđāļāļāļĢāļēāļĐāļāļĢ-26
/assemblies/āļ§āļļāļāļīāļŠāļ āļē-12
/assemblies/āļāļāļ°āļĢāļąāļāļĄāļāļāļĢāļĩ-62
Show information correctly. Adding new design for the cabinet, but keeping representatives and senates the same.
View Figma
src/routes/assemblies/[id]/+page.svelte
src/components/Assemblies/Summary.svelte
src/routes/politicians/[id]/+page.svelte
src/components/DownloadData/DownloadData.svelte
src/models
).pdf
or .csv
src/components/DownloadData/DownloadData.story.svelte
. Read more in ReadmeOnly what is included in the screenshot
srv/routes/legislative-process
)/static/images/legislative-process
with a meaning full name.src/components/legislative-process
View Figma file
Politician
and Party
(defined in src/models
), using Politician's avatarAssembly
(defined in src/models
), using the static icon from Figmaname
and description
, using the static icon from Figmayarn gen:component
yarn story:dev
This is a challenging issue that might cause related changes to the current assembly data structure.
Create a branch cabinet/<name>
and PR to merge into cabinet/main
Each assembly will have a members page at /assemblies/[id]/members
. Correctly it's working fine for representative and senate, but it is broken and doesn't match the design yet for cabinet type.
We need to make some changes to support the cabinet and still support the current representative/senate, or propose the solution if it is too complex to change.
This is a huge issue and requires some experimentation. Please read carefully.
View Figma file for more detail brief
src/routes/assemblies/[id]/changes/+page.svelte
. Currently has no UI, just the data prepared by adjacent +page.server.ts
assembly
= assembly infoavailableAssemblies
= list of all assemblies to create a navigation linkassemblyRoles
= list of every combination of politicians (id) and their role in the current assembly (one politician can have more than one role. This is the correct behavior. The member list in the main assembly page is incorrect since current logic removes duplicated politicians, but fixing it is out of this issue's scope)members
politician information that exists in assemblyRoles
/assemblies/āļāļāļ°āļĢāļąāļāļĄāļāļāļĢāļĩ-63/changes
for testing.I bring this issue up in order to inform you that i've added this repo to Bangkok Open Source Festival '23 event since i think that your project can help a lot of people interesting in Thai Parliament. That is a very important factor nowadays.
I think adding this repo to the event will help promoting it to others people and contributors to bring more interesting works into your repo. You can take a look at the event repo here Bangkok Open Source Festival '23 repository, and your project will be shown in the event website here.
Thanks for making this thing up so far! i will help contributing to Parliament Watch
as well.
We have an old version of the component which was designed specifically for the politician's page. We want to add more features and make it a shared component.
yarn gen:component
src/components/politicians/VotingResultTag.svelte
result
is not DefaultVotingResult
isLarge
. If true
, show the large variation. (default = false
= small)Only what is included in the screenshot
srv/routes/legislative-process
)/static/images/legislative-process
with a meaning full name.src/components/legislative-process
View Figma file
src/components/legislative-process/Sidebar.svelte
./legislative-process
page. The route file is located at src/routes/legislative-process/+page.svelte
.View Figma file
max-width
for the body (use the size from Figma) so that the paragraph shouldn't be too long./legislative-process
. The route file is located at src/routes/legislative-process/+page.svelte.Filter button in the bottom left is barely visible. The background is missing. (This one also occurs in desktop size)
When opening the hamburger menu, the filter button is still showing.
Tested on Firefox and Chromium on Linux
interactive-01
color. (See Figma)src/components/politicians/Share.svelte
src/components/Share/Share.svelte
src/components/Share/Share.story.svelte
. Read more in ReadmeA declarative, efficient, and flexible JavaScript library for building user interfaces.
ð Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ððð
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google âĪïļ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.