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

refactor: remove ember-crumbly #651

Merged
merged 53 commits into from
Jun 13, 2023
Merged
Show file tree
Hide file tree
Changes from 48 commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
370cc73
refactor: rename breadCrumb to breadcrumb in routes
guidojw Nov 1, 2022
b9d0524
refactor: merge breadcrumb with route metadata
guidojw Nov 1, 2022
d21fc6f
fix: edit article title
guidojw Nov 1, 2022
3772754
refactor: remove `ember-crumbly` and update BreadCrumbs component
guidojw Nov 1, 2022
e4e00f0
refactor: static-pages routes to new structure
guidojw Nov 1, 2022
97acd51
refactor: change static-pages routes to new structure
guidojw Nov 6, 2022
7e62b6d
refactor(package): remove workerpool resolution
guidojw Nov 6, 2022
92fec0a
fix: optional chain on controller in breadcrumb
guidojw Nov 6, 2022
78d7c6f
refactor: finishing touches on static pages controllers/routes
guidojw Nov 6, 2022
f380c5e
fix: skip breadcrumb when model not loaded
guidojw Nov 6, 2022
5b346cb
refactor: restructure activities controllers and routes
guidojw Nov 7, 2022
ed2e26e
refactor: restructure articles controllers and routes
guidojw Nov 7, 2022
5c11d82
refactor: restructure books controllers and routes
guidojw Nov 7, 2022
0fa751e
refactor: restructure groups controllers and routes
guidojw Nov 7, 2022
4b62efc
Merge branch 'staging' of https://github.com/csvalpha/amber-ui into r…
guidojw Nov 21, 2022
0190c8b
Update changed controllers
guidojw Nov 21, 2022
4b1a35b
Merge branch 'staging' of https://github.com/csvalpha/amber-ui into r…
guidojw Dec 19, 2022
2c11917
Update changed controllers
guidojw Dec 19, 2022
3fd4581
refactor: restructure forum controllers and routes
guidojw Dec 19, 2022
6e44b68
fix: make some routes extend AuthenticatedRoute again
guidojw Dec 20, 2022
81df9bc
refactor: push changes
guidojw Dec 20, 2022
91ed0d4
refactor: restructure debit collections controllers and routes
guidojw Dec 25, 2022
1b26ead
refactor: only import has-next in bundle
guidojw Dec 27, 2022
22c7459
Merge branch 'staging' of https://github.com/csvalpha/amber-ui into r…
guidojw Dec 29, 2022
24d394c
refactor: change some ENV imports to absolute
guidojw Dec 29, 2022
76bcd86
refactor: restructure debit mandates controllers and routes
guidojw Dec 29, 2022
2cb0d6b
refactor: restructure debit transactions controllers and routes
guidojw Dec 29, 2022
e73c05b
fix: transaction permission error
guidojw Dec 29, 2022
34f04d4
feat: implement profile route
guidojw Dec 29, 2022
f87e288
refactor: restructure article and photo comments controllers and routes
guidojw Dec 29, 2022
14be136
refactor: restructure photo-albums controllers and routes
guidojw Dec 29, 2022
f299429
refactor: restructure users controllers and routes
guidojw Dec 30, 2022
bfaffe5
refactor: restructure polls controllers and routes
guidojw Dec 30, 2022
1b879b5
refactor: restructure mail aliases controllers and routes
guidojw Dec 30, 2022
be13c25
refactor: restructure mail moderations controllers and routes
guidojw Dec 30, 2022
d613c84
refactor: restructure form responses controllers and routes
guidojw Dec 30, 2022
d85bd42
refactor: restructure vacancies controllers and routes
guidojw Dec 30, 2022
d726152
refactor: fix and implement missing tests
guidojw Dec 30, 2022
1f83ea1
fix: lint
guidojw Dec 30, 2022
1738b1f
refactor: rename BreadCrumbs to Breadcrumbs
guidojw Dec 31, 2022
f272c59
chore: change mailalias to mail alias
guidojw Dec 31, 2022
fe2a6f3
Merge branch 'staging' into refactor/remove-ember-crumbly
guidojw Jan 7, 2023
1addd87
chore: reformat classes
guidojw Jan 7, 2023
a11d5a7
Merge branch 'staging' into refactor/remove-ember-crumbly
guidojw Jan 23, 2023
cae95b3
Merge remote-tracking branch 'origin/staging' into refactor/remove-em…
guidojw Mar 8, 2023
826b1d6
Merge branch 'staging' into refactor/remove-ember-crumbly
DrumsnChocolate Mar 12, 2023
fbcd21c
Merge branch 'staging' into refactor/remove-ember-crumbly
DrumsnChocolate May 6, 2023
623e3e7
add a folder for mail-moderation. Tested the reachability of the page…
DrumsnChocolate May 6, 2023
681fc78
Merge branch 'staging' into refactor/remove-ember-crumbly
guidojw Jun 12, 2023
07f5847
refactor: reorder params
guidojw Jun 13, 2023
6dd8df4
refactor: simplify getter
guidojw Jun 13, 2023
ef04904
fix: transaction-form title
guidojw Jun 13, 2023
bf0b651
fix: post-form/collection-form title
guidojw Jun 13, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 4 additions & 0 deletions app/abilities/article-comment.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import { Ability } from 'ember-can';

