Commit d3db2da5 authored by Stéphane Bouvry's avatar Stéphane Bouvry
Browse files

Fix #295 Mise à jour de la configuration VUE (emulation JSON/HTTP)

parent 0734f81e
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -499,6 +499,10 @@ class AdministrationController extends AbstractOscarController
        $authentificationId = $this->params()->fromPost('authentification_id');
        $roleId = $this->params()->fromPost('role_id');

        $this->getLogger()->debug("RoleID : $roleId");
        $this->getLogger()->debug("AuthentificationID : $authentificationId");
        $this->getLogger()->debug(print_r($_POST, true));

        try {
            /** @var Authentification $authentification */
            $authentification = $this->getEntityManager()->getRepository(Authentification::class)->find($authentificationId);
@@ -509,10 +513,10 @@ class AdministrationController extends AbstractOscarController
                return $this->getResponseNotFound("Compte introuvable.");
            }
            if( !$role ){
                return $this->getResponseNotFound("Rôle introuvable.");
                return $this->getResponseNotFound("Rôle '$roleId' introuvable.");
            }
        } catch ( \Exception $e ){
            return $this->getResponseInternalError("Rôle/Authentification introuvable.");
            return $this->getResponseInternalError("Rôle/Authentification introuvable : " . $e->getMessage());
        }

        $method = $this->getHttpXMethod();
+5 −0
Original line number Diff line number Diff line
@@ -240,8 +240,10 @@
<script>

    require(['vue', 'vue-resource', 'mm', 'authentification'], function(Vue, VueResource, moment, Authentification){

        Vue.use(VueResource);


        const regex = /\[\w*:[0-9]*:([^\]]*)\]/g;

        Vue.filter('logMessage', function (message) {
@@ -253,6 +255,9 @@
            return "le " + m.format('dddd D MMMM YYYY') + ', ' + m.fromNow();
        });

        Vue.http.options.emulateHTTP = true;
        Vue.http.options.emulateJSON = true;

        new Vue({
            render(h) {
                return h(Authentification.default, {
+137 −2

File changed.

Preview size limit exceeded, changes collapsed.

+8 −4
Original line number Diff line number Diff line
@@ -154,6 +154,7 @@
    </section>
</template>
<script>
    // poi watch --format umd --moduleName  Authentification --filename.css Authentification.css --filename.js Authentification.js --dist public/js/oscar/dist public/js/oscar/src/Authentification.vue
    export default {
        props: {
            'users': {required: true},
@@ -235,10 +236,13 @@
                this.addRoleError = null;

                if (this.addRoleUser.id && this.addRoleId) {
                    this.$http.post(this.urlRoles, {
                        authentification_id: this.addRoleUser.id,
                        role_id: this.addRoleId
                    }).then(

                    var form = new FormData();
                    form.append('authentification_id', this.addRoleUser.id);
                    form.append('role_id', this.addRoleId);


                    this.$http.post(this.urlRoles, form).then(
                        res => {
                            this.addRoleUser.roles = res.data.roles;
                            this.addRoleUser = null;