Skip to content

Commit 4a7f691

Browse files
authored
Merge pull request #6 from acceleratedscience/wip
Solid BASE_PATH for proxy access
2 parents ffa8906 + 4c79b14 commit 4a7f691

15 files changed

Lines changed: 64 additions & 68 deletions

.github/workflows/release-build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ jobs:
2929
run: npm run build
3030

3131
- name: Archive regular build files
32-
run: tar -czvf gui-build.tar.gz gui-build
32+
run: tar -czvf dist.tar.gz dist
3333

3434
- name: Create GitHub Release
3535
uses: softprops/action-gh-release@v1
3636
with:
37-
files: gui-build.tar.gz
37+
files: dist.tar.gz

.gitignore

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@ coverage
1313
*.local
1414
.env
1515

16-
# Build folders
17-
/gui-build
18-
/gui-build-proxy
16+
# Build folder
17+
/dist
1918

2019
/cypress/videos/
2120
/cypress/screenshots/

index.html

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,18 @@
11
<!doctype html>
22
<html lang="en">
33
<head>
4+
<base href="/__BASE_PATH__/" />
45
<script>
5-
// Dynamically set the base URL for the application
6-
const base = document.createElement('base')
7-
const baseUrl = '{{ base_url }}'
8-
base.href = baseUrl // HTML links and relative paths
9-
window.dynamicBaseUrl = baseUrl // Vue router links
10-
document.head.insertBefore(base, document.head.firstChild)
6+
window.dynamicBasePath = '/__BASE_PATH__/' // Vue router links
117
</script>
128
<meta charset="UTF-8" />
139
<link rel="icon" href="favicon.ico" />
1410
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
15-
<script src="/rdkit/RDKit_minimal.js"></script>
16-
<title>OpenAD GUI</title>
11+
<script src="rdkit/RDKit_minimal.js"></script>
12+
<title>OMGUI</title>
1713
</head>
1814
<body>
1915
<div id="app"></div>
20-
<script type="module" src="/src/main.ts"></script>
16+
<script type="module" src="src/main.ts"></script>
2117
</body>
2218
</html>

src/api/segments/MoleculesApi.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -36,22 +36,22 @@ export default class MoleculesApi extends BaseApi {
3636
///////////////////////////////////////////////////////////////
3737
// #region - Manipulation
3838

39-
// Save molecule to my-mols.
40-
addMolToMyMols(mol: Smol | TempSmol) {
41-
return this.apiClient.post('/add-mol-to-mymols', { mol }) // Smol, may support mmol later
39+
// Save molecule to your mws
40+
addMolToMWS(mol: Smol | TempSmol) {
41+
return this.apiClient.post('/add-mol-to-mws', { mol }) // Smol, may support mmol later
4242
}
4343

44-
// Remove molecule from my-mols
45-
removeMolFromMyMols(mol: Smol | TempSmol) {
46-
return this.apiClient.post('/remove-mol-from-mymols', { mol }) // Smol, may support mmol later
44+
// Remove molecule from your mws
45+
removeMolFromMWS(mol: Smol | TempSmol) {
46+
return this.apiClient.post('/remove-mol-from-mws', { mol }) // Smol, may support mmol later
4747
}
4848

49-
// Check if a molecule is in my-mols
50-
checkMolInMyMols(mol: Smol | TempSmol) {
51-
return this.apiClient.post('/check-mol-in-mymols', { mol }) // Smol, may support mmol later
49+
// Check if a molecule is in your mws
50+
checkMolInMWS(mol: Smol | TempSmol) {
51+
return this.apiClient.post('/check-mol-in-mws', { mol }) // Smol, may support mmol later
5252
}
5353

54-
// Check if a molecule is in my-mols
54+
// Check if a molecule is in your mws
5555
enrichSmol(smol: Smol | TempSmol) {
5656
return this.apiClient.post('/enrich-smol', { smol })
5757
}
@@ -86,7 +86,7 @@ export default class MoleculesApi extends BaseApi {
8686
}
8787

8888
// Update molset with the molecule data.
89-
replaceMolInMolset(path: string, mol: Smol, context: 'json' | 'my-mols', cacheId: number) {
89+
replaceMolInMolset(path: string, mol: Smol, context: 'json' | 'mws', cacheId: number) {
9090
return this.apiClient.post('/replace-mol-in-molset', { path, mol, context, cacheId }) // Smol, may support mmol later
9191
}
9292

@@ -176,10 +176,10 @@ export default class MoleculesApi extends BaseApi {
176176
return this.apiClient.post('/update-molset', { path, cacheId })
177177
}
178178

179-
// Update my-mols molset
179+
// Update mws
180180
// This overrides the working list molecules stored in the cmd_pointer with the ones from the working copy.
181-
updateMolset_mymols(cacheId: number) {
182-
return this.apiClient.post('/update-molset-mymols', { cacheId })
181+
updateMolset_mws(cacheId: number) {
182+
return this.apiClient.post('/update-molset-mws', { cacheId })
183183
}
184184

185185
// #endregion

src/components/BaseBookmark.vue

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
iconHover="icn-bookmark-full"
77
iconOn="icn-bookmark-full"
88
iconOnHover="icn-bookmark-remove"
9-
@toggle-on="addToMymols"
10-
@toggle-off="removeFromMymols"
9+
@toggle-on="addToMWS"
10+
@toggle-off="removeFromMWS"
1111
/>
1212
</template>
1313

@@ -46,12 +46,12 @@ onMounted(updateStatus)
4646
*/
4747
4848
// Add
49-
async function addToMymols() {
49+
async function addToMWS() {
5050
if (!props.mol) {
5151
loadingError.value = 'x'
5252
return
5353
}
54-
apiFetch(moleculesApi.addMolToMyMols(props.mol), {
54+
apiFetch(moleculesApi.addMolToMWS(props.mol), {
5555
onError: () => {
5656
if (toggleBtn.value) toggleBtn.value.toggle(false, true)
5757
},
@@ -61,12 +61,12 @@ async function addToMymols() {
6161
}
6262
6363
// Remove
64-
async function removeFromMymols() {
64+
async function removeFromMWS() {
6565
if (!props.mol) {
6666
loadingError.value = 'x'
6767
return
6868
}
69-
apiFetch(moleculesApi.removeMolFromMyMols(props.mol), {
69+
apiFetch(moleculesApi.removeMolFromMWS(props.mol), {
7070
onError: (data: { status: boolean }) => {
7171
if (toggleBtn.value) toggleBtn.value.toggle(data.status, true)
7272
},
@@ -82,7 +82,7 @@ function updateStatus() {
8282
if (!props.mol || !('properties' in props.mol)) return
8383
8484
if (props.mol) {
85-
apiFetch(moleculesApi.checkMolInMyMols(props.mol), {
85+
apiFetch(moleculesApi.checkMolInMWS(props.mol), {
8686
onSuccess: (data: { status: boolean }) => {
8787
if (toggleBtn.value) toggleBtn.value.toggle(data.status, true)
8888
},

src/components/TheButtonSaveMol.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ const isForeignFile: ComputedRef<boolean> = computed(() => {
4545
// Control the button text, either 'Save' or 'Save as...'
4646
const saveAs: ComputedRef<boolean> = computed(() => {
4747
if (molGridStore.active) {
48-
// molset.json / my-mols --> Update the source.
49-
if (molGridStore.context == 'json' || molGridStore.context == 'my-mols') return false
48+
// molset.json / mws --> Update the source.
49+
if (molGridStore.context == 'json' || molGridStore.context == 'mws') return false
5050
} else if (fileStore.fileType == 'smol') {
5151
// smol.json --> Update the source.
5252
return false
@@ -84,7 +84,7 @@ async function onSaveClick() {
8484
if (molGridStore.context == 'json') {
8585
// .molset.json file --> Update the JSON file.
8686
success = await molGridStore.replaceMolInMolset(fileStore.path, molViewerStore.smol as Smol, molGridStore.context)
87-
} else if (molGridStore.context == 'my-mols') {
87+
} else if (molGridStore.context == 'mws') {
8888
// My mols --> Update your working molecule set.
8989
success = await molGridStore.replaceMolInMolset(fileStore.path, molViewerStore.smol as Smol, molGridStore.context)
9090
} else {

src/components/TheButtonSaveMolset.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ import type { ComponentPublicInstance } from 'vue'
4747
type SaveType = 'as-molset' | 'update-original' | ''
4848
4949
// Definitions
50-
const btnText = ['result-mols', 'my-mols'].includes(molGridStore.context || '') ? 'Update' : 'Save'
50+
const btnText = ['result-mols', 'mws'].includes(molGridStore.context || '') ? 'Update' : 'Save'
5151
const loading = ref<boolean>(false)
5252
const error = ref<boolean>(false)
5353
const success = ref<boolean>(false)
@@ -101,7 +101,7 @@ async function onSaveClick(saveType: SaveType) {
101101
} else {
102102
// Singular save button to update the source.
103103
// Used everywhere else.
104-
submitted = await executeSave() // --> Updates the source, either molset.json, memory or my-mols
104+
submitted = await executeSave() // --> Updates the source, either molset.json, memory or mws
105105
}
106106
// console.log('<< execSave')
107107
loading.value = false
@@ -125,8 +125,8 @@ async function onSaveClick(saveType: SaveType) {
125125
function executeSave(): Promise<boolean> {
126126
if (molGridStore.context == 'json') {
127127
return molGridStore.updateMolset()
128-
} else if (molGridStore.context == 'my-mols') {
129-
return molGridStore.updateMolset_mymols()
128+
} else if (molGridStore.context == 'mws') {
129+
return molGridStore.updateMolset_mws()
130130
} else if (molGridStore.context == 'result-mols') {
131131
return molGridStore.updateMolset_result()
132132
} else if (molGridStore.context == 'dataframe') {

src/components/TheMolGrid.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ const $molGrid = ref<HTMLElement | null>(null)
107107
108108
// Props
109109
const props = defineProps<{
110-
// Cache is always cleared when leaving the molgrid,
111-
// either when opening molset files or when checking my-mols.
110+
// Cache is always cleared when leaving the molgrid, either
111+
// when opening molset files or when checking your mws.
112112
// However when a molset is opened by its cacheId (/molset/1234),
113113
// then the cache is retained when opening a molecule in the molset.
114114
retainCache?: boolean

src/components/TheMolGridActions.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ const vmodelPagination: WritableComputedRef<number> = computed({
121121
122122
// Save button disabled state.
123123
const disableSave: ComputedRef<boolean> = computed(() => {
124-
if (['result-mols', 'my-mols', 'json'].includes(molGridStore.context || '')) {
124+
if (['result-mols', 'mws', 'json'].includes(molGridStore.context || '')) {
125125
return !molGridStore.hasChanges
126126
} else {
127127
return false

src/components/TheNav.vue

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@
4343
/> -->
4444

4545
<!-- My mols -->
46-
<router-link :to="{ name: 'my-mols' }" class="my-mols">
47-
<BaseIconButton icon="icn-bookmark" iconHover="icn-bookmark-full" iconSel="icn-bookmark-full" :sel="sel == 'my-mols'" />
46+
<router-link :to="{ name: 'mws' }" class="mws">
47+
<BaseIconButton icon="icn-bookmark" iconHover="icn-bookmark-full" iconSel="icn-bookmark-full" :sel="sel == 'mws'" />
4848
</router-link>
4949

5050
<!-- Result -->
@@ -86,7 +86,7 @@ import BaseIconButton from '@/components/BaseIconButton.vue'
8686
8787
// Type declarations
8888
import type { ComputedRef } from 'vue'
89-
type Sel = 'dir' | 'mol' | 'result' | 'my-mols' | 'assistant' | 'cli'
89+
type Sel = 'dir' | 'mol' | 'result' | 'mws' | 'assistant' | 'cli'
9090
9191
/**
9292
* Computed
@@ -107,8 +107,8 @@ const sel: ComputedRef<Sel | null> = computed(() => {
107107
return 'mol'
108108
} else if (route.name == 'result') {
109109
return 'result'
110-
} else if (route.name == 'my-mols') {
111-
return 'my-mols'
110+
} else if (route.name == 'mws') {
111+
return 'mws'
112112
}
113113
return null
114114
})
@@ -230,9 +230,9 @@ nav .display::after {
230230
content: 'Molecule viewer';
231231
}
232232
233-
// My Molecules
234-
nav a.my-mols:hover ~ .display::after {
235-
content: 'My Molecules';
233+
// Molecule working set
234+
nav a.mws:hover ~ .display::after {
235+
content: 'Molecule working set';
236236
}
237237
238238
// Result

0 commit comments

Comments
 (0)