Commit 18d45bca authored by Sonia Zorba's avatar Sonia Zorba
Browse files

UI improvements; Added logout

parent 359bf2b9
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
VUE_APP_API_CLIENT = 'server'
VUE_APP_API_BASE_URL = '/'
VUE_APP_API_BASE_URL = ''
+6 −1
Original line number Diff line number Diff line
@@ -61,7 +61,12 @@ export default {
      this.$store.state.input.searchFilter = null;
      client.fetchGroupsTab(this.input)
        .then(model => {
          if (model.groupsPanel.items.length > 0) {
            this.$store.commit('updateGroups', model);
          } else {
            // If there are no subgroups show the members panel
            this.$store.commit('setTabIndex', '1');
          }
        });
    },
    openRenameGroupModal: function(group) {
+11 −4
Original line number Diff line number Diff line
@@ -9,14 +9,14 @@

      <!-- Right aligned nav items -->
      <b-navbar-nav class="ml-auto">
        <!--
        <b-nav-form>
          <b-form-input size="sm" class="mr-sm-2" placeholder="Search"></b-form-input>
          <b-button size="sm" class="my-2 my-sm-0" type="submit">Search</b-button>
        </b-nav-form>

        <b-nav-item-dropdown right v-if="user">
          <template slot="button-content"><em>{{user}}</em></template>
          <b-dropdown-item href="#">Preferences</b-dropdown-item>
        -->
        <b-nav-item-dropdown :text="user" right v-if="user">
          <b-dropdown-item href="logout">Logout</b-dropdown-item>
        </b-nav-item-dropdown>
      </b-navbar-nav>
    </b-collapse>
@@ -32,3 +32,10 @@ export default {
  }
}
</script>

<style>
.navbar-dark .nav-link {
  color: rgba(255, 255, 255, .7);
  font-weight: bold;
}
</style>
+15 −14
Original line number Diff line number Diff line
<template>
<b-modal id="add-group-modal" title="Add group" @show="resetModal" ok-title="Add" @ok="addGroup">
<b-modal id="add-group-modal" title="Add group" @show="resetModal" @shown="afterShow" ok-title="Add" @ok="addGroup">
  <b-form inline>
    <label class="w-25" for="new-group-name-input">Group name:</label>
    <b-form-input v-model="newGroupName" id="new-group-name-input" class="w-75" aria-describedby="new-group-name-input-feedback" :state="newGroupNameState" v-on:input="resetError">
    <b-form-input v-model="newGroupName" id="new-group-name-input" ref="newGroupNameInput" class="w-75" aria-describedby="new-group-name-input-feedback" :state="newGroupNameState" v-on:input="resetError" @keydown.native.enter="addGroup">
    </b-form-input>
    <b-form-invalid-feedback id="new-group-name-input-feedback">{{newGroupNameError}}</b-form-invalid-feedback>
  </b-form>
@@ -32,6 +32,9 @@ export default {
      this.newGroupName = null;
      this.resetError();
    },
    afterShow: function() {
      this.$refs.newGroupNameInput.focus();
    },
    resetError: function() {
      this.newGroupNameError = null;
    },
@@ -41,10 +44,7 @@ export default {

      if (!this.newGroupName) {
        this.newGroupNameError = "Group name is required";
        return;
      }

      let parent = this.$store.getters.selectedGroupId;
      } else {
        client.addGroup(this.newGroupName, this.$store.state.input)
          .then(res => {
            if (res.status === 400) {
@@ -57,4 +57,5 @@ export default {
      }
    }
  }
}
</script>
+12 −3
Original line number Diff line number Diff line
<template>
<b-modal id="add-member-modal" title="Add member" ok-title="Add" @ok="addMember">
  <SearchUser ref="searchUser" />
<b-modal id="add-member-modal" title="Add member" ok-title="Add" @shown="afterShow" @ok="addMember">
  <SearchUser ref="searchUser" @searchUserEnter="addMember" />
</b-modal>
</template>

@@ -17,13 +17,22 @@ export default {
    SearchUser
  },
  methods: {
    afterShow: function() {
      this.$refs.searchUser.$refs.userInput.focus();
    },
    addMember: function(event) {
      // Prevent modal from closing
      if (event) {
        event.preventDefault();
      }

      let userId = this.$refs.searchUser.selectedUser;
      let permission = this.$refs.searchUser.permission;

      if (!userId || !permission) {
        return;
      }

      client.addMember(userId, permission, this.$store.state.input)
        .then(res => {
          this.$store.commit('updateMembersPanel', res);
Loading