Skip to content

Commit

Permalink
Update opensource
Browse files Browse the repository at this point in the history
  • Loading branch information
kmmbvnr committed Nov 26, 2021
1 parent 92e36d0 commit 28986d2
Show file tree
Hide file tree
Showing 22 changed files with 261 additions and 150 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Viewflow comes in two flavors:

## Installation

Viewflow works with Python 3.7 or greater and Django 3.1+
Viewflow works with Python 3.7 or greater and Django 3.2+

Viewflow:

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

setuptools.setup(
name='django-viewflow',
version='2.0.0a0',
version='2.0.0a2',
author_email='[email protected]',
author='Mikhail Podgurskiy',
description="Reusable library to build business applications fast",
Expand Down
58 changes: 31 additions & 27 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py{37}-dj{31}
envlist = py{37}-dj{32}
skipsdist = True

[testenv]
Expand All @@ -8,39 +8,43 @@ commands = {posargs:./manage.py test --exclude-tag=selenium --exclude-tag=integr

deps =
# core dependences
dj31: Django==3.1.6
dj32: Django==3.2a1
django-filter==2.4.0
djangorestframework==3.12.2
pyyaml==5.3.1
uritemplate==3.0.1
dj32: Django==3.2.9
dj40: Django==4.0b1
django-filter==21.1
djangorestframework==3.12.4
pyyaml==6.0
uritemplate==4.1.1

# 3d party integration
celery==5.0.5
django-formtools==2.2
django-guardian==2.3.0
django-redis==4.12.1
django-reversion==3.0.9
django-polymodels==1.6.0
django-allauth==0.44.0
celery==5.2.0
dash==2.0.0

# developement
django-environ==0.4.5
dj-database-url==0.5.0
django-extensions==3.1.0
sentry-sdk==0.19.5
flake8==3.8.3
ipython==7.20.0
ipdb==0.13.4
tblib==1.7.0
django-allauth==0.46.0
django-formtools==2.3
django-guardian==2.4.0
django-import-export==2.6.1
django-polymodels==1.7.0
django-redis==5.0.0
django-reversion==4.0.1

# development
ansible==2.10.6
twine==3.3.0
psycopg2-binary==2.8.6
colorlover==0.3.0
dj-database-url==0.5.0
django_sendmail_backend==0.1.2
selenium==3.141.0
django-environ==0.8.1
django-extensions==3.1.5
flake8==4.0.1
hiredis==2.0.0
html5lib==1.1
ipdb==0.13.4
ipython==7.20.0
numpy==1.21.2
pandas==1.3.3
psycopg2-binary==2.8.6
selenium==3.141.0
sentry-sdk==0.19.5
tblib==1.7.0
twine==3.6.0

# packaging
pyc-wheel==1.2.4
Expand Down
16 changes: 12 additions & 4 deletions viewflow/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
"""Viewflow - dev toolkit for backoffice automation."""
"""Viewflow - The Django extension for perfectionists with yesterday’s deadlines."""

# Copyright (c) 2017-2020, Mikhail Podgurskiy
# All Rights Reserved.

# This work is dual-licensed under AGPL defined in file 'LICENSE' with
# LICENSE_EXCEPTION and the Commercial license defined in file 'COMM_LICENSE',
# which is part of this source code package.

from django.conf import settings as django_settings
from .conf import settings
from .this_object import this
Expand All @@ -21,6 +29,6 @@
site_middleware = 'viewflow.middleware.SiteMiddleware'
if site_middleware not in django_settings.MIDDLEWARE:
django_settings.MIDDLEWARE += (site_middleware, )
turbolinks_middleware = 'viewflow.middleware.TurbolinksMiddleware'
if turbolinks_middleware not in django_settings.MIDDLEWARE:
django_settings.MIDDLEWARE += (turbolinks_middleware, )
turbo_middleware = 'viewflow.middleware.HotwireTurboMiddleware'
if turbo_middleware not in django_settings.MIDDLEWARE:
django_settings.MIDDLEWARE += (turbo_middleware, )
2 changes: 2 additions & 0 deletions viewflow/components/vf-card/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,6 @@
justify-content: flex-end;
padding: 24px;
padding-bottom: 12px;
padding-left: 8px;
padding-top: 32px;
}
7 changes: 4 additions & 3 deletions viewflow/components/vf-field-checkbox/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import {noShadowDOM} from 'component-register';
import {onCleanup, createEffect} from 'solid-js';
import {onCleanup, createEffect} from 'solid-js';
import {customElement} from 'solid-element';
import {MDCCheckbox} from '@material/checkbox';
import cc from 'classcat';
Expand All @@ -23,7 +22,9 @@ const VCheckboxField = customElement('vf-field-checkbox', defaultProps, (props,
let control;
let checkbox;

noShadowDOM(element);
Object.defineProperty(element, 'renderRoot', {
value: element,
});

createEffect(() => {
checkbox = new MDCCheckbox(control);
Expand Down
13 changes: 11 additions & 2 deletions viewflow/components/vf-field-input/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import {customElement} from 'solid-element';
import {MDCTextField} from '@material/textfield';
import {noShadowDOM} from 'component-register';
import {onCleanup, createEffect} from 'solid-js';
import cc from 'classcat';

Expand Down Expand Up @@ -48,6 +47,13 @@ export const Input = (props) => {
});
});

createEffect(() => {
props.value;
if (textfield) {
textfield.layout();
}
});

onCleanup(() => {
textfield.destroy();
});
Expand Down Expand Up @@ -90,6 +96,7 @@ export const Input = (props) => {
required={ !!props.required }
step = { props.step }
type={ props.type }
tabindex={ props.tabIndex }
value={ props.value }
aria-labelledby={ props.id + '_label' }
oninput={props.onInput}
Expand Down Expand Up @@ -119,7 +126,9 @@ export const Input = (props) => {
};

const VInputField = customElement('vf-field-input', defaultProps, (props, {element}) => {
noShadowDOM(element);
Object.defineProperty(element, 'renderRoot', {
value: element,
});

return (
<div class="vf-field__row">
Expand Down
9 changes: 6 additions & 3 deletions viewflow/components/vf-field-password/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import {customElement} from 'solid-element';
import {createState} from 'solid-js';
import {noShadowDOM} from 'component-register';
import {Input, HelpText} from '../vf-field-input';
import './index.scss';

Expand All @@ -28,18 +27,22 @@ const VPasswordField = customElement('vf-field-password', defaultProps, (props,
'visible': props.type !== 'password',
});

noShadowDOM(element);
Object.defineProperty(element, 'renderRoot', {
value: element,
});

const onBtnClick = (event) => {
event.preventDefault();
setState({'visible': !state.visible});
};

const inputType = () => state.visible ? 'text': 'password';

return (
<div class="vf-field__row">
<Input
{...props}
type={() => state.visible ? 'text': 'password'}
type={inputType()}
trailingButton={() => state.visible ? 'visibility' : 'visibility_off'}
onTrailingButtonClick={onBtnClick}/>
{ props.helpText || props.error ? <HelpText {...props}/> : '' }
Expand Down
5 changes: 3 additions & 2 deletions viewflow/components/vf-field-radio-select/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import {noShadowDOM} from 'component-register';
import {customElement} from 'solid-element';
import cc from 'classcat';

Expand All @@ -20,7 +19,9 @@ const defaultProps = {


const VRadioSelectField = customElement('vf-field-radio-select', defaultProps, (props, {element}) => {
noShadowDOM(element);
Object.defineProperty(element, 'renderRoot', {
value: element,
});

const items = (props) => {
const items = [];
Expand Down
6 changes: 3 additions & 3 deletions viewflow/components/vf-field/jhtml.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class DOMBuilder {
element.textContent = this.textContent;
}

for (let attr in this.attrs) {
for (const attr in this.attrs) {
if (this.attrs.hasOwnProperty(attr)) {
let value = this.attrs[attr];

Expand All @@ -54,8 +54,8 @@ class DOMBuilder {
}
} else if (! (typeof(value) === 'string' || typeof(value) === 'number')) {
// join hash key if enabled
let valuesList = [];
for (let key in value) {
const valuesList = [];
for (const key in value) {
if (value.hasOwnProperty(key)) {
const keyValue = value[key];
if (keyValue) {
Expand Down
15 changes: 15 additions & 0 deletions viewflow/components/vf-page/_menu.scss
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,21 @@
>i.material-icons {
color: inherit;
}

margin-left: 8px;
margin-right: 8px;
padding-left: 8px;
padding-right: 8px;

&::before {
background: #3f51b5;
background: var(--mdc-theme-primary, #3f51b5);
opacity: 0.1;
content: " ";
width: 100%;
height: 100;
position: absolute;
}
}
}

Expand Down
2 changes: 2 additions & 0 deletions viewflow/components/vf-page/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/* eslint-env browser */
import './_grid.scss';
import './_menu.scss';
import './index.scss';

import {drawer, topAppBar} from 'material-components-web';
Expand Down
3 changes: 0 additions & 3 deletions viewflow/components/vf-page/index.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
@import './_grid.scss';
@import './_menu.scss';

html {
height: 100%;
}
Expand Down
Loading

0 comments on commit 28986d2

Please sign in to comment.