datasektionen / bawang Goto Github PK
View Code? Open in Web Editor NEWEn inte längre ny hemsida. I nutiden. Som purjo fast klyftigare.
Home Page: https://datasektionen.se
En inte längre ny hemsida. I nutiden. Som purjo fast klyftigare.
Home Page: https://datasektionen.se
Vi borde ha en knapp som tar dig till att göra en pull request i github på bawang-content på varje sida!
Currently it fetches whatever caly0so gives, which is the same as the events feed.
This does not include past events, so past events aren't shown.
I'm not sure if it fetches all future events.
When you hover over buttons they need to react in some way, like changing to a darker tone and/or changing size, which clearly signals that they're clickable and makes it just feel nicer. This is missing on all the nav bar buttons, the side bar buttons on subpages, all cerise buttons on the main page, and also all regular text links.
Installerar bawang med npm install
, den klagar och säger:
npm WARN deprecated [email protected]: use node-gyp@3+, it does all the things
npm WARN prefer global [email protected] should be installed with -g
npm WARN prefer global [email protected] should be installed with -g
> [email protected] install /home/_/bawang/node_modules/node-sass
> node scripts/install.js
Can not download file from https://raw.githubusercontent.com/sass/node-sass-binaries/v2.1.1/linux-x64-node-4.1/binding.node
> [email protected] postinstall /home/_/bawang/node_modules/node-sass
> node scripts/build.js
module.js:338
throw err;
^
Error: Cannot find module '/home/_/bawang/node_modules/node-sass/node_modules/pangyp/bin/node-gyp'
at Function.Module._resolveFilename (module.js:336:15)
at Function.Module._load (module.js:286:25)
at Function.Module.runMain (module.js:475:10)
at startup (node.js:117:18)
at node.js:951:3
Build failed
npm WARN prefer global [email protected] should be installed with -g
> [email protected] install /home/_/bawang/node_modules/node-sass
> node scripts/install.js
> [email protected] postinstall /home/_/bawang/node_modules/node-sass
> node scripts/build.js
module.js:338
throw err;
^
Error: Cannot find module '/home/_/bawang/node_modules/node-sass/node_modules/pangyp/bin/node-gyp'
at Function.Module._resolveFilename (module.js:336:15)
at Function.Module._load (module.js:286:25)
at Function.Module.runMain (module.js:475:10)
at startup (node.js:117:18)
at node.js:951:3
Build failed
npm WARN prefer global [email protected] should be installed with -g
Något paket jag inte har? <3
Edit: Hjälper ju att läsa READMEn innan............ Tror inte det är något problem, körde bara kommandona i fel ordning >.<
A Repository is considered documented if it meets the following requirement:
Since we have an ical that is available from calypso (https://calypso.datasektionen.se/feeds/ical), it could be nice to have a visual view of the coming events.
For an example on how this could be implemented, see mottagningens page (https://datasektionen.se/namnder/mottagningen) https://github.com/datasektionen/bawang-content/blob/1383b7301b272e5bd6deae96eebb61d5d45df6a1/namnder/mottagningen/body.md?plain=1#L10
A bit unsure how the implementation changes due to having an ical rather than an google-cal though, but it ought to be possible
Could be either at the main page or in /nyheter
, which would mean that it should be implemented in bawang.
An example for how this could look can be seen on medieteknik.com (at the bottom of the page)
2018-11-03T08:05:00.138060057Z app[web.1]: fetching https://calypso.datasektionen.se/api/item/7083
2018-11-03T08:05:08.836147776Z app[web.1]: fetching https://taitan.datasektionen.se/en/clubs/informationsorganet
2018-11-03T08:05:39.524897356Z app[web.1]: fetching https://taitan.datasektionen.se/kalender.ics/
2018-11-03T08:05:41.811316103Z app[web.1]: fetching https://taitan.datasektionen.se/kalender.ics/
2018-11-03T08:06:02.420559251Z app[web.1]: fetching https://calypso.datasektionen.se/api/item/7083
2018-11-03T08:06:42.571090640Z app[web.1]: FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
2018-11-03T08:06:42.571111079Z app[web.1]:
2018-11-03T08:06:42.571146964Z app[web.1]: <--- Last few GCs --->
2018-11-03T08:06:42.571152175Z app[web.1]:
2018-11-03T08:06:42.571155764Z app[web.1]: [194:0x25ceea0] 560136016 ms: Mark-sweep 1303.2 (1455.1) -> 1303.2 (1455.1) MB, 2244.0 / 0.0 ms (average mu = 0.179, current mu = 0.006) last resort GC in old space requested
2018-11-03T08:06:42.571159872Z app[web.1]: [194:0x25ceea0] 560138350 ms: Mark-sweep 1303.2 (1455.1) -> 1303.2 (1455.1) MB, 2333.2 / 0.0 ms (average mu = 0.097, current mu = 0.000) last resort GC in old space requested
2018-11-03T08:06:42.571163879Z app[web.1]:
2018-11-03T08:06:42.571167187Z app[web.1]:
2018-11-03T08:06:42.571170585Z app[web.1]: <--- JS stacktrace --->
2018-11-03T08:06:42.571174162Z app[web.1]:
2018-11-03T08:06:42.571177524Z app[web.1]: ==== JS stack trace =========================================
2018-11-03T08:06:42.571181047Z app[web.1]:
2018-11-03T08:06:42.571184330Z app[web.1]: 0: ExitFrame [pc: 0x22d34515be1d]
2018-11-03T08:06:42.571187763Z app[web.1]: 1: StubFrame [pc: 0x22d345185af3]
2018-11-03T08:06:42.571191185Z app[web.1]: Security context: 0x0caa2511e6e1 <JSObject>
2018-11-03T08:06:42.571194775Z app[web.1]: 2: send [0x2e605b5bdd69] [/app/node_modules/express/lib/response.js:221] [bytecode=0x317e0dee6221 offset=688](this=0x068c2da45159 <ServerResponse map = 0x40ed9f7b361>,body=0x06a0d609b3c1 <Very long string[18880]>)
2018-11-03T08:06:42.571199068Z app[web.1]: 3: /* anonymous */(aka /* anonymous */) [0x68c2da468f1] [/app/build/server.js:1] [bytecode=0x267f919...
2018-11-03T08:06:42.571202673Z app[web.1]:
2018-11-03T08:06:42.596874034Z app[web.1]: 1: 0x8daaa0 node::Abort() [node]
2018-11-03T08:06:42.597227645Z app[web.1]: 2: 0x8daaec [node]
2018-11-03T08:06:42.599720868Z app[web.1]: 3: 0xad79ae v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [node]
2018-11-03T08:06:42.601597269Z app[web.1]: 4: 0xad7be4 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [node]
2018-11-03T08:06:42.602335080Z app[web.1]: 5: 0xece9e2 [node]
2018-11-03T08:06:42.604394826Z app[web.1]: 6: 0xede2df v8::internal::Heap::AllocateRawWithRetryOrFail(int, v8::internal::AllocationSpace, v8::internal::AllocationAlignment) [node]
2018-11-03T08:06:42.605077996Z app[web.1]: 7: 0xea6356 [node]
2018-11-03T08:06:42.605794880Z app[web.1]: 8: 0xeb8c37 v8::internal::Factory::NewLoadHandler(int) [node]
2018-11-03T08:06:42.607820542Z app[web.1]: 9: 0xf3835b v8::internal::LoadHandler::LoadFromPrototype(v8::internal::Isolate*, v8::internal::Handle<v8::internal::Map>, v8::internal::Handle<v8::internal::JSReceiver>, v8::internal::Handle<v8::internal::Smi>, v8::internal::MaybeHandle<v8::internal::Object>, v8::internal::MaybeHandle<v8::internal::Object>) [node]
2018-11-03T08:06:42.609058748Z app[web.1]: 10: 0xf3fd2f v8::internal::LoadIC::ComputeHandler(v8::internal::LookupIterator*) [node]
2018-11-03T08:06:42.610239545Z app[web.1]: 11: 0xf46bec v8::internal::LoadIC::UpdateCaches(v8::internal::LookupIterator*) [node]
2018-11-03T08:06:42.612644805Z app[web.1]: 12: 0xf4732c v8::internal::LoadIC::Load(v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Name>) [node]
2018-11-03T08:06:42.615040208Z app[web.1]: 13: 0xf4be32 v8::internal::Runtime_LoadIC_Miss(int, v8::internal::Object**, v8::internal::Isolate*) [node]
2018-11-03T08:06:42.615054876Z app[web.1]: 14: 0x22d34515be1d
2018-11-03T08:06:43.110924272Z app[web.1]: Aborted (core dumped)
2018-11-03T08:06:43.546815832Z app[web.1]: npm ERR! code ELIFECYCLE
2018-11-03T08:06:43.554624473Z app[web.1]: npm ERR! errno 134
2018-11-03T08:06:43.596047990Z app[web.1]: npm ERR! bawang@ start: `node -r esm build/server.js`
2018-11-03T08:06:43.596580096Z app[web.1]: npm ERR! Exit status 134
2018-11-03T08:06:43.597304925Z app[web.1]: npm ERR!
2018-11-03T08:06:43.597316239Z app[web.1]: npm ERR! Failed at the bawang@ start script.
2018-11-03T08:06:43.597355125Z app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2018-11-03T08:06:43.718201750Z app[web.1]:
2018-11-03T08:06:43.720084101Z app[web.1]: npm ERR! A complete log of this run can be found in:
2018-11-03T08:06:43.720100673Z app[web.1]: npm ERR! /app/.npm/_logs/2018-11-03T08_06_43_657Z-debug.log
2018-11-03T08:06:48.132907878Z app[web.1]: Could not determine a reasonable value for WEB_CONCURRENCY.
2018-11-03T08:06:48.132941769Z app[web.1]: This is likely due to running the Heroku NodeJS buildpack on a non-Heroku
2018-11-03T08:06:48.132946351Z app[web.1]: platform.
2018-11-03T08:06:48.132949761Z app[web.1]:
2018-11-03T08:06:48.132953026Z app[web.1]: WEB_CONCURRENCY has been set to 1. Please review whether this value is
2018-11-03T08:06:48.132956656Z app[web.1]: appropriate for your application.
2018-11-03T08:06:48.132960042Z app[web.1]:
2018-11-03T08:06:48.653927726Z app[web.1]:
2018-11-03T08:06:48.653962348Z app[web.1]: > bawang@ start /app
2018-11-03T08:06:48.653967154Z app[web.1]: > node -r esm build/server.js
2018-11-03T08:06:48.653970740Z app[web.1]:
2018-11-03T08:06:52.395967874Z app[web.1]: 🚀 started on port 5000
Följande står i loggen
(node:156) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): TypeError: err.startsWith is not a function
Firstly, the delta logo in the top navbar leads to the main page in Swedish instead of English when you are viewing the website in English.
(Fixed in #80) This also happens with all three of the filtration links in the left navbar of the news page. With the filtration links, the already have ?itemType=POST
or ?itemType=EVENT
so it will not be possible to simply add ?lang=en
on top of that. Instead, I noticed appending &lang=en
to the URL works.
There exists a "More news" button, but no "More events" button. If there are more than 4 upcoming events, a button should appear saying that there are more events, that is not currently the case which is confusing.
Should be fixed in src/components/Frontpage/index.js
Discovered thanks to @triggerdude33
Title. The image gets ~4% larger when switching from Swedish to English.
The build system used here has now gotten quite old and could use a refresh. Having to use node version 10 isn't very fun and I've been trying to run npm install
with npm version 6.14.12 but haven't gotten anywhere ;(
I think that most of the client side code would still work in modern react (correct me if I'm wrong) and the only interesting line of the server side code seems to be
https://github.com/datasektionen/bawang/blob/1a2aee8c3d8790c75b0d12a94f76118fbbd3ee14/src/server.js#L33C3-L33C76
which should be possible to implement directly in nginx.
I've heard good things about vite, but don't know too much about react and what's nice to use.
Introduced in https://github.com/datasektionen/calypso/pull/65
Either we need to fetch activities from /api/activities
and parse the recurrence periods here in bawang, or we could make the /api/event/span
also return activities in the provided time period. But the perhaps that endpoint should also be renamed? I'm not sure what's best.
Currently, switching language takes you to the main page for that language, it would be more nice and intuitive if you instead landed on the corresponding page in the other language (if it exists)
Due to the way that bawang is curently implemented, this is probably quite annoying. Some possible solutions I can think of now:
en
for all content folders instead of at the top level
meta.toml
maybe provides a nice way to do this, will have to look further into how this worksIf this is added, the same should probably be implemented in styrdokument-bawang once english versions of the documents are added there.
A 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.