Skip to content

Commit

Permalink
AMP-3062:
Browse files Browse the repository at this point in the history
- fix async issue with getting media symlink before loading content file
page
- remove commented code and tmp logs
  • Loading branch information
yingfeng-iu committed Nov 8, 2023
1 parent f0298fd commit 1cf0801
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 30 deletions.
6 changes: 1 addition & 5 deletions src/components/dashboard/DashboardFilters/SearchFilter.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
<template>
<div id="myTable_filter" class="dataTables_filter">
<!-- <label>Search:</label> -->
<!-- <typeahead :source="getItems" filter-key="searchValue" :start-at="1" @selection="addSearchTerm"
filter-type="contains"
id="colFormLabelSearch" class="form-control bootstrap-typeahead" placeholder="Search" :customClass= "'customSearchWidth'"/> -->
<form
<form
@submit="
$event.preventDefault();
onSearchChange();
Expand Down
13 changes: 9 additions & 4 deletions src/components/entity/EntityList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
height="495.4px"
></mediaelement>
</div>
<div class="float-left" v-if="baseUrl === 'file'">
<div class="float-left">
<b-button
v-b-toggle.collapse-1
variant="outline-primary"
Expand Down Expand Up @@ -1360,19 +1360,21 @@ export default {
self.showEdit = false;
}
} else if (self.baseUrl === "file") {
console.log("showLoader = " + self.showLoader);
self.entity = self.selectedFile;
if (self.accessControl._primaryfile_media._read) {
let mediaSourceUrl = await self.workflowResultService.getMediaSymlink(
self.selectedFile.id
);
console.log("mediaSourceUrl = " + mediaSourceUrl);
self.entity["mediaSource"] = mediaSourceUrl;
console.log("mediaSource = " + self.entity.mediaSource);
}
let mediaSourceType = await self.primaryFileService.getPrimaryFile(
self.selectedFile.id
);
self.selectedFile["mediaInfo"] = mediaSourceType.mediaInfo;
self.entity = self.selectedFile;
self.entity["mediaInfo"] = mediaSourceType.mediaInfo;
self.entity["mediaType"] = mediaSourceType.mimeType.substring(0, 5);
console.log("mediaType = " + self.entity.mediaType);
self.showLoader = false;
}
},
Expand Down Expand Up @@ -1511,6 +1513,9 @@ export default {
} else if (formHTML) {
formHTML.style.width = "100%";
}
console.log("end of mounted: mediaSource = " + self.entity.mediaSource);
console.log("end of mounted: mediaType = " + self.entity.mediaType);
},
};
</script>
Expand Down
1 change: 0 additions & 1 deletion src/components/entity/Mediaelement.vue
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ export default {
player: null,
}),
mounted() {
console.log(this.type);
const { MediaElementPlayer } = global;
const componentObject = this;
this.player = new MediaElementPlayer(this.$el, {
Expand Down
26 changes: 7 additions & 19 deletions src/components/shared/Search.vue
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,8 @@
<button class="btn btn-success" type="submit">Go</button>
</div>
</div>
<!-- <typeahead :source="typeaheadSearchItems" filter-key="items" filter-type="contains" :start-at="1" @selection="addItem"
id="colFormLabelSearch" class="col-10 form-control bootstrap-typeahead" placeholder="Search here"/>-->
<!-- <button class="btn btn-outline-success my-2 my-sm-0 col-2" type="button">Search</button> -->
</form>
<!-- <h6>
Selected:
<span v-if="type && selectedFilters[type]">{{ selectedFilters[type].length }}</span>
</h6> -->


<template v-if="type === 'statuses'">
<b-form-group v-slot="{ ariaDescribedby }">
<b-form-checkbox-group
Expand Down Expand Up @@ -179,9 +172,6 @@
{{ source.workflowName }}
</td>
<td v-if="type === 'outputs'">{{ source.outputName }}</td>
<!-- <td v-if="type === 'workflows' || type === 'collections'">
{{ source.dateCreated | LOCAL_DATE_VALUE }}
</td> -->
<td v-if="type === 'primaryfiles'">
{{ source.externalSource }}
</td>
Expand Down Expand Up @@ -285,9 +275,6 @@
</th>
<th v-if="type === 'workflows'">Workflow</th>
<th v-if="type === 'outputs'">Output</th>
<!-- <th v-if="type === 'workflows' || type === 'collections'">
Date Created
</th> -->
<th v-if="type === 'primaryfiles'">External Source</th>
<th v-if="type === 'primaryfiles' || type === 'item-search'">
External ID
Expand Down Expand Up @@ -397,9 +384,6 @@
{{ source.workflowName }}
</td>
<td v-if="type === 'outputs'">{{ source.outputName }}</td>
<!-- <td v-if="type === 'workflows' || type === 'collections'">
{{ source.dateCreated | LOCAL_DATE_VALUE }}
</td> -->
<td v-if="type === 'primaryfiles'">
{{ source.externalSource }}
</td>
Expand Down Expand Up @@ -857,7 +841,7 @@ export default {
self.selectedUnit.name = record.unitName;
self.selectedCollection = record.collectionName;
}
console.log(self.selectAll);
// console.log(self.selectAll);
const isStatusChecked = self.selectedRecords.indexOf(record.id);
const checkedStatus = self.type === "statuses" && isStatusChecked !== -1;
const isChecked = ev && ev.srcElement && ev.srcElement.checked;
Expand Down Expand Up @@ -891,7 +875,6 @@ export default {
const temp = [];
const tempDataSource = this.dataSource;
tempDataSource.filter((o) =>
// Object.keys(o).some(k => o[k] && o[k].toLowerCase().includes(self.userSearchValue.toLowerCase())));
self.searchProps.filter((el) => {
if (
o[el] &&
Expand Down Expand Up @@ -1041,6 +1024,11 @@ export default {
let uEntity = JSON.parse(
sessionStorage.getItem("unitEntity")
);
console.log("Search: uEntity = " + uEntity);
// if (!uEntity) {
// sessionStorage.setItem("unitEntity",
// JSON.stringify({ ...self.unitEntity })
// );
uEntity.currentUnit = unitId;
sessionStorage.setItem(
"unitEntity",
Expand Down
2 changes: 1 addition & 1 deletion src/helpers/env.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export const env = {
getEnv(key) {
let config = window.config
let value = config[key] || process.env[key]
console.log(`Env.getEnv: config[${key}] = ${config[key]}, return value = ${value}`)
//console.log(`Env.getEnv: config[${key}] = ${config[key]}, return value = ${value}`)
return value
},

Expand Down

0 comments on commit 1cf0801

Please sign in to comment.