Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Features Icons in features panel #284

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

Open
LiranCaduri wants to merge 172 commits into PythonFreeCourse:develop
base: develop
Choose a base branch
Loading
from LiranCaduri:feature/feature-icon

Conversation

Copy link
Contributor

@LiranCaduri LiranCaduri commented Feb 14, 2021
edited
Loading

Icons for Features in Feature Panel.

The icons provided by Ionicons.

With every change to Feature Panel branch this branch will update as well.

Please comment on icons related things only.
if you want to comment on features panel related things there is a PR for that.

Thank you all!

FRONT (by @aviadamar):

  • Adding a Feature.html page.
  • Managing Add and remove features from panel using JS.
  • Adding a feature search box for feature panel.
  • CSS & HTML bug fixing and changes in calendar/month view.

This panel allows you to view optional add-ons. Add, remove or customize features to your liking by clicking on the features icon in the navigation bar.

...tests according to the new objects, Changing front to get information from Day objects, Re-arranging calendar.html grid stracture to be render by weeks, adding js functionality for day view section, adding css effects on daily event display
Copy link
Member

@yammesicka yammesicka left a comment

Choose a reason for hiding this comment

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

Where are all the tests? :)

LiranCaduri reacted with thumbs up emoji
Copy link
Contributor Author

Where are all the tests? :)

Tests are included and modified in the test_feature_panel.py, because it's an extension to the features panel :)

Comment on lines +104 to +108
if (!infoBox.classList.contains('info-box')) {
infoBox.classList.add('info-box');
} else {
infoBox.classList.remove('info-box');
}
Copy link
Member

@yammesicka yammesicka Feb 26, 2021

Choose a reason for hiding this comment

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

classList.toggle

@@ -116,7 +126,7 @@ async def is_access_allowd(request: Request, route: str) -> bool:
& (UserFeature.user_id == user.user_id),
),
).scalar()

print(user_feature)
Copy link
Member

@yammesicka yammesicka Mar 30, 2021

Choose a reason for hiding this comment

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

Remove

content='No additional settings for this one :)')

template = templates.get_template(
"partials/features_panels/" + template + '.html'
Copy link
Member

@yammesicka yammesicka Mar 30, 2021

Choose a reason for hiding this comment

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

Use fstrings & precommit hooks

@@ -384,6 +404,8 @@ main {
color: var(--primary);
}

.text-red {color: var(--negative)}
Copy link
Member

@yammesicka yammesicka Mar 30, 2021

Choose a reason for hiding this comment

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

Use prettify

Comment on lines +5 to +9
if (elementsArray.includes(row)) {
return row.classList.remove("invisible");
} else {
return row.classList.add("invisible");
}
Copy link
Member

@yammesicka yammesicka Mar 30, 2021

Choose a reason for hiding this comment

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

Use classList.toggle

function searchFeature(searchValue, elements) {
const elementsArray = Array.from(elements);
const result = elementsArray.filter(element => {
return element.getElementsByClassName("row-feature-name")[0].innerHTML.toLowerCase().includes(searchValue);
Copy link
Member

@yammesicka yammesicka Mar 30, 2021

Choose a reason for hiding this comment

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

  1. Prefer innerText
  2. Split to lines

Comment on lines +24 to +33
'input', function (evt) {
const rows = document.getElementsByClassName("feature-row");
const value = evt.target.value.trim().toLowerCase();
if (!value) {
Array.from(rows).map(element => element.classList.remove("invisible"));
} else {
const result = searchFeature(value, rows);
displayResult(rows, result);
}
});
Copy link
Member

@yammesicka yammesicka Mar 30, 2021

Choose a reason for hiding this comment

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

Export the function to external function

Comment on lines +64 to +67
if (action === "ADD") {
return new URL('/features/add', url);
}
return new URL('/features/delete', url);
Copy link
Member

@yammesicka yammesicka Mar 30, 2021

Choose a reason for hiding this comment

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

Move all the strings here to be constants


function appandFeatures(){
const baseURL = window.location.origin;
const route = new URL('/features/installed', baseURL);
Copy link
Member

@yammesicka yammesicka Mar 30, 2021

Choose a reason for hiding this comment

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

String should be a const

@@ -1,8 +1,9 @@
import pytest
Copy link
Member

@yammesicka yammesicka Mar 30, 2021

Choose a reason for hiding this comment

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

Please add tests to achieve 100% coverage for this feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@yammesicka yammesicka yammesicka requested changes

+2 more reviewers

@ivarshav ivarshav ivarshav left review comments

@PureDreamer PureDreamer PureDreamer left review comments

Reviewers whose approvals may not affect merge requirements
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /