Skip to content

Commit

Permalink
Merge branch 'develop' into feature/LWS-261-prevent-newlines-extension
Browse files Browse the repository at this point in the history
  • Loading branch information
johanbissemattsson authored Nov 14, 2024
2 parents 4663bd7 + 8a2431e commit 891ab1a
Show file tree
Hide file tree
Showing 22 changed files with 180 additions and 71 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/codemirror-lang-lxlquery.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: codemirror-lang-lxlquery
on:
push:
branches: [develop]
paths:
- 'packages/codemirror-lang-lxlquery/**'
pull_request:
branches: [develop]
paths:
- 'packages/codemirror-lang-lxlquery/**'
jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./packages/codemirror-lang-lxlquery
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
- name: Install dependencies
run: npm ci
- name: Run tests
run: npm run test
8 changes: 8 additions & 0 deletions .github/workflows/lxl-web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,16 @@ name: lxl-web
on:
push:
branches: [develop]
paths:
- 'lxl-web/**'
- 'lxljs/**'
- 'packages/**'
pull_request:
branches: [develop]
paths:
- 'lxl-web/**'
- 'lxljs/**'
- 'packages/**'
jobs:
test:
timeout-minutes: 60
Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/supersearch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: supersearch
on:
push:
branches: [develop]
paths:
- 'packages/supersearch/**'
pull_request:
branches: [develop]
paths:
- 'packages/supersearch/**'
jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./packages/supersearch
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
- name: Install dependencies
run: npm ci
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Run Playwright tests
run: npm run test
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: playwright-report
path: playwright-report/
retention-days: 30
47 changes: 35 additions & 12 deletions cataloging/src/components/care/bulk-changes.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import MergeSpec from '@/components/care/merge-spec.vue';
import Preview from '@/components/care/preview.vue';
import BulkChangesHeader from "@/components/care/bulk-changes-header.vue";
import { mapGetters } from 'vuex';
import { cloneDeep, get, isEmpty, isEqual } from 'lodash-es';
import { cloneDeep, get, isEmpty, isEqual, pickBy } from 'lodash-es';
import toolbar from "@/components/inspector/bulkchange-toolbar.vue";
import { labelByLang, translatePhrase } from "@/utils/filters.js";
import * as LayoutUtil from '@/utils/layout';
Expand All @@ -29,12 +29,14 @@ import {
Status,
TARGET_FORM_KEY,
VALUE_FROM_KEY,
Type
Type, EXECUTION_KEY
} from "@/utils/bulk.js";
import EntityForm from "@/components/inspector/entity-form.vue";
export default {
name: 'bulk-changes.vue',
components: {
EntityForm,
ReverseRelations,
Inspector,
toolbar,
Expand Down Expand Up @@ -79,6 +81,7 @@ export default {
idListUri: '',
idListTempPath: '',
currentPreviewUrl: null,
initializingPreview: false,
};
},
computed: {
Expand Down Expand Up @@ -224,6 +227,13 @@ export default {
specType() {
return this.currentSpec['@type'];
},
executionData() {
return pickBy(
this.currentBulkChange || {}, function (_, key) {
return ['@type', EXECUTION_KEY].includes(key);
}
);
},
isInitialized() {
return !isEmpty(this.currentSpec) && typeof this.currentSpec !== 'undefined';
}
Expand Down Expand Up @@ -318,6 +328,12 @@ export default {
value: 'start-edit',
});
}
if (this.isReady) {
this.setActive('preview');
setTimeout(() => {
this.triggerRunBulkChange();
}, 1000);
}
DataUtil.fetchMissingLinkedToQuoted(this.currentBulkChange, this.$store);
this.getPreview(fnurgel);
this.isSaving = false;
Expand Down Expand Up @@ -442,6 +458,7 @@ export default {
this.saveBulkChange();
},
getPreview(fnurgel) {
this.initializingPreview = true;
const baseUri = this.settings.dataPath;
const offset = 0;
const limit = 1;
Expand All @@ -451,8 +468,6 @@ export default {
getPreviewFromUrl(fetchUrl) {
this.currentPreviewUrl = fetchUrl;
fetch(fetchUrl).then((response) => response.json()).then((result) => {
// const agents = (this.changeSets || []).map((c) => c.agent).filter((a) => a);
// DataUtil.fetchMissingLinkedToQuoted(agents, this.$store);
// Form preview
if (typeof result.changeSets !== 'undefined') {
Expand Down Expand Up @@ -482,7 +497,6 @@ export default {
} else {
this.completePreview = true;
}
if (this.totalItems === 0 || typeof this.totalItems === 'undefined') {
this.resetPreviewData();
return;
Expand Down Expand Up @@ -515,6 +529,10 @@ export default {
DataUtil.fetchMissingLinkedToQuoted(this.fullPreviewData, this.$store);
this.loadingPreview.next = false;
this.loadingPreview.previous = false;
this.initializingPreview = false;
}, (error) => {
this.initializingPreview = false;
console.error('Failed to fetch preview', error);
});
},
async triggerRunBulkChange() {
Expand Down Expand Up @@ -575,6 +593,7 @@ export default {
this.fullPreview = {};
this.fullPreviewData = {};
this.fullPreviewDiff = {};
this.initializingPreview = false;
},
async saveBulkChange() {
try {
Expand Down Expand Up @@ -640,13 +659,6 @@ export default {
this.fetchRecord(this.documentId);
this.warnOnSave();
}
if (this.isReady) {
this.setActive('preview');
this.triggerRunBulkChange();
setTimeout(() => {
this.triggerRunBulkChange();
}, 5000);
}
this.$nextTick(() => {
this.$store.dispatch('setInspectorStatusValue', { property: 'saving', value: false });
this.$store.dispatch('setInspectorStatusValue', { property: 'isNew', value: false });
Expand Down Expand Up @@ -825,6 +837,7 @@ export default {
:total-items="totalItems"
:finished="isFinished"
:has-unsaved="hasUnsavedChanges"
:initializing-preview="initializingPreview"
@onActive="focusPreview"
/>
</div>
Expand Down Expand Up @@ -855,6 +868,16 @@ export default {
</div>
</div>
<div>
<entity-form
:editing-object="'mainEntity'"
:is-active="true"
:form-data="executionData"
:locked="true"
:hide-top-level-properties="['@type']"
:hide-top-level-field-names="true"
/>
</div>
<div>
<!-- SPECIFICATION-->
<!-- <pre>{{ this.currentBulkChange }}</pre>-->
<!-- ENTITY FORM-->
Expand Down
45 changes: 27 additions & 18 deletions cataloging/src/components/care/preview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@ import {isEmpty} from 'lodash-es';
import ItemEntity from "@/components/inspector/item-entity.vue";
import EntitySummary from "@/components/shared/entity-summary.vue";
import {translatePhrase} from "@/utils/filters.js";
import * as StringUtil from "../../../../lxljs/string.js";
import { Status, Type } from "@/utils/bulk.js";
import Spinner from "../shared/spinner.vue";
export default {
name: 'preview',
components: {EntitySummary, ItemEntity, EntityForm },
components: {Spinner, EntitySummary, ItemEntity, EntityForm },
data() {
return {
selected: true,
Expand Down Expand Up @@ -54,6 +53,10 @@ export default {
type: Boolean,
default: true,
},
initializingPreview: {
type: Boolean,
default: false
}
},
computed: {
...mapGetters([
Expand Down Expand Up @@ -118,22 +121,28 @@ export default {
{{ this.title }}
</div>
<div class="Preview-body" :class="{ 'has-selection': isActive }">
<span class="Preview-affected Breadcrumb-recordNumbers">{{ this.noHitsLabel }} <i class="fa fa-fw fa-circle-o-notch fa-spin" v-show="!complete" /></span>
<div class="Preview-preview" v-if="showPreview">
<div class="Preview-preview-heading">
<entity-summary
:focus-data="previewData"
:should-link="false"
:exclude-components="['details']"/>
<div class="PanelComponent-searchStatus" v-show="initializingPreview">
<Spinner :message="translatePhrase('Fetching preview')" />
</div>
<div v-if="!this.initializingPreview">
<span class="Preview-affected Breadcrumb-recordNumbers">{{ this.noHitsLabel }} <i
class="fa fa-fw fa-circle-o-notch fa-spin" v-show="!complete"/></span>
<div class="Preview-preview" v-if="showPreview">
<div class="Preview-preview-heading">
<entity-summary
:focus-data="previewData"
:should-link="false"
:exclude-components="['details']"/>
</div>
<entity-form
:editing-object="'mainEntity'"
:key="formTab.id"
:is-active="true"
:diff="previewDiff"
:form-data="previewData"
:locked="true"
/>
</div>
<entity-form
:editing-object="'mainEntity'"
:key="formTab.id"
:is-active="true"
:diff="previewDiff"
:form-data="previewData"
:locked="true"
/>
</div>
</div>
</div>
Expand Down
22 changes: 10 additions & 12 deletions cataloging/src/components/inspector/bulkchange-toolbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,12 @@ export default {
case 'previous':
this.previous();
break;
case 'next-preview':
this.nextPreview();
break;
case 'previous-preview':
this.previousPreview();
break;
case 'undo':
this.undo();
break;
Expand Down Expand Up @@ -185,14 +191,6 @@ export default {
'settings',
'status',
]),
allowed() {
return VocabUtil.getPropertiesFromArray(
this.formObj['@type'],
this.resources.vocabClasses,
this.resources.vocabProperties,
this.resources.context,
);
},
showRecord() {
return this.status.showRecord;
},
Expand Down Expand Up @@ -296,8 +294,8 @@ export default {
v-if="lastItemActive && !finished"
class="Toolbar-btn btn btn-default toolbar-button"
:disabled="!hasNext"
v-tooltip.left="`${translatePhrase('Next')} (${getKeybindText('next')})`"
@click="nextPreview"
v-tooltip.left="`${translatePhrase('Next')} (${getKeybindText('next-preview')})`"
@click="formControl('next-preview')"
:aria-label="translatePhrase('Next')">
<i class="fa fa-fw fa-circle-o-notch fa-spin" v-show="loadingPreview.next" />
<i class="fa fa-arrow-right" v-show="!loadingPreview.next" />
Expand All @@ -306,8 +304,8 @@ export default {
v-if="lastItemActive && !finished"
class="Toolbar-btn btn btn-default toolbar-button"
:disabled="!hasPrevious"
v-tooltip.left="`${translatePhrase('Previous')} (${getKeybindText('previous')})`"
@click="previousPreview"
v-tooltip.left="`${translatePhrase('Previous')} (${getKeybindText('previous-preview')})`"
@click="formControl('previous-preview')"
:aria-label="translatePhrase('Previous')">
<i class="fa fa-fw fa-circle-o-notch fa-spin" v-show="loadingPreview.previous" />
<i class="fa fa-arrow-left" v-show="!loadingPreview.previous" />
Expand Down
5 changes: 5 additions & 0 deletions cataloging/src/components/inspector/entity-form.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ export default {
type: Boolean,
default: false,
},
hideTopLevelFieldNames: {
type: Boolean,
default: false,
},
},
data() {
return {
Expand Down Expand Up @@ -159,6 +163,7 @@ export default {
:field-value="v"
:parent-path="editingObject"
:showBulkchangeActions="showBulkchangeActions"
:show-key="!hideTopLevelFieldNames"
/>
<div id="result" v-if="user.settings.appTech && !isLocked">
<pre class="col-md-12">
Expand Down
Loading

0 comments on commit 891ab1a

Please sign in to comment.