1
0
mirror of https://github.com/flarum/core.git synced 2025-08-25 17:31:55 +02:00

Compare commits

..

13 Commits

Author SHA1 Message Date
Ian Morland
a0ce859e21 chore: wrap PR ref in () 2023-03-24 09:50:49 +00:00
Ian Morland
ff72afa601 chore: prep 1.7.2 2023-03-24 09:31:43 +00:00
flarum-bot
4894f34249 Bundled output for commit d684248492
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2023-03-24 09:30:40 +00:00
IanM
e3069d861a fix: empty string displayed as SelectDropdown title (#3773)
* fix: empty string displayed as SelectDropdown title

* chore: remove import

* chore: ts-ignore

* Update framework/core/js/src/common/components/SelectDropdown.tsx

Co-authored-by: David Wheatley <david@davwheat.dev>

---------

Co-authored-by: David Wheatley <david@davwheat.dev>
2023-03-24 09:30:33 +00:00
Sami Mazouz
a6b12826c3 chore: 1.7.1 preparations
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-03-12 13:28:04 +01:00
Sami Mazouz
dd868ab44e fix: improve sessions user UI on mobile
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-03-12 13:21:21 +01:00
flarum-bot
5f3e0d6a09 Bundled output for commit 661b9d7d9a
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2023-03-12 11:45:23 +00:00
Robert Korulczyk
661b9d7d9a chore: hide developer tokens section in if there is nothing to display or create (#3753) 2023-03-12 12:37:49 +01:00
flarum-bot
b7498d6cb1 Bundled output for commit e7c55532a0
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2023-03-12 09:46:12 +00:00
Robert Korulczyk
e7c55532a0 fix: hardcoded language strings in StatusWidget (#3754) 2023-03-12 10:37:57 +01:00
Robert Korulczyk
cce6b74fce fix: missing parameter names in token title translation. (#3752) 2023-03-12 10:33:19 +01:00
flarum-bot
da651c722b Bundled output for commit abc9670659
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2023-03-11 08:14:06 +00:00
Sami Mazouz
abc9670659 fix(tags): incorrect max and min primary tags used
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-03-11 09:05:12 +01:00
15 changed files with 61 additions and 38 deletions

View File

@@ -1,5 +1,17 @@
# Changelog
## [v1.7.2](https://github.com/flarum/framework/compare/v1.7.1...v1.7.2)
### Fixed
- empty string displayed as SelectDropdown title (#3773)
## [v1.7.1](https://github.com/flarum/framework/compare/v1.7.0...v1.7.1)
### Fixed
- (tags) composer tag selection modal using wrong primary max & min numbers (abc9670659426b765274376945b818b70d84848c)
- missing parameter names in token title translation. (#3752)
- hardcoded language strings in StatusWidget (#3754)
- hide developer tokens section in if there is nothing to display or create (#3753)
- improve sessions user UI on mobile (dd868ab44e11e892d020e3b9412553c6a789e68d)
## [v1.7.0](https://github.com/flarum/framework/compare/v1.6.3...v1.7.0)
### Added
- (actions) allow running JS tests in GH actions [#3730]

2
extensions/tags/js/dist/forum.js generated vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -27,11 +27,11 @@ export default class TagDiscussionModal extends TagSelectionModal<TagDiscussionM
attrs.limits = {
allowBypassing: attrs.allowResetting,
max: {
primary: app.forum.attribute<number>('minPrimaryTags'),
primary: app.forum.attribute<number>('maxPrimaryTags'),
secondary: app.forum.attribute<number>('maxSecondaryTags'),
},
min: {
primary: app.forum.attribute<number>('maxPrimaryTags'),
primary: app.forum.attribute<number>('minPrimaryTags'),
secondary: app.forum.attribute<number>('minSecondaryTags'),
},
};

2
framework/core/js/dist/admin.js generated vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

2
framework/core/js/dist/forum.js generated vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -39,7 +39,7 @@ export default class StatusWidget extends DashboardWidget {
'schedule-status',
[
<span>
<strong>Scheduler</strong>{' '}
<strong>{app.translator.trans('core.admin.dashboard.status.headers.scheduler-status')}</strong>{' '}
<LinkButton href="https://discuss.flarum.org/d/24118" external={true} target="_blank" icon="fas fa-info-circle" />
</span>,
<br />,
@@ -49,8 +49,16 @@ export default class StatusWidget extends DashboardWidget {
);
}
items.add('queue-driver', [<strong>Queue Driver</strong>, <br />, app.data.queueDriver], 60);
items.add('session-driver', [<strong>Session Driver</strong>, <br />, app.data.sessionDriver], 50);
items.add(
'queue-driver',
[<strong>{app.translator.trans('core.admin.dashboard.status.headers.queue-driver')}</strong>, <br />, app.data.queueDriver],
60
);
items.add(
'session-driver',
[<strong>{app.translator.trans('core.admin.dashboard.status.headers.session-driver')}</strong>, <br />, app.data.sessionDriver],
50
);
return items;
}

View File

@@ -1,6 +1,5 @@
import Dropdown, { IDropdownAttrs } from './Dropdown';
import icon from '../helpers/icon';
import extractText from '../utils/extractText';
import classList from '../utils/classList';
import type Component from '../Component';
import type Mithril from 'mithril';
@@ -50,7 +49,8 @@ export default class SelectDropdown<CustomAttrs extends ISelectDropdownAttrs = I
const activeChild = children.find(isActive);
let label = (activeChild && typeof activeChild === 'object' && 'children' in activeChild && activeChild.children) || this.attrs.defaultLabel;
label = extractText(label);
// @ts-ignore
if (Array.isArray(label)) label = label[0];
return [<span className="Button-label">{label}</span>, this.attrs.caretIcon ? icon(this.attrs.caretIcon, { className: 'Button-caret' }) : null];
}

View File

@@ -185,7 +185,7 @@ export default class AccessTokensList<CustomAttrs extends IAccessTokensListAttrs
const name = token.title() || app.translator.trans('core.forum.security.token_title_placeholder');
const value = this.tokenValueDisplay(token);
return app.translator.trans('core.forum.security.token_item_title', { name, value });
return app.translator.trans('core.forum.security.token_item_title', { title: name, token: value });
}
tokenValueDisplay(token: AccessToken): Mithril.Children {

View File

@@ -51,17 +51,27 @@ export default class UserSecurityPage<CustomAttrs extends IUserPageAttrs = IUser
settingsItems() {
const items = new ItemList<Mithril.Children>();
['developerTokens', 'sessions'].forEach((section) => {
const sectionName = `${section}Items` as 'developerTokensItems' | 'sessionsItems';
const sectionLocale = camelCaseToSnakeCase(section);
if (
app.forum.attribute('canCreateAccessToken') ||
app.forum.attribute('canModerateAccessTokens') ||
(this.state.hasLoadedTokens() && this.state.getDeveloperTokens()?.length)
) {
items.add(
section,
<FieldSet className={`UserSecurityPage-${section}`} label={app.translator.trans(`core.forum.security.${sectionLocale}_heading`)}>
{this[sectionName]().toArray()}
'developerTokens',
<FieldSet className="UserSecurityPage-developerTokens" label={app.translator.trans(`core.forum.security.developer_tokens_heading`)}>
{this.developerTokensItems().toArray()}
</FieldSet>
);
});
} else if (!this.state.hasLoadedTokens()) {
items.add('developerTokens', <LoadingIndicator />);
}
items.add(
'sessions',
<FieldSet className="UserSecurityPage-sessions" label={app.translator.trans(`core.forum.security.sessions_heading`)}>
{this.sessionsItems().toArray()}
</FieldSet>
);
if (this.user!.id() === app.session.user!.id()) {
items.add(

View File

@@ -16,10 +16,6 @@
border-radius: var(--border-radius);
overflow: hidden;
> *:not(:first-child) {
margin-left: 1px;
}
&-item {
display: flex;
padding: 16px 16px 16px 0;
@@ -65,26 +61,19 @@
@media @phone {
.AccessTokensList {
> *:not(:first-child) {
margin-left: 8px;
}
&-item {
flex-wrap: wrap;
padding: 16px;
> *:not(:first-child) {
margin-left: 16px;
}
&-icon {
width: 100%;
justify-content: start;
padding: 8px;
width: auto;
min-width: calc(~"var(--font-size) + 4rem");
}
&-actions {
width: 100%;
width: auto;
}
}
}

View File

@@ -58,6 +58,10 @@ core:
description: Your forum at a glance.
io_error_message: "Could not write to filesystem. Check your filesystem permissions and try again. Or try running from the command line."
status:
headers:
scheduler-status: Scheduler
queue-driver: Queue Driver
session-driver: Session Driver
scheduler:
active: Active
inactive: Inactive
@@ -65,7 +69,7 @@ core:
title: Dashboard
tools_button: Tools
# These translations are usin in the debug warning widget.
# These translations are used in the debug warning widget.
debug-warning:
detail: |
When <code>debug</code> mode is active, Flarum will rebuild its <code>JavaScript</code> and <code>CSS</code> assets on every request, and could also potentially leak other information, such as database secrets, environment variables, etc.

View File

@@ -21,7 +21,7 @@ class Application
*
* @var string
*/
const VERSION = '1.7.0';
const VERSION = '1.7.2';
/**
* The IoC container for the Flarum application.