Skip to content

Commit

Permalink
fix: DEV-3341: selected=true <Choice> attribute is not supported for …
Browse files Browse the repository at this point in the history
…Taxonomy (#3047)
  • Loading branch information
robot-ci-heartex committed Oct 5, 2022
1 parent 6acc8c7 commit c3fb3f6
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 64 deletions.
24 changes: 13 additions & 11 deletions docs/themes/htx/layout/partials/github_stars.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

<style>
.GitHubStars {
padding: 0 2em;
display: flex;
gap: 0.25em;
align-items: center;
Expand All @@ -30,16 +31,17 @@
</style>

<script>
window.addEventListener('load', async () => {
try {
const response = await fetch("https://api.github.com/repos/heartexlabs/label-studio", {
});
const data = await response.json();
starCount = data.stargazers_count;
const countElement = document.querySelector('.GitHubStarsText');
countElement.innerText = starCount.toLocaleString('en-US');
} catch (err) {
console.log(err);
}
window.addEventListener('load', async () => {
let starCount = 10688
// const response = await fetch("https://api.github.com/repos/heartexlabs/label-studio", {
// headers: {
// Authorization: `token ${import.meta.env.GITHUB_TOKEN}`
// }
// })
// const data = response.json();
// starCount = data.stargazers_count
const countElement = document.querySelector('.GitHubStarsText')
countElement.innerText = starCount.toLocaleString('en-US');
});
</script>
5 changes: 1 addition & 4 deletions docs/themes/htx/source/css/header-footer.css
Original file line number Diff line number Diff line change
Expand Up @@ -284,13 +284,11 @@ body{
}
.mainHeader:where(.astro-7IFFX3A3){
background-color:var(--color-white);
padding:1.5em 0;
position:relative;
z-index:2
}
.Header:where(.astro-7IFFX3A3){
display:flex;
border:1px solid var(--color-gray-900);
position:relative;
min-height:52px;
align-items:center
Expand Down Expand Up @@ -432,13 +430,12 @@ body{
margin-left:initial;
align-items:flex-start;
position:absolute;
top:50px;
top:52px;
left:-1px;
z-index:2;
width:calc(100% + 2px);
background-color:var(--color-white);
border:1px var(--color-gray-900) solid;
border-top-color:var(--color-white);
padding:.5em 1em 1em;
display:none
}
Expand Down
2 changes: 1 addition & 1 deletion docs/themes/htx/source/css/page.styl
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@
position: static
.sidebar
position: fixed
z-index: 0
z-index: 100

@media (max-width: 991px)
.sidebar
Expand Down
18 changes: 0 additions & 18 deletions label_studio/core/mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,3 @@
class DummyModelMixin():
def has_permission(self, user):
return True


class CreateOnlyFieldsMixin:
"""Lets you define fields that are only writeable on create"""
def get_extra_kwargs(self):
extra_kwargs = super().get_extra_kwargs()
if getattr(self.context.get('view'), 'action', '') in ['update', 'partial_update']:
return self._set_create_only_fields(extra_kwargs)
return extra_kwargs

def _set_create_only_fields(self, extra_kwargs):
create_only_fields = getattr(self.Meta, 'create_only_fields', [])
for field_name in create_only_fields:
kwargs = extra_kwargs.get(field_name, {})
kwargs['read_only'] = True
extra_kwargs[field_name] = kwargs

return extra_kwargs
4 changes: 2 additions & 2 deletions label_studio/frontend/dist/dm/version.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"message": "fix: DEV-3492: Load virtual tab data from url key when present",
"message": "fix: DEV-3492: Load virtual tab data from url key when present (#111)\n\n* fix: DEV-3492: Load virtual tab data from url key when present\r\n\r\n* include viewSnapshot in the newSnaphot for view tab data\r\n\r\n* include viewSnapshot in the newSnaphot for view tab data",
"commit": "878c084adfabe0736ab2e9f5ca2d419cf009c7f9",
"branch": "master",
"date": "2022-10-04T14:26:17Z"
}
}
2 changes: 1 addition & 1 deletion label_studio/frontend/dist/lsf/js/main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion label_studio/frontend/dist/lsf/js/main.js.map

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions label_studio/frontend/dist/lsf/version.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"message": "fix: DEV-3377: Region shift on resize (#886)\n\n* fix: DEV-3377: Region shift on resize\r\n\r\n* fix: DEV-3377: Fix zoom position restrictions\r\n\r\n* test: DEV-3377: Reanimate regression tests\r\n\r\n* test: DEV-3377: Add test for zoomed images displaying precision",
"commit": "003dfe97d0d639226811f129fb38f14971d1d3c3",
"message": "fix: DEV-3341: selected=true <Choice> attribute is not supported for Taxonomy",
"commit": "ad7be2f97313192d2cb5028d6cf43a576c1659fe",
"branch": "master",
"date": "2022-10-04T08:33:53Z"
"date": "2022/10/05 06:58:14"
}
15 changes: 0 additions & 15 deletions label_studio/tests/users.tavern.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ stages:
request:
json:
email: test_user@heartextest.com
first_name: Testperson
username: test user
active_organization: !int '{org_pk}'
method: POST
Expand All @@ -44,17 +43,3 @@ stages:
url: '{django_live_url}/api/users/{new_user_pk}'
response:
status_code: 200
- name: stage
request:
method: PATCH
url: '{django_live_url}/api/users/{new_user_pk}'
json:
first_name: Changedname
username: changed username
email: w@heartex.com
response:
status_code: 200
json:
first_name: Changedname
username: test user
email: test_user@heartextest.com
10 changes: 2 additions & 8 deletions label_studio/users/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@
from rest_flex_fields import FlexFieldsModelSerializer
from django.conf import settings

from core.utils.common import load_func
from core.mixins import CreateOnlyFieldsMixin
from .models import User
from core.utils.common import load_func


class BaseUserSerializer(CreateOnlyFieldsMixin, FlexFieldsModelSerializer):
class BaseUserSerializer(FlexFieldsModelSerializer):
# short form for user presentation
initials = serializers.SerializerMethodField(default='?', read_only=True)
avatar = serializers.SerializerMethodField(read_only=True)
Expand Down Expand Up @@ -49,11 +48,6 @@ class Meta:
'allow_newsletters'
)

create_only_fields = [
'username',
'email'
]


class UserSimpleSerializer(BaseUserSerializer):
class Meta:
Expand Down

0 comments on commit c3fb3f6

Please sign in to comment.