export default class ArticleComment extends Ability {
get canShow() {
return this.session.hasPermission('article-comment.read');
}

get canCreate() {
return this.session.hasPermission('article-comment.create');
}
Expand Down
4 changes: 4 additions & 0 deletions app/abilities/debit/transaction.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import { Ability } from 'ember-can';

export default class Transaction extends Ability {
get canShow() {
return this.session.hasPermission('debit/transaction.read');
}

get canEdit() {
return this.session.hasPermission('debit/transaction.update');
}
Expand Down
2 changes: 1 addition & 1 deletion app/abilities/photo.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default class Photo extends Ability {
get canShowPhotoComments() {
return (
this.session.hasPermission('photo-comment.read') ||
this.model.photoAlbum.publiclyVisible
this.model.photoAlbum.get('publiclyVisible')
DrumsnChocolate marked this conversation as resolved.
Show resolved Hide resolved
);
}
}
2 changes: 1 addition & 1 deletion app/adapters/application.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import JSONAPIAdapter from '@ember-data/adapter/json-api';
import { underscore } from '@ember/string';
import { inject as service } from '@ember/service';
import ENV from '../config/environment';
import ENV from 'amber-ui/config/environment';

import { pluralize } from 'ember-inflector';

Expand Down
2 changes: 1 addition & 1 deletion app/authenticators/oauth2.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import OAuth2PasswordGrant from 'ember-simple-auth/authenticators/oauth2-password-grant';
import ENV from '../config/environment';
import ENV from 'amber-ui/config/environment';

export default class OAuth2Authenticator extends OAuth2PasswordGrant {
serverTokenEndpoint = `${ENV.api.hostname}/oauth/token`;
Expand Down
11 changes: 0 additions & 11 deletions app/components/bread-crumbs.hbs

This file was deleted.

3 changes: 0 additions & 3 deletions app/components/bread-crumbs.js

This file was deleted.

15 changes: 15 additions & 0 deletions app/components/breadcrumbs.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<ol class='breadcrumb'>
<li class='breadcrumb-item'><LinkTo @route='index'>C.S.V. Alpha</LinkTo></li>

{{#each @routeInfos as |routeInfo|}}
<li class='breadcrumb-item'>
{{#if (has-next routeInfo @routeInfos)}}
<LinkTo @route={{routeInfo.name}}>
{{routeInfo.metadata.breadcrumb.title}}
</LinkTo>
{{else}}
{{routeInfo.metadata.breadcrumb.title}}
{{/if}}
</li>
{{/each}}
</ol>
4 changes: 2 additions & 2 deletions app/components/cards/activity-card.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@
<span class='subtitle-author' data-test-activity-author>
{{#if activity.group}}
<LinkTo
@route='groups.show'
@route='groups.group'
@model={{activity.group.id}}
class='link-to card-subtitle-link'
>
{{activity.group.name}}
</LinkTo>
{{else}}
<LinkTo
@route='users.show'
@route='users.user'
@model={{activity.author.id}}
class='link-to card-subtitle-link'
>
Expand Down
8 changes: 4 additions & 4 deletions app/components/cards/article-card.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
</div>

<div class='card-titles'>
<LinkTo @route='articles.show' @model={{article.id}}>
<LinkTo @route='articles.article' @model={{article.id}}>
<h2 class='card-title' itemprop='name headline'>
{{#if article.pinned}}<FaIcon @icon='thumbtack' />{{/if}}
{{article.title}}
Expand All @@ -32,7 +32,7 @@
<h3 class='card-subtitle'>
{{#if article.group}}
<LinkTo
@route='groups.show'
@route='groups.group'
@model={{article.group.id}}
class='link-to card-subtitle-link'
>
Expand All @@ -46,7 +46,7 @@
</LinkTo>
{{else}}
<LinkTo
@route='users.show'
@route='users.user'
@model={{article.author.id}}
class='link-to card-subtitle-link'
>
Expand Down Expand Up @@ -101,7 +101,7 @@
}}
</span>
{{#if useMaxHeight}}
<LinkTo @route='articles.show' @model={{article.id}} itemprop='url'>
<LinkTo @route='articles.article' @model={{article.id}} itemprop='url'>
<span class='float-md-right'> {{t 'tag.button.readMore'}} </span>
</LinkTo>
{{/if}}
Expand Down
6 changes: 3 additions & 3 deletions app/components/cards/frontpage-article-card.hbs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<LinkTo @route='articles.show' @model={{article.id}}>
<LinkTo @route='articles.article' @model={{article.id}}>
<article
class={{if useMaxHeight 'd-flex'}}
itemscope
Expand All @@ -24,7 +24,7 @@
</h5>
{{#if article.group}}
<LinkTo
@route='groups.show'
@route='groups.group'
@model={{article.group.id}}
class='link-to card-subtitle-link'
>
Expand All @@ -39,7 +39,7 @@
</LinkTo>
{{else}}
<LinkTo
@route='users.show'
@route='users.user'
@model={{article.author.id}}
class='link-to card-subtitle-link'
>
Expand Down
2 changes: 1 addition & 1 deletion app/components/cards/privacy-preference.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

{{#if (can 'edit user' model)}}
<LinkTo
@route='users.edit-privacy'
@route='users.user.edit.privacy'
@model={{model.id}}
class='btn btn-outline-info'
>
Expand Down
2 changes: 1 addition & 1 deletion app/components/form/response/response-card.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
@inputLayout='vertical'
>
{{#if form.questions}}
<LinkTo @route='activities.index' class='btn btn-default'>
<LinkTo @route='activities' class='btn btn-default'>
Annuleren
</LinkTo>
Vragen met een * zijn verplicht
Expand Down
2 changes: 1 addition & 1 deletion app/components/form/response/response-completed-alert.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</span>
{{#if form.canRespond}}
<LinkTo
@route='form.responses.destroy'
@route='form.responses.response.destroy'
@model={{form.currentUserResponseId}}
class='btn btn-secondary'
>
Expand Down
4 changes: 2 additions & 2 deletions app/components/form/responses-table-row.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
{{#if (can 'destroy form/response')}}
{{#if response.form.canRespond}}
<LinkTo
@route='form.responses.destroy'
@route='form.responses.response.destroy'
@model={{response.id}}
class='no-print'
>
Expand All @@ -17,7 +17,7 @@
{{/if}}
{{/if}}

<LinkTo @route='users.show' @model={{response.user.id}}>
<LinkTo @route='users.user' @model={{response.user.id}}>
{{response.user.fullNameWithNickname}}
</LinkTo>
</td>
Expand Down
6 changes: 3 additions & 3 deletions app/components/forms/photo-album-form.hbs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class='card'>
<div class='card-header'>
<h5>{{if @model.isNew 'Foto-album aanmaken' 'Foto-album wijzigen'}}</h5>
<h5>{{if @model.isNew 'Fotoalbum aanmaken' 'Fotoalbum wijzigen'}}</h5>
</div>
<div class='card-body'>
<form {{action @onSubmit on='submit'}}>
Expand All @@ -23,7 +23,7 @@

{{#if @model.publiclyVisible}}
<div class='alert alert-warning' role='alert'>
Een publiek foto-album verschijnt op de voorpagina, en is ook voor
Een publiek fotoalbum verschijnt op de voorpagina, en is ook voor
externen zichtbaar. Wees dus voorzichtig met wat je plaatst en zorg
dat je toestemming hebt. Zie het mediabeleid voor meer informatie.
</div>
Expand Down Expand Up @@ -73,7 +73,7 @@
@errors={{@model.errors}}
@errorMessage={{@errorMessage}}
>
<button {{action @onCancel}} type="button" class='btn btn-default'>
<button {{action @onCancel}} type='button' class='btn btn-default'>
Annuleren
</button>
</ModelForm::FormActions>
Expand Down
8 changes: 4 additions & 4 deletions app/components/forum/forum-post.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
<div class='card-body'>
<div class='row'>
<div class='col-md-3 forum-post-author-info'>
<LinkTo @route='users.show' @model={{post.author.id}}>
<LinkTo @route='users.user' @model={{post.author.id}}>
<img
src='{{post.author.avatarThumbUrlOrDefault}}'
alt='avatar'
class='profile-picture profile-picture-large'
/>
</LinkTo>
<LinkTo @route='users.show' @model={{post.author.id}}>
<LinkTo @route='users.user' @model={{post.author.id}}>
<p> <strong> {{post.author.fullNameWithNickname}} </strong> </p>
</LinkTo>
</div>
Expand Down Expand Up @@ -52,7 +52,7 @@
<span class='text-muted pr-1'>
{{#if (can 'destroy forum/posts')}}
<LinkTo
@route='forum.categories.category.threads.thread.posts.destroy'
@route='forum.categories.category.threads.thread.posts.post.destroy'
@model={{post.id}}
class='link-highlight px-2'
>
Expand All @@ -62,7 +62,7 @@

{{#if (can 'edit forum/post' post)}}
<LinkTo
@route='forum.categories.category.threads.thread.posts.edit'
@route='forum.categories.category.threads.thread.posts.post.edit'
@model={{post.id}}
class='link-highlight px-2'
>
Expand Down
35 changes: 25 additions & 10 deletions app/components/header-nav.hbs
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
<nav class='navbar container-fluid pb-0 pt-0 d-flex justify-content-between' aria-label='breadcrumb'>
<span class='left-sidebar-toggle d-block d-md-none link' {{action 'toggleLeftSidebar'}}>
<nav
class='navbar container-fluid pb-0 pt-0 d-flex justify-content-between'
aria-label='breadcrumb'
>
<span
class='left-sidebar-toggle d-block d-md-none link'
{{action 'toggleLeftSidebar'}}
>
</span>

Expand All @@ -11,14 +17,16 @@
<div class='navbar-overflow-wrapper'>
<div class='navbar-nav col d-flex flex-row'>
{{#if (or session.isAuthenticated media.isMobile)}}
<BreadCrumbs @crumbClass='breadcrumb-item' />
<Breadcrumbs @routeInfos={{@routeInfos}} />
{{else}}
<BsDropdown as |dd| {{did-insert (action 'setAvailableStaticPages')}}>
<dd.button @type="primary">{{t "component.headerNav.aboutUs"}}</dd.button>
<BsDropdown {{did-insert (action 'setAvailableStaticPages')}} as |dd|>
<dd.button @type='primary'>
{{t 'component.headerNav.aboutUs'}}
</dd.button>
<dd.menu @renderInPlace={{false}} as |ddm|>
{{#each-in staticPagesForDropdown as |id title|}}
<ddm.item>
<ddm.linkTo @route='static-pages.show' @model={{id}}>
<ddm.linkTo @route='static-pages.static-page' @model={{id}}>
{{title}}
</ddm.linkTo>
</ddm.item>
Expand All @@ -32,7 +40,10 @@

{{#unless session.isAuthenticated}}
<LinkTo @route='login' class='nav-item d-none d-md-flex mr-2'>
<button class='btn btn-primary d-inline nav-link pl-2 pr-2' type='button'>
<button
class='btn btn-primary d-inline nav-link pl-2 pr-2'
type='button'
>
{{t 'tag.button.signin'}}
</button>
</LinkTo>
Expand All @@ -41,8 +52,12 @@
</div>

{{#unless session.isAuthenticated}}
<button class='btn btn-locale btn-inverse-locale-{{intl.locale}}' title='{{t "component.headerNav.changeLocale"}}'
{{action 'toggleLocale'}} type='button'>
<button
class='btn btn-locale btn-inverse-locale-{{intl.locale}}'
title='{{t "component.headerNav.changeLocale"}}'
{{action 'toggleLocale'}}
type='button'
>
</button>
{{/unless}}
</nav>
</nav>
2 changes: 1 addition & 1 deletion app/components/header-nav.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export default Component.extend({
addStaticPageOption: function (list, id, localeName) {
if (this.availableStaticPages && this.availableStaticPages[id]) {
list.push({
link: 'static-pages.show',
link: 'static-pages.static-page',
linkArgument: id,
title: this.intl.t('component.headerNav.' + localeName),
icon: '',
Expand Down
2 changes: 1 addition & 1 deletion app/components/index/public/about-alpha.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</p>

<LinkTo
@route='static-pages.show'
@route='static-pages.static-page'
@model='c-s-v-alpha'
class='btn btn-lg frontpage-button--light mr-3 mb-3'
>
Expand Down
2 changes: 1 addition & 1 deletion app/components/index/public/action-buttons.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
{{t 'component.index.public.actionButtons.memberButton'}}
</a>
<LinkTo
@route='static-pages.show'
@route='static-pages.static-page'
@model='word-lid'
class='btn btn-lg frontpage-button mt-3'
>
Expand Down
2 changes: 1 addition & 1 deletion app/components/index/special-promo.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<em>{{date}}</em>
<p>{{text}}</p>
<LinkTo
@route='articles.show'
@route='articles.article'
@model={{123}}
class='btn frontpage-button btn-lg float-xs-right'
>
Expand Down
4 changes: 3 additions & 1 deletion app/components/index/sponsorkliks-alert.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
bij verschillende webshops verdient Alpha er ook nog wat aan. De uitgebreide
uitleg vind je
<b>
<LinkTo @route='static-pages.show' @model='alpha-deals'>hier</LinkTo>
<LinkTo @route='static-pages.static-page' @model='alpha-deals'>
hier
</LinkTo>
</b>.

<br />
Expand Down
4 changes: 2 additions & 2 deletions app/components/menu-sidebar.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@

<div class='profile-menu {{if layoutManager.profileMenuOpen "open"}}'>
<MenuSidebarItem
@link='users.show'
@link='users.user'
@hasPermission={{can 'show activities'}}
@icon='user'
@title={{t 'mixin.menuItems.profile'}}
Expand All @@ -55,7 +55,7 @@
@link='mail-aliases'
@hasPermission={{can 'show mail-aliases'}}
@icon='envelope'
@title={{t 'mixin.menuItems.mailaliases'}}
@title={{t 'mixin.menuItems.mailAliases'}}
@minor={{true}}
/>
<MenuSidebarItem
Expand Down
Loading