Skip to content

Commit

Permalink
Ready for PR
Browse files Browse the repository at this point in the history
  • Loading branch information
CarliPinell committed Oct 8, 2024
1 parent 3388ed5 commit 67cfe84
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
19 changes: 16 additions & 3 deletions src/components/inspector/collection-records-list.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,12 @@
/>
</div>
<div v-if="collectionId > 0" class="screen-link mt-2">
<a :href="`/collections/${collectionId}`" target="_blank">
{{ $t("Open Collection") }}
<a
:href="`/designer/screen-builder/${
screenMode === 'display' ? idCollectionScreenView : idCollectionScreenEdit
}/edit`"
target="_blank">
{{ $t(screenMode === 'display' ? "Open View Screen" : "Open Edit Screen") }}
<i class="ml-1 fas fa-external-link-alt" />
</a>
</div>
Expand Down Expand Up @@ -42,7 +46,10 @@ export default {
collectionId: null,
pmql: "",
unique: false,
dataRecordList: []
dataRecordList: [],
idCollectionScreenView: null,
idCollectionScreenEdit: null,
screenMode: null
};
},
computed: {
Expand Down Expand Up @@ -87,6 +94,9 @@ export default {
if (this.collectionId) {
this.getFields();
}
this.$root.$on("collection-screen-mode", (mode) => {
this.screenMode = mode;
});
},
methods: {
onCollectionChange() {
Expand All @@ -99,6 +109,9 @@ export default {
},
getCollections() {
this.$dataProvider.getCollections().then((response) => {
const [firstItem = {}] = response.data.data || [];
this.idCollectionScreenView = firstItem.read_screen_id;
this.idCollectionScreenEdit = firstItem.create_screen_id;
this.collections = [
{ value: null, text: this.$t("Select a collection") },
...response.data.data.map((collection) => {
Expand Down
1 change: 1 addition & 0 deletions src/components/renderer/form-collection-view-control.vue
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ export default {
collection(collection) {
if(collection) {
this.selCollectionId = collection.collectionId;
this.$root.$emit("collection-screen-mode", "display");
}
},
record(record) {
Expand Down

0 comments on commit 67cfe84

Please sign in to comment.