Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

GYU: Account Notification Settings #11008

Merged
merged 43 commits into from
Jun 29, 2023
Merged
Show file tree
Hide file tree
Changes from 36 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
2432bdb
Implement new notification settings UI
justjanne Jun 14, 2023
57499df
Sort new keywords at the front
justjanne Jun 14, 2023
1845df6
Make ts-strict happier
justjanne Jun 19, 2023
130900b
Make ts-strict happier
justjanne Jun 19, 2023
f878d32
chore: fixed lint issues
justjanne Jun 19, 2023
a814b86
update beta card
justjanne Jun 20, 2023
1bc7925
Fix issue with the user settings test
justjanne Jun 20, 2023
e96793f
chore: fixed lint issues
justjanne Jun 20, 2023
5f2801a
Add tests for notification settings
justjanne Jun 22, 2023
973f7f4
chore: fixed lint issues
justjanne Jun 22, 2023
d1d11de
fix: spurious text failures
justjanne Jun 22, 2023
c0184c0
improve tests further
justjanne Jun 22, 2023
135b16e
make ts-strict happier
justjanne Jun 22, 2023
7bf33eb
improve tests further
justjanne Jun 22, 2023
98bc556
Reduce uncovered conditions
justjanne Jun 22, 2023
e0a77c0
Correct snapshot
justjanne Jun 22, 2023
3a5d6f5
even more test coverage
justjanne Jun 22, 2023
103568e
Merge remote-tracking branch 'origin/develop' into justjanne/feat/wip…
justjanne Jun 26, 2023
713033c
Fix an issue with inverted rules
justjanne Jun 26, 2023
05f3697
Update res/css/views/settings/tabs/_SettingsIndent.pcss
justjanne Jun 26, 2023
6d05986
Fix license headers
justjanne Jun 26, 2023
57cdecb
Improve i18n
justjanne Jun 26, 2023
6085e1f
make linters happier
justjanne Jun 26, 2023
c2d8475
Improve beta labels
justjanne Jun 26, 2023
b84896a
improve i18n
justjanne Jun 26, 2023
d1c463d
chore: fixed lint issues
justjanne Jun 26, 2023
a34e19b
fix: more lint issues
justjanne Jun 26, 2023
0fca15b
Update snapshots to match changed text
justjanne Jun 26, 2023
ef5293b
Merge branch 'develop' into justjanne/feat/wip-notification-settings
justjanne Jun 26, 2023
ab230c4
Merge branch 'develop' into justjanne/feat/wip-notification-settings
justjanne Jun 26, 2023
e495f90
Merge branch 'develop' into justjanne/feat/wip-notification-settings
justjanne Jun 27, 2023
6cb6223
Update text as requested
justjanne Jun 28, 2023
aa87d4a
Remove labs image
justjanne Jun 28, 2023
eb1e76d
Update snapshots
justjanne Jun 28, 2023
30cf557
Correct an issue with one of the tests
justjanne Jun 28, 2023
50d71ca
fix: keyword reconcilation code
justjanne Jun 28, 2023
adb1495
Determine mute status more accurately
justjanne Jun 28, 2023
ccd2cbd
Address review comments
justjanne Jun 28, 2023
2d07518
Prevent duplicate updates
justjanne Jun 28, 2023
6d27492
Fix missing license header
justjanne Jun 28, 2023
2623497
slight change to avoid ts-strict complaining
justjanne Jun 28, 2023
abebafb
Merge remote-tracking branch 'origin/develop' into justjanne/feat/wip…
justjanne Jun 29, 2023
bbc82b0
fix test issue caused by previous merge
justjanne Jun 29, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions res/css/_components.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@
@import "./views/settings/_JoinRuleSettings.pcss";
@import "./views/settings/_KeyboardShortcut.pcss";
@import "./views/settings/_LayoutSwitcher.pcss";
@import "./views/settings/_NotificationSettings2.pcss";
@import "./views/settings/_Notifications.pcss";
@import "./views/settings/_PhoneNumbers.pcss";
@import "./views/settings/_ProfileSettings.pcss";
Expand All @@ -332,6 +333,8 @@
@import "./views/settings/_SpellCheckLanguages.pcss";
@import "./views/settings/_ThemeChoicePanel.pcss";
@import "./views/settings/_UpdateCheckButton.pcss";
@import "./views/settings/tabs/_SettingsBanner.pcss";
@import "./views/settings/tabs/_SettingsIndent.pcss";
@import "./views/settings/tabs/_SettingsSection.pcss";
@import "./views/settings/tabs/_SettingsTab.pcss";
@import "./views/settings/tabs/room/_NotificationSettingsTab.pcss";
Expand Down
96 changes: 96 additions & 0 deletions res/css/views/settings/_NotificationSettings2.pcss
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
/*
Copyright 2023 The Matrix.org Foundation C.I.C.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

.mx_NotificationSettings2 {
justjanne marked this conversation as resolved.
Show resolved Hide resolved
.mx_SettingsSection_subSections {
color: $primary-content;
gap: 32px;
display: flex;
flex-direction: column;
}

.mx_SettingsSubsection_description {
margin-bottom: 20px;

.mx_SettingsSubsection_text {
font-size: 1.2rem;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this here? It makes the descriptions look rather silly:
image


.mx_NotificationBadge {
vertical-align: baseline;
display: inline-flex;
margin: 0 2px;
}
}
}

.mx_SettingsSubsection_content {
margin-top: 12px;
grid-gap: 12px;
justify-items: stretch;
justify-content: stretch;
}

.mx_SettingsBanner {
margin-bottom: 32px;
}

.mx_NotificationSettings2_flags {
grid-gap: 4px;
}

.mx_StyledRadioButton_content {
margin-left: 10px;
margin-right: 10px;
}

.mx_TagComposer {
margin-top: 16px;

&.mx_TagComposer_disabled {
opacity: 0.7;
}

.mx_TagComposer_tags {
margin-top: 16px;
gap: 8px;

.mx_Tag {
border-radius: 18px;
line-height: 2.4rem;
padding: 6px 12px;
background: $panel-actions;
margin: 0;

.mx_Tag_delete {
background: $tertiary-content;
color: #fff;
align-self: initial;
}
}
}
}
}

.mx_NotificationPusherSettings {
justjanne marked this conversation as resolved.
Show resolved Hide resolved
.mx_NotificationPusherSettings_description {
color: $primary-content;
}

.mx_NotificationPusherSettings_detail {
margin-top: -4px;
margin-bottom: 12px;
}
}
35 changes: 35 additions & 0 deletions res/css/views/settings/tabs/_SettingsBanner.pcss
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
Copyright 2023 The Matrix.org Foundation C.I.C.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

.mx_SettingsBanner {
justjanne marked this conversation as resolved.
Show resolved Hide resolved
background: $system;
line-height: 2.25rem;
border-radius: 8px;
padding: 12px 16px;
gap: 12px;
display: flex;
flex-direction: row;
align-items: center;

.mx_SettingsBanner_content {
margin: 0;
}

.mx_AccessibleButton {
align-self: initial;
white-space: nowrap;
}
}
22 changes: 22 additions & 0 deletions res/css/views/settings/tabs/_SettingsIndent.pcss
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
Copyright 2023 The Matrix.org Foundation C.I.C.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

.mx_SettingsIndent {
justjanne marked this conversation as resolved.
Show resolved Hide resolved
padding-left: 16px;
display: flex;
flex-direction: column;
gap: 12px;
}
4 changes: 4 additions & 0 deletions res/img/element-icons/new-and-improved.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 5 additions & 5 deletions src/components/views/elements/Tag.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2022 The Matrix.org Foundation C.I.C.
Copyright 2022-2023 The Matrix.org Foundation C.I.C.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -14,21 +14,21 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

import React from "react";
import React, { DetailedHTMLProps, HTMLAttributes } from "react";

import AccessibleButton from "./AccessibleButton";
import { Icon as CancelRounded } from "../../../../res/img/element-icons/cancel-rounded.svg";

interface IProps {
interface IProps extends DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement> {
icon?: () => JSX.Element;
label: string;
onDeleteClick?: () => void;
disabled?: boolean;
}

export const Tag: React.FC<IProps> = ({ icon, label, onDeleteClick, disabled = false }) => {
export const Tag: React.FC<IProps> = ({ icon, label, onDeleteClick, disabled = false, ...other }) => {
return (
<div className="mx_Tag">
<div className="mx_Tag" {...other}>
{icon?.()}
{label}
{onDeleteClick && (
Expand Down
14 changes: 11 additions & 3 deletions src/components/views/elements/TagComposer.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2021 The Matrix.org Foundation C.I.C.
Copyright 2021-2023 The Matrix.org Foundation C.I.C.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -14,6 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

import classNames from "classnames";
import React, { ChangeEvent, FormEvent } from "react";

import Field from "./Field";
Expand All @@ -22,6 +23,7 @@ import AccessibleButton from "./AccessibleButton";
import { Tag } from "./Tag";

interface IProps {
id?: string;
tags: string[];
onAdd: (tag: string) => void;
onRemove: (tag: string) => void;
Expand Down Expand Up @@ -67,9 +69,14 @@ export default class TagComposer extends React.PureComponent<IProps, IState> {

public render(): React.ReactNode {
return (
<div className="mx_TagComposer">
<div
className={classNames("mx_TagComposer", {
mx_TagComposer_disabled: this.props.disabled,
})}
>
<form className="mx_TagComposer_input" onSubmit={this.onAdd}>
<Field
id={this.props.id ? this.props.id + "_field" : undefined}
value={this.state.newTag}
onChange={this.onInputChange}
label={this.props.label || _t("Keyword")}
Expand All @@ -81,13 +88,14 @@ export default class TagComposer extends React.PureComponent<IProps, IState> {
{_t("Add")}
</AccessibleButton>
</form>
<div className="mx_TagComposer_tags">
<div className="mx_TagComposer_tags" role="list">
{this.props.tags.map((t, i) => (
<Tag
label={t}
key={t}
onDeleteClick={this.onRemove.bind(this, t)}
disabled={this.props.disabled}
role="listitem"
/>
))}
</div>
Expand Down
Loading
Loading