Skip to content
Snippets Groups Projects
Commit 48db560f authored by dcz's avatar dcz
Browse files

Bugfix: problem with unified frame list reloading on filtering exec

parent a4797823
No related branches found
No related tags found
No related merge requests found
......@@ -624,12 +624,16 @@ class UnifiedFrameFormFactory(FormFactory):
field_makers = (
(
'status',
lambda: ModelMultipleChoiceFilter(
lambda: MultipleChoiceFilter(
label=_('Status'),
queryset=UnifiedFrame.objects.distinct(),
key='status',
choices=(
(UnifiedFrameStatus.PROCESSING, (_('W obróbce'), None)),
(UnifiedFrameStatus.READY, (_('Gotowe'), None)),
(UnifiedFrameStatus.VERIFIED, (_('Sprawdzone'), None)),
),
lookup='status',
), None,
),
None,
),
(
None, None,
......
......@@ -1090,7 +1090,7 @@ function initialize_entries_list() {
function getRoles() {
$.ajax({
dataType: "json",
url: 'roles',
url: '/' + lang + '/entries/roles',
success: function(data){
roles = data.roles;
},
......@@ -1101,7 +1101,7 @@ function getRoles() {
function getRoleAttributes() {
$.ajax({
dataType: "json",
url: 'role_attributes',
url: '/' + lang + '/entries/role_attributes',
success: function(data){
role_attributes = data.role_attributes;
},
......@@ -1136,9 +1136,9 @@ $(document).ready(function() {
// getPredefinedSelections();
// getRoles();
//
// getRoleAttributes();
getRoles();
getRoleAttributes();
// $.getJSON('relations', function(data){
// memorizeRelations(data.relations);
......
function update_entries() {
function update_entries2() {
var datatable = setup_datatable({
element: $("#entries-table"),
selectFirst: true,
......
......@@ -19,7 +19,8 @@ function setup_frames_list(options) {
can_see_assignees ? { data: 'assignee_username' } : { render: is_assigned_to_user_renderer },
{ data: 'id' },
],
hidden_columns: can_see_assignees ? [3] : [2,3]
hidden_columns: can_see_assignees ? [3] : [2,3],
selectEntryId: options.selectEntryId,
});
datatable.on('click', 'tr.entry', function () {
const data = datatable.row(this).data();
......
......@@ -10,7 +10,7 @@
// TODO: reload data and click in selected row
// this.datatableObject.ajax.reload();
setup_entries_list({
table: this.$refs.table,
table: this.$refs.entriestable,
lexicalUnitSelected: (entryId, lexicalUnitId) => { this.$emit('lexicalUnitSelected', entryId, lexicalUnitId); },
selectEntryId: this.initialEntryId,
secondarySelectEntryId: this.initialLexicalUnitId,
......@@ -27,7 +27,7 @@
reset_list() {
this.$emit('lexicalUnitSelected', null, null);
setup_entries_list({
table: this.$refs.table,
table: this.$refs.entriestable,
lexicalUnitSelected: (entryId, lexicalUnitId) => { this.$emit('lexicalUnitSelected', entryId, lexicalUnitId); },
});
}
......@@ -36,7 +36,7 @@
mounted () {
this.$.appContext.config.globalProperties.$entries_list = this;
setup_entries_list({
table: this.$refs.table,
table: this.$refs.entriestable,
lexicalUnitSelected: (entryId, lexicalUnitId) => { this.$emit('lexicalUnitSelected', entryId, lexicalUnitId); },
selectEntryId: this.initialEntryId
});
......@@ -45,7 +45,7 @@
</script>
<template>
<table ref="table" class="table table-sm text-dark">
<table ref="entriestable" class="table table-sm text-dark">
<thead>
<tr>
<th class="p-1">{{ gettext('Lemat') }}</th>
......
......@@ -14,7 +14,7 @@ export default {
reset_list() {
this.$emit('unifiedFrameSelected', null);
setup_frames_list({
table: this.$refs.table,
table: this.$refs.framestable,
unifiedFrameSelected: (unifiedFrameId) => {
this.$emit('unifiedFrameSelected', unifiedFrameId);
},
......@@ -27,7 +27,7 @@ export default {
// TODO: reload data and click in selected row
// this.datatableObject.ajax.reload();
setup_frames_list({
table: this.$refs.table,
table: this.$refs.framestable,
unifiedFrameSelected: (unifiedFrameId) => {
this.$emit('unifiedFrameSelected', unifiedFrameId);
},
......@@ -39,7 +39,7 @@ export default {
mounted() {
this.$.appContext.config.globalProperties.$entries_list = this;
setup_frames_list({
table: this.$refs.table,
table: this.$refs.framestable,
unifiedFrameSelected: (unifiedFrameId) => {
this.$emit('unifiedFrameSelected', unifiedFrameId);
},
......@@ -50,12 +50,12 @@ export default {
</script>
<template>
<table ref="table" class="table table-sm table-hover text-dark">
<table ref="framestable" class="table table-sm table-hover text-dark">
<thead>
<tr>
<th class="p-1">{{ gettext('Rama') }}</th>
<th class="p-1">{{ gettext('Status') }}</th>
<th v-if="canViewAssignment" class="p-1">{{ gettext('Leksykograf') }}</th>
<th class="p-1">{{ gettext('Leksykograf') }}</th>
<th class="p-1" hidden="true">{{ gettext('Id') }}</th>
</tr>
</thead>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment